45 std::vector<const IR::Type *> canonicalTuples;
46 std::vector<const IR::Type *> canonicalStacks;
47 std::vector<const IR::Type *> canonicalP4lists;
48 std::vector<const IR::Type *> canonicalLists;
51 absl::flat_hash_map<const IR::Node *, const IR::Type *, Util::Hash> typeMap;
53 absl::flat_hash_set<const IR::Expression *, Util::Hash> leftValues;
57 absl::flat_hash_set<const IR::Expression *, Util::Hash> constants;
63 void checkPrecondition(
const IR::Node *element,
const IR::Type *type)
const;
71 void setStrictStruct(
bool value) {
strictStruct = value; }
72 bool contains(
const IR::Node *element) {
return typeMap.count(element) != 0; }
73 void setType(
const IR::Node *element,
const IR::Type *type);
74 const IR::Type *getType(
const IR::Node *element,
bool notNull =
false)
const;
76 const IR::Type *getTypeType(
const IR::Node *element,
bool notNull)
const;
77 void dbprint(std::ostream &out)
const;
79 bool isLeftValue(
const IR::Expression *expression)
const {
80 return leftValues.count(expression) > 0;
82 bool isCompileTimeConstant(
const IR::Expression *expression)
const;
83 size_t size()
const {
return typeMap.size(); }
85 void setLeftValue(
const IR::Expression *expression);
86 void cloneExpressionProperties(
const IR::Expression *to,
const IR::Expression *from);
87 void setCompileTimeConstant(
const IR::Expression *expression);
88 void addSubstitutions(
const TypeVariableSubstitution *tvs);
89 const IR::Type *getSubstitution(
const IR::ITypeVar *var) {
90 return allTypeVariables.lookup(var);
92 const TypeVariableSubstitution *getSubstitutions()
const {
return &allTypeVariables; }
97 bool equivalent(
const IR::Type *left,
const IR::Type *right,
bool strict =
false)
const;
104 const IR::Type *getCanonical(
const IR::Type *type);
108 int widthBits(
const IR::Type *type,
const IR::Node *errorPosition,
bool max);
bool equivalent(const IR::Type *left, const IR::Type *right, bool strict=false) const
Definition typeMap.cpp:140