Changeset 4ae78c1 for src/GenPoly/Specialize.cc
- Timestamp:
- Oct 30, 2020, 12:01:23 PM (2 years ago)
- Branches:
- arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 969e7ee7, f7e4f8e8
- Parents:
- 6a77224 (diff), 3100754 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Specialize.cc
r6a77224 r4ae78c1 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.