Changes in src/Common/PassVisitor.h [4eb31f2b:d7dc824]
- File:
-
- 1 edited
-
src/Common/PassVisitor.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r4eb31f2b rd7dc824 54 54 virtual void visit( BranchStmt *branchStmt ) override final; 55 55 virtual void visit( ReturnStmt *returnStmt ) override final; 56 virtual void visit( ThrowStmt *throwStmt ) override final;57 56 virtual void visit( TryStmt *tryStmt ) override final; 58 57 virtual void visit( CatchStmt *catchStmt ) override final; … … 140 139 virtual Statement* mutate( BranchStmt *branchStmt ) override final; 141 140 virtual Statement* mutate( ReturnStmt *returnStmt ) override final; 142 virtual Statement* mutate( ThrowStmt *throwStmt ) override final;143 141 virtual Statement* mutate( TryStmt *returnStmt ) override final; 144 142 virtual Statement* mutate( CatchStmt *catchStmt ) override final; … … 232 230 std::list< Statement* > * get_afterStmts () { return stmtsToAddAfter_impl ( pass, 0); } 233 231 bool visit_children() { bool* skip = skip_children_impl(pass, 0); return ! (skip && *skip); } 234 void reset_visit() { bool* skip = skip_children_impl(pass, 0); if(skip) *skip = false; }235 236 guard_value_impl init_guard() {237 guard_value_impl guard;238 auto at_cleanup = at_cleanup_impl(pass, 0);239 if( at_cleanup ) {240 *at_cleanup = [&guard]( cleanup_func_t && func, void* val ) {241 guard.push( std::move( func ), val );242 };243 }244 return guard;245 }246 232 }; 247 233 248 template<typename pass_type, typename T>249 void GuardValue( pass_type * pass, T& val ) {250 pass->at_cleanup( [ val ]( void * newVal ) {251 * static_cast< T * >( newVal ) = val;252 }, static_cast< void * >( & val ) );253 }254 255 class WithTypeSubstitution {256 protected:257 WithTypeSubstitution() = default;258 ~WithTypeSubstitution() = default;259 260 public:261 TypeSubstitution * env;262 };263 264 class WithStmtsToAdd {265 protected:266 WithStmtsToAdd() = default;267 ~WithStmtsToAdd() = default;268 269 public:270 std::list< Statement* > stmtsToAddBefore;271 std::list< Statement* > stmtsToAddAfter;272 };273 274 class WithShortCircuiting {275 protected:276 WithShortCircuiting() = default;277 ~WithShortCircuiting() = default;278 279 public:280 bool skip_children;281 };282 283 class WithScopes {284 protected:285 WithScopes() = default;286 ~WithScopes() = default;287 288 public:289 at_cleanup_t at_cleanup;290 291 template< typename T >292 void GuardValue( T& val ) {293 at_cleanup( [ val ]( void * newVal ) {294 * static_cast< T * >( newVal ) = val;295 }, static_cast< void * >( & val ) );296 }297 };298 299 300 234 #include "PassVisitor.impl.h"
Note:
See TracChangeset
for help on using the changeset viewer.