Changeset ba3706f for src/GenPoly/Box.cc


Ignore:
Timestamp:
Nov 30, 2017, 4:43:59 PM (7 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r4429b04 rba3706f  
    4949#include "SynTree/Expression.h"          // for ApplicationExpr, UntypedExpr
    5050#include "SynTree/Initializer.h"         // for SingleInit, Initializer, Lis...
    51 #include "SynTree/Label.h"               // for Label, noLabels
     51#include "SynTree/Label.h"               // for Label
    5252#include "SynTree/Mutator.h"             // for maybeMutate, Mutator, mutateAll
    5353#include "SynTree/Statement.h"           // for ExprStmt, DeclStmt, ReturnStmt
     
    293293                FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ),
    294294                                                                                                         functionNesting > 0 ? Type::StorageClasses() : Type::StorageClasses( Type::Static ),
    295                                                                                                          LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ),
     295                                                                                                         LinkageSpec::AutoGen, layoutFnType, new CompoundStmt(),
    296296                                                                                                         std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) );
    297297                layoutDecl->fixUniqueId();
     
    321321        /// makes an if-statement with a single-expression if-block and no then block
    322322        Statement *makeCond( Expression *cond, Expression *ifPart ) {
    323                 return new IfStmt( noLabels, cond, new ExprStmt( noLabels, ifPart ), 0 );
     323                return new IfStmt( cond, new ExprStmt( ifPart ), 0 );
    324324        }
    325325
     
    340340        /// adds an expression to a compound statement
    341341        void addExpr( CompoundStmt *stmts, Expression *expr ) {
    342                 stmts->get_kids().push_back( new ExprStmt( noLabels, expr ) );
     342                stmts->get_kids().push_back( new ExprStmt( expr ) );
    343343        }
    344344
     
    629629                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    630630                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 );
    631                         stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) );
     631                        stmtsToAddBefore.push_back( new DeclStmt( newObj ) );
    632632                        return newObj;
    633633                }
     
    740740                                ObjectDecl *newObj = ObjectDecl::newObject( tempNamer.newName(), newType, nullptr );
    741741                                newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
    742                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) );
     742                                stmtsToAddBefore.push_back( new DeclStmt( newObj ) );
    743743                                UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) ); // TODO: why doesn't this just use initialization syntax?
    744744                                assign->get_args().push_back( new VariableExpr( newObj ) );
    745745                                assign->get_args().push_back( arg );
    746                                 stmtsToAddBefore.push_back( new ExprStmt( noLabels, assign ) );
     746                                stmtsToAddBefore.push_back( new ExprStmt( assign ) );
    747747                                arg = new AddressExpr( new VariableExpr( newObj ) );
    748748                        } // if
     
    888888                                // void return
    889889                                addAdapterParams( adapteeApp, arg, param, adapterType->get_parameters().end(), realParam, tyVars );
    890                                 bodyStmt = new ExprStmt( noLabels, adapteeApp );
     890                                bodyStmt = new ExprStmt( adapteeApp );
    891891                        } else if ( isDynType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) {
    892892                                // return type T
     
    900900                                addAdapterParams( adapteeApp, arg, param, adapterType->get_parameters().end(), realParam, tyVars );
    901901                                assign->get_args().push_back( adapteeApp );
    902                                 bodyStmt = new ExprStmt( noLabels, assign );
     902                                bodyStmt = new ExprStmt( assign );
    903903                        } else {
    904904                                // adapter for a function that returns a monomorphic value
    905905                                addAdapterParams( adapteeApp, arg, param, adapterType->get_parameters().end(), realParam, tyVars );
    906                                 bodyStmt = new ReturnStmt( noLabels, adapteeApp );
     906                                bodyStmt = new ReturnStmt( adapteeApp );
    907907                        } // if
    908                         CompoundStmt *adapterBody = new CompoundStmt( noLabels );
     908                        CompoundStmt *adapterBody = new CompoundStmt();
    909909                        adapterBody->get_kids().push_back( bodyStmt );
    910910                        std::string adapterName = makeAdapterName( mangleName );
     
    952952                                                std::pair< AdapterIter, bool > answer = adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) );
    953953                                                adapter = answer.first;
    954                                                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, newAdapter ) );
     954                                                stmtsToAddBefore.push_back( new DeclStmt( newAdapter ) );
    955955                                        } // if
    956956                                        assert( adapter != adapters.end() );
     
    12791279                                                retval->set_name( "_retval" );
    12801280                                        }
    1281                                         functionDecl->get_statements()->get_kids().push_front( new DeclStmt( noLabels, retval ) );
     1281                                        functionDecl->get_statements()->get_kids().push_front( new DeclStmt( retval ) );
    12821282                                        DeclarationWithType * newRet = retval->clone(); // for ownership purposes
    12831283                                        ftype->get_returnVals().front() = newRet;
     
    15191519                                        // (alloca was previously used, but can't be safely used in loops)
    15201520                                        ObjectDecl *newBuf = ObjectDecl::newObject( bufNamer.newName(), polyToMonoType( objectDecl->type ), nullptr );
    1521                                         stmtsToAddBefore.push_back( new DeclStmt( noLabels, newBuf ) );
     1521                                        stmtsToAddBefore.push_back( new DeclStmt( newBuf ) );
    15221522
    15231523                                        delete objectDecl->get_init();
     
    15981598                ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) {
    15991599                        ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, 0, type, init );
    1600                         stmtsToAddBefore.push_back( new DeclStmt( noLabels, newObj ) );
     1600                        stmtsToAddBefore.push_back( new DeclStmt( newObj ) );
    16011601                        return newObj;
    16021602                }
     
    16771677                                        addOtypeParamsToLayoutCall( layoutCall, otypeParams );
    16781678
    1679                                         stmtsToAddBefore.push_back( new ExprStmt( noLabels, layoutCall ) );
     1679                                        stmtsToAddBefore.push_back( new ExprStmt( layoutCall ) );
    16801680                                }
    16811681
     
    17031703                                addOtypeParamsToLayoutCall( layoutCall, otypeParams );
    17041704
    1705                                 stmtsToAddBefore.push_back( new ExprStmt( noLabels, layoutCall ) );
     1705                                stmtsToAddBefore.push_back( new ExprStmt( layoutCall ) );
    17061706
    17071707                                return true;
Note: See TracChangeset for help on using the changeset viewer.