Changeset 7bb6bd8 for src/Common


Ignore:
Timestamp:
May 8, 2019, 1:38:55 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
2ed1d50
Parents:
3c1fa71 (diff), b1d3ee1 (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/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    r3c1fa71 r7bb6bd8  
    44
    55#include <stack>
     6#include <type_traits>
    67
    78#include "Common/Stats.h"
     
    301302
    302303
    303         TypeSubstitution **             get_env_ptr    () { return env_impl             ( pass, 0); }
     304        auto                                    get_env_ptr    () -> decltype(env_impl( pass, 0)) { return env_impl( pass, 0); }
    304305        std::list< Statement* > *       get_beforeStmts() { return stmtsToAddBefore_impl( pass, 0); }
    305306        std::list< Statement* > *       get_afterStmts () { return stmtsToAddAfter_impl ( pass, 0); }
     
    348349};
    349350
     351class WithConstTypeSubstitution {
     352protected:
     353        WithConstTypeSubstitution() = default;
     354        ~WithConstTypeSubstitution() = default;
     355
     356public:
     357        const TypeSubstitution * env = nullptr;
     358};
     359
    350360class WithStmtsToAdd {
    351361protected:
  • src/Common/PassVisitor.impl.h

    r3c1fa71 r7bb6bd8  
    253253
    254254        // don't want statements from outer CompoundStmts to be added to this CompoundStmt
    255         ValueGuardPtr< TypeSubstitution * >  oldEnv        ( get_env_ptr    () );
     255        ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type >  oldEnv( get_env_ptr() );
    256256        ValueGuardPtr< DeclList_t >          oldBeforeDecls( get_beforeDecls() );
    257257        ValueGuardPtr< DeclList_t >          oldAfterDecls ( get_afterDecls () );
     
    19951995
    19961996        // don't want statements from outer CompoundStmts to be added to this StmtExpr
    1997         ValueGuardPtr< TypeSubstitution * >      oldEnv        ( get_env_ptr() );
     1997        ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type >  oldEnv( get_env_ptr() );
    19981998        ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() );
    19991999        ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
     
    20122012
    20132013        // don't want statements from outer CompoundStmts to be added to this StmtExpr
    2014         ValueGuardPtr< TypeSubstitution * >      oldEnv        ( get_env_ptr() );
     2014        ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type >  oldEnv( get_env_ptr() );
    20152015        ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() );
    20162016        ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
  • src/Common/PassVisitor.proto.h

    r3c1fa71 r7bb6bd8  
    165165static inline type * name##_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) { return nullptr;}    \
    166166
    167 FIELD_PTR( TypeSubstitution *, env )
     167FIELD_PTR( const TypeSubstitution *, env )
    168168FIELD_PTR( std::list< Statement* >, stmtsToAddBefore )
    169169FIELD_PTR( std::list< Statement* >, stmtsToAddAfter  )
Note: See TracChangeset for help on using the changeset viewer.