Changes in / [1a42132:f522618]
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r1a42132 rf522618 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 255 300 #include "PassVisitor.impl.h" -
src/InitTweak/GenInit.cc
r1a42132 rf522618 44 44 } 45 45 46 class ReturnFixer {46 class ReturnFixer : public WithStmtsToAdd, public WithScopes { 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;58 55 59 56 protected: … … 160 157 161 158 void ReturnFixer::premutate( FunctionDecl *functionDecl ) { 162 GuardValue( this,ftype );163 GuardValue( this,funcName );159 GuardValue( ftype ); 160 GuardValue( funcName ); 164 161 165 162 ftype = functionDecl->get_functionType();
Note: See TracChangeset
for help on using the changeset viewer.