@@ -140,7 +140,7 @@ void EBPFTable::validateKeys() const {
140
140
for (auto it : keyGenerator->keyElements ) {
141
141
auto mtdecl = program->refMap ->getDeclaration (it->matchType ->path , true );
142
142
auto matchType = mtdecl->getNode ()->to <IR::Declaration_ID>();
143
- if (matchType->name .name == P4::P4CoreLibrary::instance.lpmMatch .name ) {
143
+ if (matchType->name .name == P4::P4CoreLibrary::instance () .lpmMatch .name ) {
144
144
if (it != *lastKey) {
145
145
::error (ErrorType::ERR_UNSUPPORTED,
146
146
" %1% field key must be at the end of whole key" , it->matchType);
@@ -297,7 +297,7 @@ void EBPFTable::emitValueActionIDNames(CodeBuilder *builder) {
297
297
auto action = adecl->getNode ()->to <IR::P4Action>();
298
298
// no need to define a constant for NoAction,
299
299
// "case 0" will be explicitly generated in the action handling switch
300
- if (action->name .originalName == P4::P4CoreLibrary::instance.noAction .name ) {
300
+ if (action->name .originalName == P4::P4CoreLibrary::instance () .noAction .name ) {
301
301
continue ;
302
302
}
303
303
builder->emitIndent ();
@@ -333,7 +333,7 @@ void EBPFTable::emitValueStructStructure(CodeBuilder *builder) {
333
333
for (auto a : actionList->actionList ) {
334
334
auto adecl = program->refMap ->getDeclaration (a->getPath (), true );
335
335
auto action = adecl->getNode ()->to <IR::P4Action>();
336
- if (action->name .originalName == P4::P4CoreLibrary::instance.noAction .name ) continue ;
336
+ if (action->name .originalName == P4::P4CoreLibrary::instance () .noAction .name ) continue ;
337
337
cstring name = EBPFObject::externalName (action);
338
338
emitActionArguments (builder, action, name);
339
339
}
@@ -408,7 +408,7 @@ void EBPFTable::emitInstance(CodeBuilder *builder) {
408
408
for (auto it : keyGenerator->keyElements ) {
409
409
auto mtdecl = program->refMap ->getDeclaration (it->matchType ->path , true );
410
410
auto matchType = mtdecl->getNode ()->to <IR::Declaration_ID>();
411
- if (matchType->name .name == P4::P4CoreLibrary::instance.lpmMatch .name ) {
411
+ if (matchType->name .name == P4::P4CoreLibrary::instance () .lpmMatch .name ) {
412
412
if (tableKind == TableLPMTrie) {
413
413
::error (ErrorType::ERR_UNSUPPORTED, " %1%: only one LPM field allowed" ,
414
414
it->matchType);
@@ -491,7 +491,7 @@ void EBPFTable::emitKey(CodeBuilder *builder, cstring keyName) {
491
491
492
492
bool isLPMKeyBigEndian = false ;
493
493
if (isLPMTable ()) {
494
- if (c->matchType ->path ->name .name == P4::P4CoreLibrary::instance.lpmMatch .name )
494
+ if (c->matchType ->path ->name .name == P4::P4CoreLibrary::instance () .lpmMatch .name )
495
495
isLPMKeyBigEndian = true ;
496
496
}
497
497
@@ -852,7 +852,7 @@ void EBPFTable::emitLookup(CodeBuilder *builder, cstring key, cstring value) {
852
852
}
853
853
854
854
cstring EBPFTable::p4ActionToActionIDName (const IR::P4Action *action) const {
855
- if (action->name .originalName == P4::P4CoreLibrary::instance.noAction .name ) {
855
+ if (action->name .originalName == P4::P4CoreLibrary::instance () .noAction .name ) {
856
856
// NoAction always gets ID=0.
857
857
return " 0" ;
858
858
}
@@ -871,10 +871,10 @@ bool EBPFTable::isLPMTable() const {
871
871
for (auto it : keyGenerator->keyElements ) {
872
872
auto mtdecl = program->refMap ->getDeclaration (it->matchType ->path , true );
873
873
auto matchType = mtdecl->getNode ()->to <IR::Declaration_ID>();
874
- if (matchType->name .name == P4::P4CoreLibrary::instance.ternaryMatch .name ) {
874
+ if (matchType->name .name == P4::P4CoreLibrary::instance () .ternaryMatch .name ) {
875
875
// if there is a ternary field, we are sure, it is not an LPM table.
876
876
return false ;
877
- } else if (matchType->name .name == P4::P4CoreLibrary::instance.lpmMatch .name ) {
877
+ } else if (matchType->name .name == P4::P4CoreLibrary::instance () .lpmMatch .name ) {
878
878
isLPM = true ;
879
879
}
880
880
}
@@ -889,7 +889,7 @@ bool EBPFTable::isTernaryTable() const {
889
889
for (auto it : keyGenerator->keyElements ) {
890
890
auto mtdecl = program->refMap ->getDeclaration (it->matchType ->path , true );
891
891
auto matchType = mtdecl->getNode ()->to <IR::Declaration_ID>();
892
- if (matchType->name .name == P4::P4CoreLibrary::instance.ternaryMatch .name ) {
892
+ if (matchType->name .name == P4::P4CoreLibrary::instance () .ternaryMatch .name ) {
893
893
return true ;
894
894
}
895
895
}
0 commit comments