Changes in / [f522618:1a42132]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    rf522618 r1a42132  
    253253}
    254254
    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 
    300255#include "PassVisitor.impl.h"
  • src/InitTweak/GenInit.cc

    rf522618 r1a42132  
    4444        }
    4545
    46         class ReturnFixer : public WithStmtsToAdd, public WithScopes {
     46        class ReturnFixer {
    4747          public:
    4848                /// consistently allocates a temporary variable for the return value
     
    5353                void premutate( FunctionDecl *functionDecl );
    5454                void premutate( ReturnStmt * returnStmt );
     55
     56                at_cleanup_t at_cleanup;
     57                std::list< Statement * > stmtsToAddBefore;
    5558
    5659          protected:
     
    157160
    158161        void ReturnFixer::premutate( FunctionDecl *functionDecl ) {
    159                 GuardValue( ftype );
    160                 GuardValue( funcName );
     162                GuardValue( this, ftype );
     163                GuardValue( this, funcName );
    161164
    162165                ftype = functionDecl->get_functionType();
Note: See TracChangeset for help on using the changeset viewer.