Changes in src/SymTab/Validate.cc [954c954:98538288]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r954c954 r98538288 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 974 962 Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) { 975 963 // instances of typedef types will come here. If it is an instance … … 980 968 ret->location = typeInst->location; 981 969 ret->get_qualifiers() |= typeInst->get_qualifiers(); 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 ); 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 } 987 977 // place instance parameters on the typedef'd type 988 978 if ( ! typeInst->parameters.empty() ) { … … 1384 1374 /// Replaces enum types by int, and function/array types in function parameter and return 1385 1375 /// lists by appropriate pointers 1386 /*1387 1376 struct EnumAndPointerDecay_new { 1388 1377 const ast::EnumDecl * previsit( const ast::EnumDecl * enumDecl ) { … … 1435 1424 } 1436 1425 }; 1437 */1438 1426 1439 1427 /// expand assertions from a trait instance, performing appropriate type variable substitutions … … 1520 1508 } 1521 1509 1522 void checkGenericParameters( const ast:: BaseInstType * inst ) {1510 void checkGenericParameters( const ast::ReferenceToType * inst ) { 1523 1511 for ( const ast::Expr * param : inst->params ) { 1524 1512 if ( ! dynamic_cast< const ast::TypeExpr * >( param ) ) { … … 1839 1827 const ast::Type * validateType( 1840 1828 const CodeLocation & loc, const ast::Type * type, const ast::SymbolTable & symtab ) { 1841 //ast::Pass< EnumAndPointerDecay_new > epc;1829 ast::Pass< EnumAndPointerDecay_new > epc; 1842 1830 ast::Pass< LinkReferenceToTypes_new > lrt{ loc, symtab }; 1843 1831 ast::Pass< ForallPointerDecay_new > fpd{ loc }; 1844 1832 1845 return type->accept( lrt )->accept( fpd );1833 return type->accept( epc )->accept( lrt )->accept( fpd ); 1846 1834 } 1847 1835
Note:
See TracChangeset
for help on using the changeset viewer.