18 CheckTableSize() { setName(
"CheckTableSize"); }
19 bool preorder(IR::P4Table *table)
override {
20 auto size = table->getSizeProperty();
21 if (size ==
nullptr)
return false;
23 bool deleteSize =
false;
24 auto key = table->getKey();
26 if (size->value != 1) {
27 warn(ErrorType::WARN_MISMATCH,
"%1%: size %2% specified for table without keys",
32 auto entries = table->properties->getProperty(IR::TableProperties::entriesPropertyName);
33 if (entries !=
nullptr && entries->isConstant) {
34 warn(ErrorType::WARN_MISMATCH,
35 "%1%: size %2% specified for table with constant entries", table, size);
40 props.removeByName(IR::TableProperties::sizePropertyName);
41 table->properties =
new IR::TableProperties(table->properties->srcInfo, props);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13