Changeset e01559c for src/GenPoly/Box.cc
- Timestamp:
- Jul 30, 2015, 4:06: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, string, with_gc
- Children:
- e497c1d
- Parents:
- e766208
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
re766208 re01559c 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jun 24 16:19:07201513 // Update Count : 1012 // Last Modified On : Thu Jul 30 14:35:40 2015 13 // Update Count : 54 14 14 // 15 15 … … 1051 1051 if ( ObjectDecl *objectDecl = dynamic_cast< ObjectDecl *>( declStmt->get_decl() ) ) { 1052 1052 if ( isPolyVal( objectDecl->get_type(), scopeTyVars ) ) { 1053 // change initialization of a polymorphic value object 1054 // to allocate storage with alloca 1053 1055 TypeInstType *typeInst = dynamic_cast< TypeInstType *>( objectDecl->get_type() ); 1054 1056 assert( typeInst ); 1055 1057 UntypedExpr *alloc = new UntypedExpr( new NameExpr( "__builtin_alloca" ) ); 1056 1058 alloc->get_args().push_back( new NameExpr( typeInst->get_name() ) ); 1057 UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); 1058 assign->get_args().push_back( new VariableExpr( objectDecl ) ); 1059 assign->get_args().push_back( alloc ); 1060 stmtsToAddAfter.push_back( new ExprStmt( noLabels, assign ) ); 1059 1060 delete objectDecl->get_init(); 1061 1062 std::list<Expression*> designators; 1063 objectDecl->set_init( new SingleInit( alloc, designators ) ); 1061 1064 } 1062 1065 }
Note: See TracChangeset
for help on using the changeset viewer.