Changeset a5a71d0 for src/Parser/TypeData.cc
- Timestamp:
- Apr 6, 2016, 5:11:32 PM (8 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:
- eab39cd
- Parents:
- 39786813 (diff), 3aba311 (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
r39786813 ra5a71d0 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jan 14 10:43:42201613 // Update Count : 3612 // Last Modified On : Wed Apr 06 16:57:53 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: … … 524 537 case Typeof: 525 538 return buildTypeof(); 539 case Builtin: 540 return new VarArgsType( buildQualifiers() ); 526 541 case Attr: 527 542 return buildAttr(); … … 823 838 buildForall( aggregate->params, at->get_parameters() ); 824 839 break; 825 case DeclarationNode:: Context:826 at = new ContextDecl( aggregate->name );840 case DeclarationNode::Trait: 841 at = new TraitDecl( aggregate->name ); 827 842 buildList( aggregate->params, at->get_parameters() ); 828 843 break; … … 863 878 ret = new UnionInstType( buildQualifiers(), aggInst->aggregate->aggregate->name ); 864 879 break; 865 case DeclarationNode:: Context:866 ret = new ContextInstType( buildQualifiers(), aggInst->aggregate->aggregate->name );880 case DeclarationNode::Trait: 881 ret = new TraitInstType( buildQualifiers(), aggInst->aggregate->aggregate->name ); 867 882 break; 868 883 default: … … 901 916 EnumDecl *ret = new EnumDecl( enumeration->name ); 902 917 buildList( enumeration->constants, ret->get_members() ); 918 std::list< Declaration * >::iterator members = ret->get_members().begin(); 919 for ( const DeclarationNode *cur = enumeration->constants; cur != NULL; cur = dynamic_cast<DeclarationNode *>( cur->get_link() ), ++members ) { 920 if ( cur->get_enumeratorValue() != NULL ) { 921 ObjectDecl *member = dynamic_cast<ObjectDecl *>(*members); 922 member->set_init( new SingleInit( maybeBuild< Expression >( cur->get_enumeratorValue() ), std::list< Expression * >() ) ); 923 } // if 924 } // for 903 925 return ret; 904 926 }
Note: See TracChangeset
for help on using the changeset viewer.