@@ -59,7 +59,7 @@ ProgramStructure::addNameAnnotation(cstring name, const IR::Annotations* annos)
59
59
if (annos == nullptr )
60
60
annos = IR::Annotations::empty;
61
61
return annos->addAnnotationIfNew (IR::Annotation::nameAnnotation,
62
- new IR::StringLiteral (name));
62
+ new IR::StringLiteral (name), false );
63
63
}
64
64
65
65
const IR::Annotations*
@@ -810,9 +810,11 @@ ProgramStructure::convertActionProfile(const IR::ActionProfile* action_profile,
810
810
auto width = new IR::Constant (v1model.action_selector .widthType , flc->output_width );
811
811
args->push_back (new IR::Argument (width));
812
812
if (action_selector->mode )
813
- annos = annos->addAnnotation (" mode" , new IR::StringLiteral (action_selector->mode ));
813
+ annos = annos->addAnnotation (
814
+ " mode" , new IR::StringLiteral (action_selector->mode ), false );
814
815
if (action_selector->type )
815
- annos = annos->addAnnotation (" type" , new IR::StringLiteral (action_selector->type ));
816
+ annos = annos->addAnnotation (
817
+ " type" , new IR::StringLiteral (action_selector->type ), false );
816
818
auto fl = getFieldLists (flc);
817
819
for (auto annot : fl->annotations ->annotations ) {
818
820
annos = annos->add (annot);
@@ -867,7 +869,7 @@ ProgramStructure::convertTable(const IR::V1Table* table, cstring newName,
867
869
actionList->push_back (
868
870
new IR::ActionListElement (
869
871
new IR::Annotations (
870
- {new IR::Annotation (IR::Annotation::defaultOnlyAnnotation, {})}),
872
+ {new IR::Annotation (IR::Annotation::defaultOnlyAnnotation, {}, false )}),
871
873
new IR::PathExpression (default_action))); }
872
874
props->push_back (new IR::Property (IR::ID (IR::TableProperties::actionsPropertyName),
873
875
actionList, false ));
@@ -1987,9 +1989,9 @@ ProgramStructure::convert(const IR::CounterOrMeter* cm, cstring newName) {
1987
1989
auto annos = addGlobalNameAnnotation (cm->name , cm->annotations );
1988
1990
if (auto *c = cm->to <IR::Counter>()) {
1989
1991
if (c->min_width >= 0 )
1990
- annos = annos->addAnnotation (" min_width" , new IR::Constant (c->min_width ));
1992
+ annos = annos->addAnnotation (" min_width" , new IR::Constant (c->min_width ), false );
1991
1993
if (c->max_width >= 0 )
1992
- annos = annos->addAnnotation (" max_width" , new IR::Constant (c->max_width ));
1994
+ annos = annos->addAnnotation (" max_width" , new IR::Constant (c->max_width ), false );
1993
1995
}
1994
1996
auto decl = new IR::Declaration_Instance (
1995
1997
newName, annos, type, args, nullptr );
@@ -2020,7 +2022,7 @@ ProgramStructure::convertDirectMeter(const IR::Meter* m, cstring newName) {
2020
2022
if (m->pre_color != nullptr ) {
2021
2023
auto meterPreColor = ExpressionConverter (this ).convert (m->pre_color );
2022
2024
if (meterPreColor != nullptr )
2023
- annos = annos->addAnnotation (" pre_color" , meterPreColor);
2025
+ annos = annos->addAnnotation (" pre_color" , meterPreColor, false );
2024
2026
}
2025
2027
auto decl = new IR::Declaration_Instance (newName, annos, specType, args, nullptr );
2026
2028
return decl;
@@ -2038,9 +2040,9 @@ ProgramStructure::convertDirectCounter(const IR::Counter* c, cstring newName) {
2038
2040
args->push_back (new IR::Argument (kindarg));
2039
2041
auto annos = addGlobalNameAnnotation (c->name , c->annotations );
2040
2042
if (c->min_width >= 0 )
2041
- annos = annos->addAnnotation (" min_width" , new IR::Constant (c->min_width ));
2043
+ annos = annos->addAnnotation (" min_width" , new IR::Constant (c->min_width ), false );
2042
2044
if (c->max_width >= 0 )
2043
- annos = annos->addAnnotation (" max_width" , new IR::Constant (c->max_width ));
2045
+ annos = annos->addAnnotation (" max_width" , new IR::Constant (c->max_width ), false );
2044
2046
auto decl = new IR::Declaration_Instance (newName, annos, type, args, nullptr );
2045
2047
return decl;
2046
2048
}
@@ -2475,19 +2477,19 @@ void ProgramStructure::createChecksumUpdates() {
2475
2477
auto mc = new IR::MethodCallStatement (methodCallExpression);
2476
2478
if (flc->algorithm ->names [0 ] == " csum16_udp" ) {
2477
2479
auto zeros_as_ones_annot = new IR::Annotation (IR::ID (" zeros_as_ones" ),
2478
- {methodCallExpression});
2480
+ {methodCallExpression}, false );
2479
2481
body->annotations = body->annotations ->add (zeros_as_ones_annot);
2480
2482
}
2481
2483
2482
2484
for (auto annot : cf->annotations ->annotations ) {
2483
- auto newAnnot = new IR::Annotation (annot->name , {});
2485
+ auto newAnnot = new IR::Annotation (annot->name , {}, false );
2484
2486
for (auto expr : annot->expr )
2485
2487
newAnnot->expr .push_back (expr);
2486
2488
newAnnot->expr .push_back (methodCallExpression);
2487
2489
body->annotations = body->annotations ->add (newAnnot);
2488
2490
}
2489
2491
for (auto annot : flc->annotations ->annotations ) {
2490
- auto newAnnot = new IR::Annotation (annot->name , {});
2492
+ auto newAnnot = new IR::Annotation (annot->name , {}, false );
2491
2493
for (auto expr : annot->expr )
2492
2494
newAnnot->expr .push_back (expr);
2493
2495
newAnnot->expr .push_back (methodCallExpression);
0 commit comments