Changeset c76bd34 for src/SymTab/Validate.cc
- Timestamp:
- Oct 7, 2020, 4:31:43 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 848439f
- Parents:
- ae2c27a (diff), 597c5d18 (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
-
src/SymTab/Validate.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rae2c27a rc76bd34 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 962 974 Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) { 963 975 // instances of typedef types will come here. If it is an instance … … 968 980 ret->location = typeInst->location; 969 981 ret->get_qualifiers() |= typeInst->get_qualifiers(); 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 } 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 ); 977 987 // place instance parameters on the typedef'd type 978 988 if ( ! typeInst->parameters.empty() ) { … … 1374 1384 /// Replaces enum types by int, and function/array types in function parameter and return 1375 1385 /// lists by appropriate pointers 1386 /* 1376 1387 struct EnumAndPointerDecay_new { 1377 1388 const ast::EnumDecl * previsit( const ast::EnumDecl * enumDecl ) { … … 1424 1435 } 1425 1436 }; 1437 */ 1426 1438 1427 1439 /// expand assertions from a trait instance, performing appropriate type variable substitutions … … 1508 1520 } 1509 1521 1510 void checkGenericParameters( const ast:: ReferenceToType * inst ) {1522 void checkGenericParameters( const ast::BaseInstType * inst ) { 1511 1523 for ( const ast::Expr * param : inst->params ) { 1512 1524 if ( ! dynamic_cast< const ast::TypeExpr * >( param ) ) { … … 1827 1839 const ast::Type * validateType( 1828 1840 const CodeLocation & loc, const ast::Type * type, const ast::SymbolTable & symtab ) { 1829 ast::Pass< EnumAndPointerDecay_new > epc;1841 // ast::Pass< EnumAndPointerDecay_new > epc; 1830 1842 ast::Pass< LinkReferenceToTypes_new > lrt{ loc, symtab }; 1831 1843 ast::Pass< ForallPointerDecay_new > fpd{ loc }; 1832 1844 1833 return type->accept( epc )->accept(lrt )->accept( fpd );1845 return type->accept( lrt )->accept( fpd ); 1834 1846 } 1835 1847
Note:
See TracChangeset
for help on using the changeset viewer.