- Timestamp:
- Sep 3, 2024, 12:08:09 PM (5 weeks ago)
- Branches:
- master
- Children:
- 737bf73
- Parents:
- cdbb909
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cpp
rcdbb909 rdb19e1d 180 180 181 181 if ( 0 == decl->params.size() ) { 182 if ( decl->type->isVarArgs ) { 182 if ( !decl->type->isVarArgs ) { 183 acc << "(void)"; 184 } else if ( options.genC ) { 183 185 acc << "()"; 184 186 } else { 185 acc << "( void)";187 acc << "(...)"; 186 188 } 187 189 } else { -
src/CodeGen/GenType.cpp
rcdbb909 rdb19e1d 168 168 169 169 if ( type->params.empty() ) { 170 if ( type->isVarArgs ) { 170 if ( !type->isVarArgs ) { 171 os << "(void)"; 172 } else if ( options.genC ) { 171 173 os << "()"; 172 174 } else { 173 os << "( void)";175 os << "(...)"; 174 176 } 175 177 } else { -
src/Concurrency/Keywords.cpp
rcdbb909 rdb19e1d 1510 1510 1511 1511 ast::ptr<ast::Type> MutexKeyword::generic_func = 1512 new ast::FunctionType( ast:: VariableArgs );1512 new ast::FunctionType( ast::FixedArgs ); 1513 1513 1514 1514 // -------------------------------------------------------------------------- -
src/Concurrency/Waitfor.cpp
rcdbb909 rdb19e1d 302 302 const ast::ObjectDecl * monitors = declMonitors( out, clause ); 303 303 ast::Type * fptr_t = new ast::PointerType( 304 new ast::FunctionType( ast:: VariableArgs ) );304 new ast::FunctionType( ast::FixedArgs ) ); 305 305 306 306 const ast::VariableExpr * variableExpr = -
src/Parser/TypeData.cpp
rcdbb909 rdb19e1d 1541 1541 1542 1542 // The argument flag (is/is not var-args) of a computed property. 1543 static ast::ArgumentFlag argumentFlag( const TypeData * td ) {1543 static ast::ArgumentFlag buildArgumentFlag( const TypeData * td ) { 1544 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 1545 bool isVarArgs = !td->function.params || td->function.params->hasEllipsis; 1546 return (isVarArgs) ? ast::VariableArgs : ast::FixedArgs; 1547 } 1548 1549 1550 // Wrapper to convert the void parameter into the empty explicit list. 1551 static void buildParamList( DeclarationNode * decl, 1552 std::vector<ast::ptr<ast::DeclWithType>> & params ) { 1553 buildList( decl, params ); 1554 if ( 1 == params.size() && params[0]->get_type()->isVoid() ) { 1555 params.pop_back(); 1556 } 1557 } 1548 1558 1549 1559 … … 1562 1572 std::vector<ast::ptr<ast::DeclWithType>> params; 1563 1573 std::vector<ast::ptr<ast::DeclWithType>> returns; 1564 build List( td->function.params, params );1574 buildParamList( td->function.params, params ); 1565 1575 buildForall( td->forall, forall ); 1566 1576 // Functions do not store their assertions there anymore. … … 1610 1620 std::move( attributes ), 1611 1621 funcSpec, 1612 argumentFlag( td )1622 buildArgumentFlag( td ) 1613 1623 ); 1614 1624 buildList( td->function.withExprs, decl->withExprs ); … … 1662 1672 assert( td->kind == TypeData::Function ); 1663 1673 ast::FunctionType * ft = new ast::FunctionType( 1664 argumentFlag( td ),1674 buildArgumentFlag( td ), 1665 1675 buildQualifiers( td ) 1666 1676 ); -
src/Parser/parser.yy
rcdbb909 rdb19e1d 2889 2889 parameter_list_ellipsis_opt: 2890 2890 // empty 2891 { $$ = nullptr; }2891 { $$ = DeclarationNode::newFromTypeData( build_basic_type( TypeData::Void ) ); } 2892 2892 | ELLIPSIS 2893 2893 { $$ = nullptr; }
Note: See TracChangeset
for help on using the changeset viewer.