Changeset 63d1ebe for src/AST/Type.cpp
- Timestamp:
- Oct 27, 2022, 11:43:10 AM (23 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 0026d67
- Parents:
- a167c70c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.cpp
ra167c70c r63d1ebe 147 147 // --- TypeInstType 148 148 149 bool TypeInstType::operator==( const TypeInstType & other ) const { 150 return base == other.base 151 && formal_usage == other.formal_usage 152 && expr_id == other.expr_id; 153 } 154 149 155 TypeInstType::TypeInstType( const TypeDecl * b, 150 156 CV::Qualifiers q, std::vector<ptr<Attribute>> && as ) … … 157 163 158 164 bool TypeInstType::isComplete() const { return base->sized; } 165 166 std::string TypeInstType::TypeEnvKey::typeString() const { 167 return std::string("_") + std::to_string(formal_usage) 168 + "_" + std::to_string(expr_id) + "_" + base->name; 169 } 170 171 bool TypeInstType::TypeEnvKey::operator==( 172 const TypeInstType::TypeEnvKey & other ) const { 173 return base == other.base 174 && formal_usage == other.formal_usage 175 && expr_id == other.expr_id; 176 } 177 178 bool TypeInstType::TypeEnvKey::operator<( 179 const TypeInstType::TypeEnvKey & other ) const { 180 // TypeEnvKey ordering is an arbitrary total ordering. 181 // It doesn't mean anything but allows for a sorting. 182 if ( base < other.base ) { 183 return true; 184 } else if ( other.base < base ) { 185 return false; 186 } else if ( formal_usage < other.formal_usage ) { 187 return true; 188 } else if ( other.formal_usage < formal_usage ) { 189 return false; 190 } else { 191 return expr_id < other.expr_id; 192 } 193 } 159 194 160 195 // --- TupleType
Note: See TracChangeset
for help on using the changeset viewer.