Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    r293dc1c rb2a11ba  
    103103        /// Construct and run a pass on a translation unit.
    104104        template< typename... Args >
    105         static void run( TranslationUnit & decls, Args &&... args ) {
     105        static void run( std::list< ptr<Decl> > & decls, Args &&... args ) {
    106106                Pass<core_t> visitor( std::forward<Args>( args )... );
    107107                accept_all( decls, visitor );
     
    119119        // Versions of the above for older compilers.
    120120        template< typename... Args >
    121         static void run( TranslationUnit & decls ) {
     121        static void run( std::list< ptr<Decl> > & decls ) {
    122122                Pass<core_t> visitor;
    123123                accept_all( decls, visitor );
     
    228228        template<typename core_type>
    229229        friend void accept_all( std::list< ptr<Decl> > & decls, Pass<core_type>& visitor );
    230 
    231         bool isInFunction() const {
    232                 return inFunction;
    233         }
    234 
    235230private:
    236231
     
    240235        const ast::Stmt * call_accept( const ast::Stmt * );
    241236        const ast::Expr * call_accept( const ast::Expr * );
    242 
    243         // requests WithStmtsToAdd directly add to this statement, as if it is a compound.
    244 
    245         const ast::Stmt * call_accept_as_compound(const ast::Stmt *);
    246237
    247238        template< typename node_t >
     
    266257        template<typename node_t, typename parent_t, typename child_t>
    267258        void maybe_accept(const node_t * &, child_t parent_t::* child);
    268 
    269         template<typename node_t, typename parent_t, typename child_t>
    270         void maybe_accept_as_compound(const node_t * &, child_t parent_t::* child);
    271259
    272260private:
     
    296284private:
    297285        bool inFunction = false;
    298         bool atFunctionTop = false;
    299286};
    300287
     
    302289template<typename core_t>
    303290void accept_all( std::list< ast::ptr<ast::Decl> > &, ast::Pass<core_t> & visitor );
    304 
    305 template<typename core_t>
    306 void accept_all( ast::TranslationUnit &, ast::Pass<core_t> & visitor );
    307291
    308292//-------------------------------------------------------------------------------------------------
     
    387371struct WithVisitorRef {
    388372        Pass<core_t> * const visitor = nullptr;
    389 
    390         bool isInFunction() const {
    391                 return visitor->isInFunction();
    392         }
    393373};
    394374
Note: See TracChangeset for help on using the changeset viewer.