Changeset 679864e1


Ignore:
Timestamp:
Oct 7, 2015, 12:31:28 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
242d458
Parents:
b0be06ac
Message:

link typedecl to its implementation type, typedecl initialization hack in resolver

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rb0be06ac r679864e1  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 24 17:33:54 2015
    13 // Update Count     : 178
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Sep 15 16:24:07 2015
     13// Update Count     : 181
    1414//
    1515
     
    407407                } else if ( StructInstType * st = dynamic_cast< StructInstType * >( initContext ) ) {
    408408                        resolveAggrInit( st->get_baseStruct(), iter, end );
    409                 } else if ( UnionInstType *st = dynamic_cast< UnionInstType * >( initContext ) ) {
     409                } else if ( UnionInstType * st = dynamic_cast< UnionInstType * >( initContext ) ) {
    410410                        resolveAggrInit( st->get_baseUnion(), iter, end );
     411                } else if ( TypeInstType * tt = dynamic_cast< TypeInstType * >( initContext ) ) {
     412                        // try again...
     413                        initContext = tt->get_baseType()->get_base();
     414                        visit(listInit);
    411415                } else {
     416                        assert( dynamic_cast< BasicType * >( initContext ) );
    412417                        // basic types are handled here
    413418                        Visitor::visit( listInit );
  • src/SymTab/Validate.cc

    rb0be06ac r679864e1  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 05 14:00:24 2015
    13 // Update Count     : 195
     12// Last Modified On : Tue Oct 06 15:40:35 2015
     13// Update Count     : 219
    1414//
    1515
     
    183183
    184184                typedef std::map< std::string, std::pair< TypedefDecl *, int > > TypedefMap;
     185                typedef std::map< std::string, TypeDecl * > TypeDeclMap;
    185186                TypedefMap typedefNames;
     187                TypeDeclMap typedeclNames;
    186188                int scopeLevel;
    187189        };
     
    839841                        delete typeInst;
    840842                        return ret;
     843                } else {
     844                        TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() );
     845                        assert( base != typedeclNames.end() );
     846                        typeInst->set_baseType( base->second->clone() );
    841847                } // if
    842848                return typeInst;
     
    880886                        typedefNames.erase( i ) ;
    881887                } // if
     888
     889                typedeclNames[ typeDecl->get_name() ] = typeDecl;
    882890                return typeDecl;
    883891        }
Note: See TracChangeset for help on using the changeset viewer.