Changeset 8655363 for src/Validate


Ignore:
Timestamp:
Jan 11, 2024, 8:59:51 AM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7db39f7
Parents:
4d689e2 (diff), b262cb3 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/Validate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/Autogen.cpp

    r4d689e2 r8655363  
    440440
    441441                auto * paramType = ast::deepCopy( member->get_type() );
    442                 paramType->attributes.clear();
     442                erase_if( paramType->attributes, []( ast::Attribute const * attr ){
     443                        return !attr->isValidOnFuncParam();
     444                } );
    443445                ast::ObjectDecl * param = new ast::ObjectDecl(
    444446                        getLocation(), member->name, paramType );
  • src/Validate/ReplaceTypedef.cpp

    r4d689e2 r8655363  
    2525
    2626namespace {
    27 
    28 bool isNonParameterAttribute( ast::Attribute const * attr ) {
    29         static const std::vector<std::string> bad_names = {
    30                 "aligned", "__aligned__",
    31         };
    32         for ( auto name : bad_names ) {
    33                 if ( name == attr->name ) {
    34                         return true;
    35                 }
    36         }
    37         return false;
    38 }
    3927
    4028struct ReplaceTypedefCore final :
     
    10189                // by typedef. GCC appears to do the same thing.
    10290                if ( isAtFunctionTop ) {
    103                         erase_if( ret->attributes, isNonParameterAttribute );
     91                        erase_if( ret->attributes, []( ast::Attribute const * attr ){
     92                                return !attr->isValidOnFuncParam();
     93                        } );
    10494                }
    10595                for ( const auto & attribute : type->attributes ) {
Note: See TracChangeset for help on using the changeset viewer.