Changeset 0508ab3


Ignore:
Timestamp:
Jun 20, 2017, 2:02:46 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:
4551a6e
Parents:
5e298d7
Message:

fix passes using PassVisitor? to use inheritance rather than explicit members

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r5e298d7 r0508ab3  
    5656                typedef std::unordered_map< int, int > UnqCount;
    5757
    58                 class InsertImplicitCalls {
     58                class InsertImplicitCalls : public WithTypeSubstitution {
    5959                public:
    6060                        /// wrap function application expressions as ImplicitCopyCtorExpr nodes so that it is easy to identify which
     
    6969                        // collects environments for relevant nodes
    7070                        EnvMap & envMap;
    71                         TypeSubstitution * env; //Magically populated by the PassVisitor
    7271                };
    7372
     
    192191                };
    193192
    194                 class FixInit {
     193                class FixInit : public WithStmtsToAdd {
    195194                  public:
    196195                        /// expand each object declaration to use its constructor after it is declared.
     
    200199
    201200                        std::list< Declaration * > staticDtorDecls;
    202                         std::list< Statement * > stmtsToAddAfter; // found by PassVisitor
    203201                };
    204202
  • src/SymTab/Validate.cc

    r5e298d7 r0508ab3  
    160160        };
    161161
    162         class ReturnChecker {
     162        class ReturnChecker : public WithScopes {
    163163          public:
    164164                /// Checks that return statements return nothing if their return type is void
     
    167167          private:
    168168                void previsit( FunctionDecl * functionDecl );
    169                 void postvisit( FunctionDecl * functionDecl );
    170169                void previsit( ReturnStmt * returnStmt );
    171170
    172171                typedef std::list< DeclarationWithType * > ReturnVals;
    173172                ReturnVals returnVals;
    174                 std::stack< ReturnVals > returnValsStack;
    175173        };
    176174
     
    608606
    609607        void ReturnChecker::previsit( FunctionDecl * functionDecl ) {
    610                 returnValsStack.push( returnVals );
     608                GuardValue( returnVals );
    611609                returnVals = functionDecl->get_functionType()->get_returnVals();
    612         }
    613         void ReturnChecker::postvisit( __attribute__((unused)) FunctionDecl * functionDecl ) {
    614                 returnVals = returnValsStack.top();
    615                 returnValsStack.pop();
    616610        }
    617611
Note: See TracChangeset for help on using the changeset viewer.