Changeset ba3706f for src/SymTab
- 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
- Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/AddVisit.h
r4429b04 rba3706f 24 24 // add any new declarations after the previous statement 25 25 for ( std::list< Declaration* >::iterator decl = visitor.declsToAddAfter.begin(); decl != visitor.declsToAddAfter.end(); ++decl ) { 26 DeclStmt *declStmt = new DeclStmt( noLabels,*decl );26 DeclStmt *declStmt = new DeclStmt( *decl ); 27 27 stmts.insert( stmt, declStmt ); 28 28 } … … 36 36 // add any new declarations before the statement 37 37 for ( std::list< Declaration* >::iterator decl = visitor.declsToAdd.begin(); decl != visitor.declsToAdd.end(); ++decl ) { 38 DeclStmt *declStmt = new DeclStmt( noLabels,*decl );38 DeclStmt *declStmt = new DeclStmt( *decl ); 39 39 stmts.insert( stmt, declStmt ); 40 40 } -
src/SymTab/Autogen.cc
r4429b04 rba3706f 264 264 Type::StorageClasses scs = functionNesting > 0 ? Type::StorageClasses() : Type::StorageClasses( Type::Static ); 265 265 LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen; 266 FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt( noLabels),266 FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt(), 267 267 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ); 268 268 decl->fixUniqueId(); … … 299 299 assert( assignType->returnVals.size() == 1 ); 300 300 ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.front() ); 301 dcl->statements->push_back( new ReturnStmt( n oLabels, new VariableExpr( dstParam ) ) );301 dcl->statements->push_back( new ReturnStmt( new VariableExpr( dstParam ) ) ); 302 302 } 303 303 resolve( dcl ); … … 468 468 copy->args.push_back( new AddressExpr( new VariableExpr( srcParam ) ) ); 469 469 copy->args.push_back( new SizeofExpr( srcParam->get_type()->clone() ) ); 470 *out++ = new ExprStmt( noLabels,copy );470 *out++ = new ExprStmt( copy ); 471 471 } 472 472 … … 544 544 callExpr->get_args().push_back( new VariableExpr( dstParam ) ); 545 545 callExpr->get_args().push_back( new VariableExpr( srcParam ) ); 546 funcDecl->statements->push_back( new ExprStmt( noLabels,callExpr ) );546 funcDecl->statements->push_back( new ExprStmt( callExpr ) ); 547 547 } else { 548 548 // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings … … 569 569 expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) ); 570 570 if ( src ) expr->args.push_back( new CastExpr( new VariableExpr( src ), typeDecl->base->clone() ) ); 571 dcl->statements->kids.push_back( new ExprStmt( noLabels,expr ) );571 dcl->statements->kids.push_back( new ExprStmt( expr ) ); 572 572 }; 573 573 … … 664 664 untyped->get_args().push_back( new VariableExpr( ftype->get_parameters().back() ) ); 665 665 } 666 function->get_statements()->get_kids().push_back( new ExprStmt( noLabels,untyped ) );667 function->get_statements()->get_kids().push_back( new ReturnStmt( noLabels,UntypedExpr::createDeref( new VariableExpr( ftype->get_parameters().front() ) ) ) );666 function->get_statements()->get_kids().push_back( new ExprStmt( untyped ) ); 667 function->get_statements()->get_kids().push_back( new ReturnStmt( UntypedExpr::createDeref( new VariableExpr( ftype->get_parameters().front() ) ) ) ); 668 668 } 669 669 -
src/SymTab/Autogen.h
r4429b04 rba3706f 104 104 fExpr->args.splice( fExpr->args.end(), args ); 105 105 106 *out++ = new ExprStmt( noLabels,fExpr );106 *out++ = new ExprStmt( fExpr ); 107 107 108 108 srcParam.clearArrayIndices(); … … 162 162 163 163 // for stmt's body, eventually containing call 164 CompoundStmt * body = new CompoundStmt( noLabels);164 CompoundStmt * body = new CompoundStmt(); 165 165 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->kids ), array->base, addCast, forward ); 166 166 167 167 // block containing for stmt and index variable 168 168 std::list<Statement *> initList; 169 CompoundStmt * block = new CompoundStmt( noLabels);170 block->push_back( new DeclStmt( noLabels,index ) );169 CompoundStmt * block = new CompoundStmt(); 170 block->push_back( new DeclStmt( index ) ); 171 171 if ( listInit ) block->get_kids().push_back( listInit ); 172 block->push_back( new ForStmt( noLabels,initList, cond, inc, body ) );172 block->push_back( new ForStmt( initList, cond, inc, body ) ); 173 173 174 174 *out++ = block;
Note: See TracChangeset
for help on using the changeset viewer.