Changeset d8e2a09
- Timestamp:
- Apr 10, 2022, 10:06:55 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 5bb1ac1
- Parents:
- 92538ab
- Files:
-
- 3 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/CodeGen/CodeGenerator.cc ¶
r92538ab rd8e2a09 275 275 extension( enumDecl ); 276 276 std::list< Declaration* > &memb = enumDecl->get_members(); 277 if (enumDecl->base && ! memb.empty() && 278 (dynamic_cast<BasicType *>(enumDecl->base) 279 && !(dynamic_cast<BasicType *>(enumDecl->base)->kind == BasicType::Kind::SignedInt))) { 277 if (enumDecl->base && ! memb.empty()) { 280 278 ObjectDecl * last = nullptr; 281 279 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { -
TabularUnified src/CodeGen/GenType.cc ¶
r92538ab rd8e2a09 253 253 254 254 void GenType::postvisit( EnumInstType * enumInst ) { 255 if ( enumInst->baseEnum->base 256 && dynamic_cast<BasicType *>(enumInst->baseEnum->base) 257 && dynamic_cast<BasicType *>(enumInst->baseEnum->base)->kind != BasicType::Kind::SignedInt) { 255 if ( enumInst->baseEnum->base ) { 258 256 typeString = genType(enumInst->baseEnum->base, "", options) + typeString; 259 257 } else { -
TabularUnified src/ResolvExpr/Resolver.cc ¶
r92538ab rd8e2a09 1484 1484 const ast::Type * pointerBase = enumBaseAsPtr->base.get(); 1485 1485 if ( dynamic_cast<const ast::BasicType *>(pointerBase) ) { 1486 objectDecl = fixObjectType(objectDecl, symtab);1486 objectDecl = fixObjectType(objectDecl, context); 1487 1487 if (dynamic_cast<const ast::BasicType *>(pointerBase)->kind == ast::BasicType::Char) 1488 1488 currentObject = ast::CurrentObject{ … … 1491 1491 } }; 1492 1492 } else { 1493 objectDecl = fixObjectType(objectDecl, symtab);1493 objectDecl = fixObjectType(objectDecl, context); 1494 1494 currentObject = ast::CurrentObject{objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } }; 1495 1495 } 1496 1496 } 1497 1497 } else { 1498 objectDecl = fixObjectType(objectDecl, symtab);1498 objectDecl = fixObjectType(objectDecl, context); 1499 1499 currentObject = ast::CurrentObject{ 1500 1500 objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } }; -
TabularUnified tests/enum_tests/typedIntEnum.cfa ¶
r92538ab rd8e2a09 7 7 8 8 int main() { 9 printf("zero: %d, one: %d 9 printf("zero: %d, one: %d\n", zero, one); 10 10 return 0; 11 11 }
Note: See TracChangeset
for help on using the changeset viewer.