Changes in src/AST/Pass.hpp [293dc1c:b2a11ba]
- File:
-
- 1 edited
-
src/AST/Pass.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r293dc1c rb2a11ba 103 103 /// Construct and run a pass on a translation unit. 104 104 template< typename... Args > 105 static void run( TranslationUnit& decls, Args &&... args ) {105 static void run( std::list< ptr<Decl> > & decls, Args &&... args ) { 106 106 Pass<core_t> visitor( std::forward<Args>( args )... ); 107 107 accept_all( decls, visitor ); … … 119 119 // Versions of the above for older compilers. 120 120 template< typename... Args > 121 static void run( TranslationUnit& decls ) {121 static void run( std::list< ptr<Decl> > & decls ) { 122 122 Pass<core_t> visitor; 123 123 accept_all( decls, visitor ); … … 228 228 template<typename core_type> 229 229 friend void accept_all( std::list< ptr<Decl> > & decls, Pass<core_type>& visitor ); 230 231 bool isInFunction() const {232 return inFunction;233 }234 235 230 private: 236 231 … … 240 235 const ast::Stmt * call_accept( const ast::Stmt * ); 241 236 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 *);246 237 247 238 template< typename node_t > … … 266 257 template<typename node_t, typename parent_t, typename child_t> 267 258 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);271 259 272 260 private: … … 296 284 private: 297 285 bool inFunction = false; 298 bool atFunctionTop = false;299 286 }; 300 287 … … 302 289 template<typename core_t> 303 290 void 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 );307 291 308 292 //------------------------------------------------------------------------------------------------- … … 387 371 struct WithVisitorRef { 388 372 Pass<core_t> * const visitor = nullptr; 389 390 bool isInFunction() const {391 return visitor->isInFunction();392 }393 373 }; 394 374
Note:
See TracChangeset
for help on using the changeset viewer.