Changeset ba3706f for src/SymTab


Ignore:
Timestamp:
Nov 30, 2017, 4:43:59 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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
Message:

Remove label lists from various Statement constructors

Location:
src/SymTab
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/AddVisit.h

    r4429b04 rba3706f  
    2424                        // add any new declarations after the previous statement
    2525                        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 );
    2727                                stmts.insert( stmt, declStmt );
    2828                        }
     
    3636                        // add any new declarations before the statement
    3737                        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 );
    3939                                stmts.insert( stmt, declStmt );
    4040                        }
  • src/SymTab/Autogen.cc

    r4429b04 rba3706f  
    264264                Type::StorageClasses scs = functionNesting > 0 ? Type::StorageClasses() : Type::StorageClasses( Type::Static );
    265265                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(),
    267267                                                                                                std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) );
    268268                decl->fixUniqueId();
     
    299299                                assert( assignType->returnVals.size() == 1 );
    300300                                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.front() );
    301                                 dcl->statements->push_back( new ReturnStmt( noLabels, new VariableExpr( dstParam ) ) );
     301                                dcl->statements->push_back( new ReturnStmt( new VariableExpr( dstParam ) ) );
    302302                        }
    303303                        resolve( dcl );
     
    468468                copy->args.push_back( new AddressExpr( new VariableExpr( srcParam ) ) );
    469469                copy->args.push_back( new SizeofExpr( srcParam->get_type()->clone() ) );
    470                 *out++ = new ExprStmt( noLabels, copy );
     470                *out++ = new ExprStmt( copy );
    471471        }
    472472
     
    544544                        callExpr->get_args().push_back( new VariableExpr( dstParam ) );
    545545                        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 ) );
    547547                } else {
    548548                        // default ctor/dtor body is empty - add unused attribute to parameter to silence warnings
     
    569569                expr->args.push_back( new CastExpr( new VariableExpr( dst ), new ReferenceType( Type::Qualifiers(), typeDecl->base->clone() ) ) );
    570570                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 ) );
    572572        };
    573573
     
    664664                        untyped->get_args().push_back( new VariableExpr( ftype->get_parameters().back() ) );
    665665                }
    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() ) ) ) );
    668668        }
    669669
  • src/SymTab/Autogen.h

    r4429b04 rba3706f  
    104104                fExpr->args.splice( fExpr->args.end(), args );
    105105
    106                 *out++ = new ExprStmt( noLabels, fExpr );
     106                *out++ = new ExprStmt( fExpr );
    107107
    108108                srcParam.clearArrayIndices();
     
    162162
    163163                // for stmt's body, eventually containing call
    164                 CompoundStmt * body = new CompoundStmt( noLabels );
     164                CompoundStmt * body = new CompoundStmt();
    165165                Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->kids ), array->base, addCast, forward );
    166166
    167167                // block containing for stmt and index variable
    168168                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 ) );
    171171                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 ) );
    173173
    174174                *out++ = block;
Note: See TracChangeset for help on using the changeset viewer.