44 std::vector<const IR::Type *> canonicalTuples;
45 std::vector<const IR::Type *> canonicalStacks;
46 std::vector<const IR::Type *> canonicalP4lists;
47 std::vector<const IR::Type *> canonicalLists;
50 absl::flat_hash_map<const IR::Node *, const IR::Type *, Util::Hash> typeMap;
52 absl::flat_hash_set<const IR::Expression *, Util::Hash> leftValues;
56 absl::flat_hash_set<const IR::Expression *, Util::Hash> constants;
62 void checkPrecondition(
const IR::Node *element,
const IR::Type *type)
const;
70 void setStrictStruct(
bool value) {
strictStruct = value; }
71 bool contains(
const IR::Node *element) {
return typeMap.count(element) != 0; }
72 void setType(
const IR::Node *element,
const IR::Type *type);
73 const IR::Type *getType(
const IR::Node *element,
bool notNull =
false)
const;
75 const IR::Type *getTypeType(
const IR::Node *element,
bool notNull)
const;
76 void dbprint(std::ostream &out)
const;
78 bool isLeftValue(
const IR::Expression *expression)
const {
79 return leftValues.count(expression) > 0;
81 bool isCompileTimeConstant(
const IR::Expression *expression)
const;
82 size_t size()
const {
return typeMap.size(); }
84 void setLeftValue(
const IR::Expression *expression);
85 void cloneExpressionProperties(
const IR::Expression *to,
const IR::Expression *from);
86 void setCompileTimeConstant(
const IR::Expression *expression);
87 void addSubstitutions(
const TypeVariableSubstitution *tvs);
88 const IR::Type *getSubstitution(
const IR::ITypeVar *var) {
89 return allTypeVariables.lookup(var);
91 const TypeVariableSubstitution *getSubstitutions()
const {
return &allTypeVariables; }
96 bool equivalent(
const IR::Type *left,
const IR::Type *right,
bool strict =
false)
const;
103 const IR::Type *getCanonical(
const IR::Type *type);
107 int widthBits(
const IR::Type *type,
const IR::Node *errorPosition,
bool max)
const;
bool equivalent(const IR::Type *left, const IR::Type *right, bool strict=false) const
Definition typeMap.cpp:140
int widthBits(const IR::Type *type, const IR::Node *errorPosition, bool max) const
Definition typeMap.cpp:356
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24