Changeset 02af79b0 for src/Common
- Timestamp:
- May 9, 2019, 4:47:53 PM (7 years ago)
- 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, stuck-waitfor-destruct
- Children:
- b038fe4
- Parents:
- ec28948 (diff), db27767 (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. - Location:
- src/Common
- Files:
-
- 4 edited
-
Assert.cc (modified) (1 diff)
-
PassVisitor.h (modified) (3 diffs)
-
PassVisitor.impl.h (modified) (4 diffs)
-
PassVisitor.proto.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Assert.cc
rec28948 r02af79b0 39 39 } 40 40 41 void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2))); 42 void abort(const char *fmt, ... ) noexcept { 43 va_list args; 44 va_start( args, fmt ); 45 vfprintf( stderr, fmt, args ); 46 va_end( args ); 47 fprintf( stderr, "\n" ); 48 abort(); 49 } 50 41 51 // Local Variables: // 42 52 // tab-width: 4 // -
src/Common/PassVisitor.h
rec28948 r02af79b0 4 4 5 5 #include <stack> 6 #include <type_traits> 6 7 7 8 #include "Common/Stats.h" … … 301 302 302 303 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); } 304 305 std::list< Statement* > * get_beforeStmts() { return stmtsToAddBefore_impl( pass, 0); } 305 306 std::list< Statement* > * get_afterStmts () { return stmtsToAddAfter_impl ( pass, 0); } … … 348 349 }; 349 350 351 class WithConstTypeSubstitution { 352 protected: 353 WithConstTypeSubstitution() = default; 354 ~WithConstTypeSubstitution() = default; 355 356 public: 357 const TypeSubstitution * env = nullptr; 358 }; 359 350 360 class WithStmtsToAdd { 351 361 protected: -
src/Common/PassVisitor.impl.h
rec28948 r02af79b0 20 20 21 21 #define MUTATE_END( type, node ) \ 22 return call_postmutate< type * >( node ); \ 22 auto __return = call_postmutate< type * >( node ); \ 23 assert( __return ); \ 24 return __return; 23 25 24 26 … … 253 255 254 256 // don't want statements from outer CompoundStmts to be added to this CompoundStmt 255 ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr() );257 ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type > oldEnv( get_env_ptr() ); 256 258 ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() ); 257 259 ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () ); … … 1995 1997 1996 1998 // don't want statements from outer CompoundStmts to be added to this StmtExpr 1997 ValueGuardPtr< TypeSubstitution * > oldEnv( get_env_ptr() );1999 ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type > oldEnv( get_env_ptr() ); 1998 2000 ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() ); 1999 2001 ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () ); … … 2012 2014 2013 2015 // don't want statements from outer CompoundStmts to be added to this StmtExpr 2014 ValueGuardPtr< TypeSubstitution * > oldEnv( get_env_ptr() );2016 ValueGuardPtr< typename std::remove_pointer<decltype(get_env_ptr())>::type > oldEnv( get_env_ptr() ); 2015 2017 ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() ); 2016 2018 ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () ); -
src/Common/PassVisitor.proto.h
rec28948 r02af79b0 165 165 static inline type * name##_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) { return nullptr;} \ 166 166 167 FIELD_PTR( TypeSubstitution *, env )167 FIELD_PTR( const TypeSubstitution *, env ) 168 168 FIELD_PTR( std::list< Statement* >, stmtsToAddBefore ) 169 169 FIELD_PTR( std::list< Statement* >, stmtsToAddAfter ) … … 174 174 FIELD_PTR( PassVisitor<pass_type> * const, visitor ) 175 175 176 #undef FIELD_PTR 177 176 178 //--------------------------------------------------------- 177 179 // Indexer
Note:
See TracChangeset
for help on using the changeset viewer.