Changeset def751f for src/Validate/ReplaceTypedef.cpp
- Timestamp:
- Jul 25, 2022, 3:17:25 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- b0d9ff7
- Parents:
- 4e2befe3 (diff), ffec1bf (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/Validate/ReplaceTypedef.cpp
r4e2befe3 rdef751f 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ReplaceTypedef.cpp -- 7 // ReplaceTypedef.cpp -- Fill in all typedefs with the underlying type. 8 8 // 9 9 // Author : Andrew Beach 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.