Changes in src/AST/Decl.cpp [b230091:3e54399]
- File:
-
- 1 edited
-
src/AST/Decl.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
rb230091 r3e54399 39 39 if ( uniqueId ) return; // ensure only set once 40 40 uniqueId = ++lastUniqueId; 41 // The extra readonly pointer is causing some reference counting issues. 42 // idMap[ uniqueId ] = this; 41 idMap[ uniqueId ] = this; 43 42 } 44 43 45 44 readonly<Decl> Decl::fromId( UniqueId id ) { 46 // Right now this map is always empty, so don't use it.47 assert( false );48 45 IdMapType::const_iterator i = idMap.find( id ); 49 46 if ( i != idMap.end() ) return i->second; … … 68 65 } 69 66 for (auto & tp : this->type_params) { 70 ftype->forall.emplace_back(new TypeInstType(tp ));67 ftype->forall.emplace_back(new TypeInstType(tp->name, tp)); 71 68 for (auto & ap: tp->assertions) { 72 69 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); … … 136 133 137 134 auto it = enumValues.find( enumerator->name ); 135 138 136 if ( it != enumValues.end() ) { 139 value = it->second; 137 138 // Handle typed enum by casting the value in (C++) compiler 139 // if ( base ) { // A typed enum 140 // if ( const BasicType * bt = dynamic_cast<const BasicType *>(base) ) { 141 // switch( bt->kind ) { 142 // case BasicType::Kind::Bool: value = (bool) it->second; break; 143 // case BasicType::Kind::Char: value = (char) it->second; break; 144 // case BasicType::Kind::SignedChar: value = (signed char) it->second; break; 145 // case BasicType::Kind::UnsignedChar: value = (unsigned char) it->second; break; 146 // case BasicType::Kind::ShortSignedInt: value = (short signed int) it->second; break; 147 // case BasicType::Kind::SignedInt: value = (signed int) it->second; break; 148 // case BasicType::Kind::UnsignedInt: value = (unsigned int) it->second; break; 149 // case BasicType::Kind::LongSignedInt: value = (long signed int) it->second; break; 150 // case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break; 151 // case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break; 152 // case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 153 // // TODO: value should be able to handle long long unsigned int 154 155 // default: 156 // value = it->second; 157 // } 158 // } 159 // } else { 160 value = it->second; 161 //} 162 140 163 return true; 141 164 }
Note:
See TracChangeset
for help on using the changeset viewer.