57 static std::vector<IR::Vector<IR::Node> *>
scope;
63 static std::map<cstring, std::map<int, std::set<cstring>>>
lvalMap;
66 static std::map<cstring, std::map<int, std::set<cstring>>>
lvalMapRw;
89 static void addToScope(
const IR::Node *n);
90 static void startLocalScope();
91 static void endLocalScope();
93 static void addLval(
const IR::Type *tp,
cstring name,
bool read_only =
false);
94 static bool checkLval(
const IR::Type *tp,
bool must_write =
false);
95 static cstring pickLval(
const IR::Type *tp,
bool must_write =
false);
96 static void deleteLval(
const IR::Type *tp,
cstring name);
97 static std::set<cstring> getCandidateLvals(
const IR::Type *tp,
bool must_write =
true);
98 static bool hasWriteableLval(
cstring typeKey);
99 static std::optional<std::map<int, std::set<cstring>>> getWriteableLvalForTypeKey(
102 static const IR::Type_Bits *pickDeclaredBitType(
bool must_write =
false);
104 static const IR::Type_Declaration *getTypeByName(
cstring name);
108 template <
typename T>
109 static std::vector<const T *> getDecls() {
110 std::vector<const T *> ret;
112 for (
auto *subScope :
scope) {
113 for (
const auto *node : *subScope) {
114 if (
const T *tmpObj = node->to<T>()) {
115 ret.push_back(tmpObj);
122 static std::vector<const IR::Type_Declaration *> getFilteredDecls(std::set<cstring> filter);
123 static std::set<const IR::P4Table *> *getCallableTables();