Changeset db19e1d for src/CodeGen


Ignore:
Timestamp:
Sep 3, 2024, 12:08:09 PM (2 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
737bf73
Parents:
cdbb909
Message:

Changed the interpritation of () to be no parameters instead of any parameters. This had a lot of little changes because of this and some nearby clean-up. This includes some changes, including changing some generated functions to be fixed-args instead of variable-args, stripping out the place holder void parameter earlier, but it still shows up earlier in some cases that examine the parser directly. Also had to update the function generation tools. Have only tested with one --arch. Hopefully this all works out.

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cpp

    rcdbb909 rdb19e1d  
    180180
    181181        if ( 0 == decl->params.size() ) {
    182                 if ( decl->type->isVarArgs ) {
     182                if ( !decl->type->isVarArgs ) {
     183                        acc << "(void)";
     184                } else if ( options.genC ) {
    183185                        acc << "()";
    184186                } else {
    185                         acc << "(void)";
     187                        acc << "(...)";
    186188                }
    187189        } else {
  • src/CodeGen/GenType.cpp

    rcdbb909 rdb19e1d  
    168168
    169169        if ( type->params.empty() ) {
    170                 if ( type->isVarArgs ) {
     170                if ( !type->isVarArgs ) {
     171                        os << "(void)";
     172                } else if ( options.genC ) {
    171173                        os << "()";
    172174                } else {
    173                         os << "(void)";
     175                        os << "(...)";
    174176                }
    175177        } else {
Note: See TracChangeset for help on using the changeset viewer.