Changes in / [f522618:1a42132]
- Location:
- src
- Files:
-
- 2 edited
-
Common/PassVisitor.h (modified) (1 diff)
-
InitTweak/GenInit.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
rf522618 r1a42132 253 253 } 254 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 255 #include "PassVisitor.impl.h" -
src/InitTweak/GenInit.cc
rf522618 r1a42132 44 44 } 45 45 46 class ReturnFixer : public WithStmtsToAdd, public WithScopes{46 class ReturnFixer { 47 47 public: 48 48 /// consistently allocates a temporary variable for the return value … … 53 53 void premutate( FunctionDecl *functionDecl ); 54 54 void premutate( ReturnStmt * returnStmt ); 55 56 at_cleanup_t at_cleanup; 57 std::list< Statement * > stmtsToAddBefore; 55 58 56 59 protected: … … 157 160 158 161 void ReturnFixer::premutate( FunctionDecl *functionDecl ) { 159 GuardValue( ftype );160 GuardValue( funcName );162 GuardValue( this, ftype ); 163 GuardValue( this, funcName ); 161 164 162 165 ftype = functionDecl->get_functionType();
Note:
See TracChangeset
for help on using the changeset viewer.