Changeset ba3706f for src/InitTweak/InitTweak.cc
- Timestamp:
- Nov 30, 2017, 4:43:59 PM (6 years ago)
- 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:
- c50d54d
- Parents:
- 4429b04
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r4429b04 rba3706f 19 19 #include "SynTree/Expression.h" // for Expression, UntypedExpr, Applicati... 20 20 #include "SynTree/Initializer.h" // for Initializer, ListInit, Designation 21 #include "SynTree/Label.h" // for Label , noLabels21 #include "SynTree/Label.h" // for Label 22 22 #include "SynTree/Statement.h" // for CompoundStmt, ExprStmt, BranchStmt 23 23 #include "SynTree/Type.h" // for FunctionType, ArrayType, PointerType … … 195 195 callExpr->get_args().splice( callExpr->get_args().end(), args ); 196 196 197 *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels,callExpr ), nullptr );197 *out++ = new IfStmt( cond, new ExprStmt( callExpr ), nullptr ); 198 198 199 199 UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) ); 200 200 increment->get_args().push_back( index->clone() ); 201 *out++ = new ExprStmt( noLabels,increment );201 *out++ = new ExprStmt( increment ); 202 202 } 203 203 … … 244 244 std::list< Statement * > stmts; 245 245 build( callExpr, idx, idxEnd, init, back_inserter( stmts ) ); 246 stmts.push_back( new BranchStmt( noLabels,switchLabel, BranchStmt::Break ) );247 CaseStmt * caseStmt = new CaseStmt( noLabels,condition, stmts );246 stmts.push_back( new BranchStmt( switchLabel, BranchStmt::Break ) ); 247 CaseStmt * caseStmt = new CaseStmt( condition, stmts ); 248 248 branches.push_back( caseStmt ); 249 249 } 250 *out++ = new SwitchStmt( noLabels,index->clone(), branches );251 *out++ = new NullStmt( std::list<Label>{ switchLabel } );250 *out++ = new SwitchStmt( index->clone(), branches ); 251 *out++ = new NullStmt( { switchLabel } ); 252 252 } 253 253 } … … 262 262 Statement * InitImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) { 263 263 if ( ! init ) return nullptr; 264 CompoundStmt * block = new CompoundStmt( noLabels);264 CompoundStmt * block = new CompoundStmt(); 265 265 build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) ); 266 266 if ( block->get_kids().empty() ) {
Note: See TracChangeset
for help on using the changeset viewer.