Changeset af75a87
- Timestamp:
- Jul 13, 2022, 2:51:18 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 1932e8a
- Parents:
- d4b37ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/ReplaceTypedef.cpp
rd4b37ab raf75a87 10 10 // Created On : Tue Jun 29 14:59:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jul 12 14:17:00 202213 // Update Count : 012 // Last Modified On : Wed Jul 13 14:45:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 63 63 void previsit( ast::TraitDecl const * ); 64 64 65 void previsit( ast::FunctionType const * );66 67 65 template<typename AggrDecl> 68 66 void addImplicitTypedef( AggrDecl * aggDecl ); … … 78 76 CodeLocation const * nearestLocation = nullptr; 79 77 int scopeLevel; 80 bool i nFunctionType= false;78 bool isAtFunctionTop = false; 81 79 }; 82 80 … … 105 103 ast::Type * ret = ast::deepCopy( def->second.first->base ); 106 104 ret->qualifiers |= type->qualifiers; 107 // GCC ignores certain attributes if they arrive by typedef, 108 // this mimics that. 109 // TODO: This might cover too much, it should just cover arguments 110 // and return values of a function. 111 if ( visitor->isInFunction() ) { 105 // We ignore certain attributes on function parameters if they arrive 106 // by typedef. GCC appears to do the same thing. 107 if ( isAtFunctionTop ) { 112 108 erase_if( ret->attributes, isNonParameterAttribute ); 113 109 } … … 207 203 GuardScope( typedefNames ); 208 204 GuardScope( typedeclNames ); 205 GuardValue( isAtFunctionTop ) = true; 209 206 } 210 207 … … 262 259 GuardScope( typedefNames ); 263 260 GuardScope( typedeclNames ); 261 GuardValue( isAtFunctionTop ) = false; 264 262 scopeLevel += 1; 265 263 } … … 292 290 GuardScope( typedefNames ); 293 291 GuardScope( typedeclNames ); 294 }295 296 void ReplaceTypedefCore::previsit( ast::FunctionType const * ) {297 GuardValue( inFunctionType ) = true;298 292 } 299 293
Note: See TracChangeset
for help on using the changeset viewer.