Ignore:
Timestamp:
Jul 12, 2024, 11:45:24 AM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
76b507d
Parents:
9c447e2
Message:

Not sure why we copy in the return values all the time, but we do. This prevents an unused error from appearing when the library is being compiled (shows up about 4 times right now). Switching some passes around might have also solved the problem, but I think we should be generating normalized code instead of mixing in the normalization and code generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Virtual/Tables.cpp

    r9c447e2 r3e135c8  
    122122                        ) );
    123123                }
    124                 //ast::Expr * expr = buildInitExpr(...);
    125                 //inits.push_back( new ast::SingleInit( location, expr ) )
    126124        }
    127125
     
    162160        assert( vtableType );
    163161        assert( exceptType );
     162
     163        // If this is called after Fix Return Statements (currently it is in
     164        // Implement Concurrent Keywords) then this must be marked as unused
     165        // to avoid warnings.
     166        ast::ObjectDecl * frontRet = new ast::ObjectDecl( location,
     167                "_retvalue",
     168                new ast::ReferenceType( vtableType )
     169        );
     170        frontRet->attributes.emplace_back( new ast::Attribute( "unused" ) );
     171
    164172        return new ast::FunctionDecl(
    165173                location,
     
    170178                        new ast::PointerType( exceptType )
    171179                ) },
    172                 { new ast::ObjectDecl(
    173                         location,
    174                         "_retvalue",
    175                         new ast::ReferenceType( vtableType )
    176                 ) },
     180                { frontRet },
    177181                nullptr,
    178182                ast::Storage::Classes(),
Note: See TracChangeset for help on using the changeset viewer.