Changes in / [b0be3713:b62d1d6]


Ignore:
Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.impl.hpp

    rb0be3713 rb62d1d6  
    648648        if ( __visit_children() ) {
    649649                // unlike structs, traits, and unions, enums inject their members into the global scope
     650                maybe_accept( node, &EnumDecl::base );
    650651                maybe_accept( node, &EnumDecl::params     );
    651652                maybe_accept( node, &EnumDecl::members    );
  • src/ResolvExpr/CurrentObject.cc

    rb0be3713 rb62d1d6  
    7373                virtual void setPosition( std::list< Expression * > & designators ) = 0;
    7474
    75                 /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object
     75                /// retrieve the list of possible Type/Designation pairs for the current position in the currect object
    7676                virtual std::list<InitAlternative> operator*() const = 0;
    7777
  • src/SymTab/ValidateType.cc

    rb0be3713 rb62d1d6  
    222222        // visit enum members first so that the types of self-referencing members are updated properly
    223223        // Replace the enum base; right now it works only for StructEnum
    224         if ( enumDecl->base && dynamic_cast<TypeInstType*>(enumDecl->base) ) {
    225                 std::string baseName = static_cast<TypeInstType*>(enumDecl->base)->name;
    226                 const StructDecl * st = local_indexer->lookupStruct( baseName );
    227                 if ( st ) {
    228                         enumDecl->base = new StructInstType(Type::Qualifiers(),const_cast<StructDecl *>(st)); // Just linking in the node
     224        if ( enumDecl->base ) {
     225                if ( const TypeInstType * base = dynamic_cast< TypeInstType * >(enumDecl->base) ) {
     226                        if ( const StructDecl * decl = local_indexer->lookupStruct( base->name ) ) {
     227                                enumDecl->base = new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ); // Just linking in the node
     228                        }
     229                } else if ( const PointerType * ptr = dynamic_cast< PointerType * >(enumDecl->base) ) {
     230                        if ( const TypeInstType * ptrBase = dynamic_cast< TypeInstType * >( ptr->base ) ) {
     231                                if ( const StructDecl * decl = local_indexer->lookupStruct( ptrBase->name ) ) {
     232                                        enumDecl->base = new PointerType( Type::Qualifiers(),
     233                                                new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ) );
     234                                }
     235                        }
    229236                }
    230237        }
     238       
    231239        if ( enumDecl->body ) {
    232240                ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name );
  • src/SynTree/Type.h

    rb0be3713 rb62d1d6  
    274274class PointerType : public Type {
    275275  public:
    276         Type *base;
     276        Type * base;
    277277
    278278        // In C99, pointer types can be qualified in many ways e.g., int f( int a[ static 3 ] )
     
    516516        typedef ReferenceToType Parent;
    517517  public:
    518         // this decl is not "owned" by the union inst; it is merely a pointer to elsewhere in the tree,
    519         // where the union used in this type is actually defined
     518        // this decl is not "owned" by the enum inst; it is merely a pointer to elsewhere in the tree,
     519        // where the enum used in this type is actually defined
    520520        EnumDecl *baseEnum = nullptr;
    521521
Note: See TracChangeset for help on using the changeset viewer.