Ignore:
Timestamp:
Apr 19, 2017, 12:08:40 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
e3987770
Parents:
7069652
Message:

more work on codegen output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r7069652 r5f642e38  
    172172        }
    173173
    174         void CodeGenerator::handleAggregate( AggregateDecl * aggDecl ) {
     174        void CodeGenerator::handleAggregate( AggregateDecl * aggDecl, const std::string & kind ) {
    175175                genAttributes( aggDecl->get_attributes() );
    176176
     
    182182                }
    183183
     184                output << kind;
    184185                if ( aggDecl->get_name() != "" )
    185186                        output << aggDecl->get_name();
     
    204205        void CodeGenerator::visit( StructDecl * structDecl ) {
    205206                extension( structDecl );
    206                 output << "struct ";
    207                 handleAggregate( structDecl );
     207                handleAggregate( structDecl, "struct " );
    208208        }
    209209
    210210        void CodeGenerator::visit( UnionDecl * unionDecl ) {
    211211                extension( unionDecl );
    212                 output << "union ";
    213                 handleAggregate( unionDecl );
     212                handleAggregate( unionDecl, "union " );
    214213        }
    215214
     
    578577                extension( memberExpr );
    579578                memberExpr->get_aggregate()->accept( *this );
    580                 output << "." << memberExpr->get_member();
     579                output << ".";
     580                memberExpr->get_member()->accept( *this );
    581581        }
    582582
Note: See TracChangeset for help on using the changeset viewer.