- Timestamp:
- Sep 21, 2020, 11:37:28 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 7a80113
- Parents:
- 31a6f38 (diff), ace2e92 (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
- Files:
-
- 2 added
- 8 edited
-
AST/Pass.hpp (modified) (2 diffs)
-
AST/Pass.impl.hpp (modified) (3 diffs)
-
AST/Pass.proto.hpp (modified) (1 diff)
-
Common/Stats/ResolveTime.cc (added)
-
Common/Stats/ResolveTime.h (added)
-
Common/Stats/Stats.cc (modified) (2 diffs)
-
Common/module.mk (modified) (1 diff)
-
Concurrency/Keywords.cc (modified) (1 diff)
-
ResolvExpr/Resolver.cc (modified) (2 diffs)
-
SymTab/Validate.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r31a6f38 r08f3ad3 50 50 // | PureVisitor - makes the visitor pure, it never modifies nodes in place and always 51 51 // clones nodes it needs to make changes to 52 // | With TypeSubstitution - provides polymorphic const TypeSubstitution * envfor the52 // | WithConstTypeSubstitution - provides polymorphic const TypeSubstitution * typeSubs for the 53 53 // current expression 54 54 // | WithStmtsToAdd - provides the ability to insert statements before or after the current … … 294 294 //------------------------------------------------------------------------------------------------- 295 295 296 /// Keep track of the polymorphic const TypeSubstitution * env for the current expression297 298 296 /// If used the visitor will always clone nodes. 299 297 struct PureVisitor {}; 300 298 299 /// Keep track of the polymorphic const TypeSubstitution * typeSubs for the current expression. 301 300 struct WithConstTypeSubstitution { 302 const TypeSubstitution * env= nullptr;301 const TypeSubstitution * typeSubs = nullptr; 303 302 }; 304 303 -
src/AST/Pass.impl.hpp
r31a6f38 r08f3ad3 154 154 __pedantic_pass_assert( expr ); 155 155 156 const ast::TypeSubstitution ** env_ptr = __pass::env( core, 0);157 if ( env_ptr && expr->env ) {158 * env_ptr = expr->env;156 const ast::TypeSubstitution ** typeSubs_ptr = __pass::typeSubs( core, 0 ); 157 if ( typeSubs_ptr && expr->env ) { 158 *typeSubs_ptr = expr->env; 159 159 } 160 160 … … 177 177 178 178 // These may be modified by subnode but most be restored once we exit this statemnet. 179 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass:: env( core, 0) );179 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass::typeSubs( core, 0 ) ); 180 180 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 181 181 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); … … 1488 1488 1489 1489 // These may be modified by subnode but most be restored once we exit this statemnet. 1490 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass:: env( core, 0) );1490 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::typeSubs( core, 0 ) ); 1491 1491 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 1492 1492 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); -
src/AST/Pass.proto.hpp
r31a6f38 r08f3ad3 236 236 237 237 // List of fields and their expected types 238 FIELD_PTR( env, const ast::TypeSubstitution * )238 FIELD_PTR( typeSubs, const ast::TypeSubstitution * ) 239 239 FIELD_PTR( stmtsToAddBefore, std::list< ast::ptr< ast::Stmt > > ) 240 240 FIELD_PTR( stmtsToAddAfter , std::list< ast::ptr< ast::Stmt > > ) -
src/Common/Stats/Stats.cc
r31a6f38 r08f3ad3 35 35 } 36 36 37 namespace ResolveTime { 38 bool enabled = false; 39 } 40 37 41 struct { 38 42 const char * const opt; … … 43 47 { "heap" , Heap::enabled }, 44 48 { "time" , Time::enabled }, 49 { "resolve" , ResolveTime::enabled }, 45 50 }; 46 51 -
src/Common/module.mk
r31a6f38 r08f3ad3 40 40 Common/Stats/Heap.cc \ 41 41 Common/Stats/Heap.h \ 42 Common/Stats/ResolveTime.cc \ 43 Common/Stats/ResolveTime.h \ 42 44 Common/Stats/Stats.cc \ 43 45 Common/Stats/Time.cc \ -
src/Concurrency/Keywords.cc
r31a6f38 r08f3ad3 931 931 { 932 932 new SingleInit( new AddressExpr( new VariableExpr( monitors ) ) ), 933 new SingleInit( new CastExpr( new VariableExpr( func ), generic_func->clone(), false ) ) 933 new SingleInit( new CastExpr( new VariableExpr( func ), generic_func->clone(), false ) ), 934 new SingleInit( new ConstantExpr( Constant::from_bool( false ) ) ) 934 935 }, 935 936 noDesignators, -
src/ResolvExpr/Resolver.cc
r31a6f38 r08f3ad3 38 38 #include "Common/PassVisitor.h" // for PassVisitor 39 39 #include "Common/SemanticError.h" // for SemanticError 40 #include "Common/Stats/ResolveTime.h" // for ResolveTime::start(), ResolveTime::stop() 40 41 #include "Common/utility.h" // for ValueGuard, group_iterate 41 42 #include "InitTweak/GenInit.h" … … 1169 1170 const ast::Expr * untyped, const ast::SymbolTable & symtab 1170 1171 ) { 1171 return findKindExpression( untyped, symtab ); 1172 Stats::ResolveTime::start( untyped ); 1173 auto res = findKindExpression( untyped, symtab ); 1174 Stats::ResolveTime::stop(); 1175 return res; 1172 1176 } 1173 1177 } // anonymous namespace -
src/SymTab/Validate.cc
r31a6f38 r08f3ad3 960 960 } 961 961 962 static bool isNonParameterAttribute( Attribute * attr ) { 963 static const std::vector<std::string> bad_names = { 964 "aligned", "__aligned__", 965 }; 966 for ( auto name : bad_names ) { 967 if ( name == attr->name ) { 968 return true; 969 } 970 } 971 return false; 972 } 973 962 974 Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) { 963 975 // instances of typedef types will come here. If it is an instance … … 968 980 ret->location = typeInst->location; 969 981 ret->get_qualifiers() |= typeInst->get_qualifiers(); 970 // attributes are not carried over from typedef to function parameters/return values 971 if ( ! inFunctionType ) { 972 ret->attributes.splice( ret->attributes.end(), typeInst->attributes ); 973 } else { 974 deleteAll( ret->attributes ); 975 ret->attributes.clear(); 976 } 982 // GCC ignores certain attributes if they arrive by typedef, this mimics that. 983 if ( inFunctionType ) { 984 ret->attributes.remove_if( isNonParameterAttribute ); 985 } 986 ret->attributes.splice( ret->attributes.end(), typeInst->attributes ); 977 987 // place instance parameters on the typedef'd type 978 988 if ( ! typeInst->parameters.empty() ) {
Note:
See TracChangeset
for help on using the changeset viewer.