Changeset 3100754
- Timestamp:
- Oct 29, 2020, 5:21:03 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 45444c3, 4ae78c1
- Parents:
- c6c682cf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Specialize.cc
rc6c682cf r3100754 218 218 thunkFunc->get_attributes().push_back( new Attribute( "unused" ) ); 219 219 220 // Thunks at the global level must be static to avoid collisions between files. 221 // (Conversly thunks inside a function must be unique and not static.) 222 thunkFunc->storageClasses.is_static = !isInFunction(); 223 220 224 // thread thunk parameters into call to actual function, naming thunk parameters as we go 221 225 UniqueName paramNamer( paramPrefix ); … … 321 325 } 322 326 323 // Fold it into Specialize if we find a good way.324 struct StaticThunks final : public WithShortCircuiting {325 void previsit( Declaration * ) {326 visit_children = false;327 }328 void postvisit( FunctionDecl * decl ) {329 if ( isPrefix( decl->name, "_thunk" ) ) {330 decl->storageClasses.is_static = true;331 }332 }333 };334 335 327 void convertSpecializations( std::list< Declaration* >& translationUnit ) { 336 328 PassVisitor<Specialize> spec; 337 329 mutateAll( translationUnit, spec ); 338 PassVisitor<StaticThunks> staticThunks;339 acceptAll( translationUnit, staticThunks );340 330 } 341 331 } // namespace GenPoly
Note: See TracChangeset
for help on using the changeset viewer.