Changeset 2e9b59b for src/AST/Decl.cpp
- Timestamp:
- Apr 19, 2022, 3:00:04 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 5b84a321
- Parents:
- ba897d21 (diff), bb7c77d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
rba897d21 r2e9b59b 68 68 } 69 69 for (auto & tp : this->type_params) { 70 ftype->forall.emplace_back(new TypeInstType(tp ->name, tp));70 ftype->forall.emplace_back(new TypeInstType(tp)); 71 71 for (auto & ap: tp->assertions) { 72 72 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); … … 136 136 137 137 auto it = enumValues.find( enumerator->name ); 138 138 139 if ( it != enumValues.end() ) { 139 value = it->second; 140 141 // Handle typed enum by casting the value in (C++) compiler 142 // if ( base ) { // A typed enum 143 // if ( const BasicType * bt = dynamic_cast<const BasicType *>(base) ) { 144 // switch( bt->kind ) { 145 // case BasicType::Kind::Bool: value = (bool) it->second; break; 146 // case BasicType::Kind::Char: value = (char) it->second; break; 147 // case BasicType::Kind::SignedChar: value = (signed char) it->second; break; 148 // case BasicType::Kind::UnsignedChar: value = (unsigned char) it->second; break; 149 // case BasicType::Kind::ShortSignedInt: value = (short signed int) it->second; break; 150 // case BasicType::Kind::SignedInt: value = (signed int) it->second; break; 151 // case BasicType::Kind::UnsignedInt: value = (unsigned int) it->second; break; 152 // case BasicType::Kind::LongSignedInt: value = (long signed int) it->second; break; 153 // case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break; 154 // case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break; 155 // case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 156 // // TODO: value should be able to handle long long unsigned int 157 158 // default: 159 // value = it->second; 160 // } 161 // } 162 // } else { 163 value = it->second; 164 //} 165 140 166 return true; 141 167 }
Note:
See TracChangeset
for help on using the changeset viewer.