Changeset 0f9e4403 for src/Parser/TypeData.cc
- Timestamp:
- Apr 15, 2016, 12:03:11 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 29ad0ac
- Parents:
- c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
rc5833e8 r0f9e4403 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 14 14:57:23 201513 // Update Count : 3212 // Last Modified On : Wed Mar 2 17:26:45 2016 13 // Update Count : 49 14 14 // 15 15 … … 23 23 #include "SynTree/Expression.h" 24 24 #include "SynTree/Statement.h" 25 #include "SynTree/Initializer.h" 25 26 26 27 TypeData::TypeData( Kind k ) : kind( k ), base( 0 ), forall( 0 ) { … … 84 85 typeexpr->expr = 0; 85 86 break; 87 case Builtin: 88 builtin = new Builtin_t; 89 break; 86 90 case Attr: 87 91 attr = new Attr_t; … … 149 153 delete typeexpr->expr; 150 154 delete typeexpr; 155 break; 156 case Builtin: 157 delete builtin; 151 158 break; 152 159 case Attr: … … 221 228 newtype->typeexpr->expr = maybeClone( typeexpr->expr ); 222 229 break; 230 case Builtin: 231 newtype->builtin->type = builtin->type; 232 break; 223 233 case Attr: 224 234 newtype->attr->expr = maybeClone( attr->expr ); … … 396 406 attr->type->print( os, indent + 2 ); 397 407 } // if 408 break; 409 case Builtin: 410 os << "gcc builtin type"; 398 411 break; 399 412 default: … … 506 519 case Typeof: 507 520 return buildTypeof(); 521 case Builtin: 522 return new VarArgsType( buildQualifiers() ); 508 523 case Attr: 509 524 return buildAttr(); … … 805 820 buildForall( aggregate->params, at->get_parameters() ); 806 821 break; 807 case DeclarationNode:: Context:808 at = new ContextDecl( aggregate->name );822 case DeclarationNode::Trait: 823 at = new TraitDecl( aggregate->name ); 809 824 buildList( aggregate->params, at->get_parameters() ); 810 825 break; … … 845 860 ret = new UnionInstType( buildQualifiers(), aggInst->aggregate->aggregate->name ); 846 861 break; 847 case DeclarationNode:: Context:848 ret = new ContextInstType( buildQualifiers(), aggInst->aggregate->aggregate->name );862 case DeclarationNode::Trait: 863 ret = new TraitInstType( buildQualifiers(), aggInst->aggregate->aggregate->name ); 849 864 break; 850 865 default: … … 883 898 EnumDecl *ret = new EnumDecl( enumeration->name ); 884 899 buildList( enumeration->constants, ret->get_members() ); 900 std::list< Declaration * >::iterator members = ret->get_members().begin(); 901 for ( const DeclarationNode *cur = enumeration->constants; cur != NULL; cur = dynamic_cast<DeclarationNode *>( cur->get_link() ), ++members ) { 902 if ( cur->get_enumeratorValue() != NULL ) { 903 ObjectDecl *member = dynamic_cast<ObjectDecl *>(*members); 904 member->set_init( new SingleInit( maybeBuild< Expression >( cur->get_enumeratorValue() ) ) ); 905 } // if 906 } // for 885 907 return ret; 886 908 }
Note:
See TracChangeset
for help on using the changeset viewer.