Ignore:
Timestamp:
Aug 29, 2024, 2:38:39 PM (14 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
9bb6c5f
Parents:
960665c (diff), b965774 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cpp

    r960665c rad47ec4  
    15401540
    15411541
     1542// The argument flag (is/is not var-args) of a computed property.
     1543static ast::ArgumentFlag argumentFlag( const TypeData * td ) {
     1544        assert( td->kind == TypeData::Function );
     1545        bool isVaArgs = !td->function.params || td->function.params->hasEllipsis;
     1546        return (isVaArgs) ? ast::VariableArgs : ast::FixedArgs;
     1547} // argumentFlag
     1548
     1549
    15421550ast::FunctionDecl * buildFunctionDecl(
    15431551                const TypeData * td,
     
    15491557                std::vector<ast::ptr<ast::Attribute>> && attributes ) {
    15501558        assert( td->kind == TypeData::Function );
    1551         // For some reason FunctionDecl takes a bool instead of an ArgumentFlag.
    1552         bool isVarArgs = !td->function.params || td->function.params->hasEllipsis;
    15531559        ast::CV::Qualifiers cvq = buildQualifiers( td );
    15541560        std::vector<ast::ptr<ast::TypeDecl>> forall;
     
    16041610                std::move( attributes ),
    16051611                funcSpec,
    1606                 (isVarArgs) ? ast::VariableArgs : ast::FixedArgs
     1612                argumentFlag( td )
    16071613        );
    16081614        buildList( td->function.withExprs, decl->withExprs );
     
    16561662        assert( td->kind == TypeData::Function );
    16571663        ast::FunctionType * ft = new ast::FunctionType(
    1658                 ( !td->function.params || td->function.params->hasEllipsis )
    1659                         ? ast::VariableArgs : ast::FixedArgs,
     1664                argumentFlag( td ),
    16601665                buildQualifiers( td )
    16611666        );
Note: See TracChangeset for help on using the changeset viewer.