Changeset 8ca3a72


Ignore:
Timestamp:
Jun 5, 2017, 5:49:43 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
10e90cb
Parents:
7985fa5
git-author:
Rob Schluntz <rschlunt@…> (06/05/17 17:47:19)
git-committer:
Rob Schluntz <rschlunt@…> (06/05/17 17:49:43)
Message:

remove redundant noLabels variables

Location:
src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r7985fa5 r8ca3a72  
    6262namespace GenPoly {
    6363        namespace {
    64                 const std::list<Label> noLabels;
    65 
    6664                FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars );
    6765
  • src/GenPoly/CopyParams.cc

    r7985fa5 r8ca3a72  
    4545
    4646        CopyParams::CopyParams() : namer( "_cp" ) {}
    47 
    48         static const std::list< Label > noLabels;
    4947
    5048        void CopyParams::visit( FunctionDecl *funcDecl ) {
  • src/GenPoly/DeclMutator.cc

    r7985fa5 r8ca3a72  
    2020
    2121namespace GenPoly {
    22         namespace {
    23                 const std::list<Label> noLabels;
    24         }
    25 
    2622        DeclMutator::DeclMutator() : Mutator(), declsToAdd(1), declsToAddAfter(1) {}
    2723
    2824        DeclMutator::~DeclMutator() {}
    29        
     25
    3026        void DeclMutator::mutateDeclarationList( std::list< Declaration* > &decls ) {
    3127                for ( std::list< Declaration* >::iterator decl = decls.begin(); ; ++decl ) {
     
    3430
    3531                        if ( decl == decls.end() ) break;
    36                        
     32
    3733                        // run mutator on declaration
    3834                        *decl = maybeMutate( *decl, *this );
     
    5551                newBack->splice( newBack->end(), *back );
    5652                declsToAdd.pop_back();
    57                
     53
    5854                back = declsToAddAfter.rbegin();
    5955                newBack = back + 1;
     
    6662                CompoundStmt *compoundStmt = dynamic_cast< CompoundStmt* >(stmt);
    6763                if ( compoundStmt ) return mutate( compoundStmt );
    68                
     64
    6965                doBeginScope();
    70                
     66
    7167                // run mutator on statement
    7268                stmt = maybeMutate( stmt, *this );
     
    10298                doBeginScope();
    10399
    104                
     100
    105101                for ( std::list< Statement* >::iterator stmt = stmts.begin(); ; ++stmt ) {
    106102                        // add any new declarations after the previous statement
     
    112108
    113109                        if ( stmt == stmts.end() ) break;
    114                        
     110
    115111                        // run mutator on statement
    116112                        *stmt = maybeMutate( *stmt, *this );
     
    123119                        declsToAdd.back().clear();
    124120                }
    125                
     121
    126122                doEndScope();
    127123        }
     
    139135                return compoundStmt;
    140136        }
    141        
     137
    142138        Statement* DeclMutator::mutate(IfStmt *ifStmt) {
    143139                ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) );
     
    146142                return ifStmt;
    147143        }
    148        
     144
    149145        Statement* DeclMutator::mutate(WhileStmt *whileStmt) {
    150146                whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) );
     
    152148                return whileStmt;
    153149        }
    154        
     150
    155151        Statement* DeclMutator::mutate(ForStmt *forStmt) {
    156152                mutateAll( forStmt->get_initialization(), *this );
     
    160156                return forStmt;
    161157        }
    162        
     158
    163159        Statement* DeclMutator::mutate(SwitchStmt *switchStmt) {
    164160                switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
     
    166162                return switchStmt;
    167163        }
    168        
     164
    169165        Statement* DeclMutator::mutate(CaseStmt *caseStmt) {
    170166                caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) );
     
    172168                return caseStmt;
    173169        }
    174        
     170
    175171        Statement* DeclMutator::mutate(TryStmt *tryStmt) {
    176172                tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) );
     
    179175                return tryStmt;
    180176        }
    181        
     177
    182178        Statement* DeclMutator::mutate(CatchStmt *catchStmt) {
    183179                catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) );
  • src/GenPoly/Lvalue.cc

    r7985fa5 r8ca3a72  
    3535namespace GenPoly {
    3636        namespace {
    37                 const std::list<Label> noLabels;
    38 
    3937                /// Replace uses of lvalue returns with appropriate pointers
    4038                class Pass1 : public Mutator {
  • src/InitTweak/FixGlobalInit.cc

    r7985fa5 r8ca3a72  
    2626
    2727namespace InitTweak {
    28         namespace {
    29                 const std::list<Label> noLabels;
    30         }
    31 
    3228        class GlobalFixer : public Visitor {
    3329          public:
  • src/InitTweak/GenInit.cc

    r7985fa5 r8ca3a72  
    1616#include <stack>
    1717#include <list>
     18
     19#include "InitTweak.h"
    1820#include "GenInit.h"
    19 #include "InitTweak.h"
     21
     22#include "Common/PassVisitor.h"
     23
     24#include "GenPoly/DeclMutator.h"
     25#include "GenPoly/PolyMutator.h"
     26#include "GenPoly/ScopedSet.h"
     27
     28#include "ResolvExpr/typeops.h"
     29
    2030#include "SynTree/Declaration.h"
    21 #include "SynTree/Type.h"
    2231#include "SynTree/Expression.h"
    23 #include "SynTree/Statement.h"
    2432#include "SynTree/Initializer.h"
    2533#include "SynTree/Mutator.h"
     34#include "SynTree/Statement.h"
     35#include "SynTree/Type.h"
     36
    2637#include "SymTab/Autogen.h"
    2738#include "SymTab/Mangler.h"
    28 #include "GenPoly/PolyMutator.h"
    29 #include "GenPoly/DeclMutator.h"
    30 #include "GenPoly/ScopedSet.h"
    31 #include "ResolvExpr/typeops.h"
    3239
    3340namespace InitTweak {
    34         namespace {
    35                 const std::list<Label> noLabels;
    36                 const std::list<Expression *> noDesignators;
    37         }
    38 
    3941        class ReturnFixer final : public GenPoly::PolyMutator {
    4042          public:
  • src/SynTree/Attribute.h

    r7985fa5 r8ca3a72  
    4040};
    4141
     42const std::list< Attribute * > noAttributes;
     43
    4244#endif
    4345
Note: See TracChangeset for help on using the changeset viewer.