Ignore:
Timestamp:
May 2, 2022, 3:18:32 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
24ceace
Parents:
2686bc7
Message:

Resolution of struct enum. The codegen of struct enum will be in the next commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r2686bc7 r9e7236f4  
    427427                        // enumerator initializers should not use the enum type to initialize, since
    428428                        // the enum type is still incomplete at this point. Use signed int instead.
     429                        // TODO: BasicType::SignedInt may not longer be true
    429430                        currentObject = CurrentObject( new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
    430431                }
     
    14771478                        // enum type is still incomplete at this point. Use `int` instead.
    14781479
    1479                         if (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base) { // const ast::PointerType &
    1480                                 // const ast::Type * enumBase =  (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base.get());
    1481                                 // const ast::PointerType * enumBaseAsPtr = dynamic_cast<const ast::PointerType *>(enumBase);
    1482 
    1483                                 // if ( enumBaseAsPtr ) {
    1484                                 //      const ast::Type * pointerBase = enumBaseAsPtr->base.get();
    1485                                 //      if ( dynamic_cast<const ast::BasicType *>(pointerBase) ) {
    1486                                 //              objectDecl = fixObjectType(objectDecl, context);
    1487                                 //              if (dynamic_cast<const ast::BasicType *>(pointerBase)->kind == ast::BasicType::Char)
    1488                                 //              currentObject = ast::CurrentObject{
    1489                                 //                      objectDecl->location,  new ast::PointerType{
    1490                                 //                              new ast::BasicType{ ast::BasicType::Char }
    1491                                 //                      } };
    1492                                 //      } else {
    1493                                 //              objectDecl = fixObjectType(objectDecl, context);
    1494                                 //              currentObject = ast::CurrentObject{objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
    1495                                 //      }
    1496                                 // }
     1480                        if (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base) {
    14971481                                objectDecl = fixObjectType( objectDecl, context );
    14981482                                const ast::Type * enumBase =  (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base.get());
Note: See TracChangeset for help on using the changeset viewer.