Ignore:
Timestamp:
Mar 16, 2017, 6:14:27 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, 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:
395fc37
Parents:
d6d747d
Message:

more cleanup for bit-field type usage and create struct forward for typedef

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rd6d747d r6f95000  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:02:54 2017
    13 // Update Count     : 351
     12// Last Modified On : Thu Mar 16 16:39:15 2017
     13// Update Count     : 353
    1414//
    1515
     
    611611                if ( def != typedefNames.end() ) {
    612612                        Type *ret = def->second.first->get_base()->clone();
    613                         ret->get_qualifiers() += typeInst->get_qualifiers();
     613                        ret->get_qualifiers() |= typeInst->get_qualifiers();
    614614                        // place instance parameters on the typedef'd type
    615615                        if ( ! typeInst->get_parameters().empty() ) {
     
    656656                // hence the type-name "screen" must be defined.
    657657                // Note, qualifiers on the typedef are superfluous for the forward declaration.
    658                 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) {
     658
     659                Type *designatorType = tyDecl->get_base()->stripDeclarator();
     660                if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) {
    659661                        return new StructDecl( aggDecl->get_name() );
    660                 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) {
     662                } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) {
    661663                        return new UnionDecl( aggDecl->get_name() );
    662                 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) {
     664                } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
    663665                        return new EnumDecl( enumDecl->get_name() );
    664666                } else {
Note: See TracChangeset for help on using the changeset viewer.