Changeset d33bc7c for src


Ignore:
Timestamp:
Jun 16, 2017, 3:25:58 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
0e44184, 1bc9dcb, 20877d2
Parents:
cc3e4d0 (diff), f522618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    rcc3e4d0 rd33bc7c  
    253253}
    254254
     255class WithTypeSubstitution {
     256protected:
     257        WithTypeSubstitution() = default;
     258        ~WithTypeSubstitution() = default;
     259
     260public:
     261        TypeSubstitution * env;
     262};
     263
     264class WithStmtsToAdd {
     265protected:
     266        WithStmtsToAdd() = default;
     267        ~WithStmtsToAdd() = default;
     268
     269public:
     270        std::list< Statement* > stmtsToAddBefore;
     271        std::list< Statement* > stmtsToAddAfter;
     272};
     273
     274class WithShortCircuiting {
     275protected:
     276        WithShortCircuiting() = default;
     277        ~WithShortCircuiting() = default;
     278
     279public:
     280        bool skip_children;
     281};
     282
     283class WithScopes {
     284protected:
     285        WithScopes() = default;
     286        ~WithScopes() = default;
     287
     288public:
     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
    255300#include "PassVisitor.impl.h"
  • src/InitTweak/GenInit.cc

    rcc3e4d0 rd33bc7c  
    4444        }
    4545
    46         class ReturnFixer {
     46        class ReturnFixer : public WithStmtsToAdd, public WithScopes {
    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;
    5855
    5956          protected:
     
    160157
    161158        void ReturnFixer::premutate( FunctionDecl *functionDecl ) {
    162                 GuardValue( this, ftype );
    163                 GuardValue( this, funcName );
     159                GuardValue( ftype );
     160                GuardValue( funcName );
    164161
    165162                ftype = functionDecl->get_functionType();
Note: See TracChangeset for help on using the changeset viewer.