Changeset 4b8b2a4


Ignore:
Timestamp:
Oct 3, 2022, 1:46:49 PM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
890f67a
Parents:
c02cef1
Message:

Make unset locations earier to find with a search for 'CodeLocation?()'.

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/AST/SymbolTable.cpp

    rc02cef1 r4b8b2a4  
    316316
    317317void SymbolTable::addStruct( const std::string &id ) {
    318         addStruct( new StructDecl( CodeLocation{}, id ) );
     318        addStruct( new StructDecl( CodeLocation(), id ) );
    319319}
    320320
     
    358358
    359359void SymbolTable::addUnion( const std::string &id ) {
    360         addUnion( new UnionDecl( CodeLocation{}, id ) );
     360        addUnion( new UnionDecl( CodeLocation(), id ) );
    361361}
    362362
  • src/AST/Type.cpp

    rc02cef1 r4b8b2a4  
    176176        for ( const Type * ty : types ) {
    177177                members.emplace_back( new ObjectDecl{
    178                         CodeLocation{}, "", ty, new ListInit( CodeLocation{}, {}, {}, NoConstruct ),
     178                        CodeLocation(), "", ty, new ListInit( CodeLocation(), {}, {}, NoConstruct ),
    179179                        Storage::Classes{}, Linkage::Cforall } );
    180180        }
  • src/InitTweak/FixInit.cc

    rc02cef1 r4b8b2a4  
    750750                        if ( StructInstType * inst = dynamic_cast< StructInstType * >( t ) ) {
    751751                                // initizer for empty struct must be empty
    752                                 if ( inst->baseStruct->members.empty() ) return new ListInit({});
     752                                if ( inst->baseStruct->members.empty() ) return new ListInit(CodeLocation());
    753753                        } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( t ) ) {
    754754                                // initizer for empty union must be empty
    755                                 if ( inst->baseUnion->members.empty() ) return new ListInit({});
     755                                if ( inst->baseUnion->members.empty() ) return new ListInit(CodeLocation());
    756756                        }
    757757
  • src/InitTweak/InitTweak.cc

    rc02cef1 r4b8b2a4  
    881881                static ast::ptr<ast::FunctionDecl> assign = nullptr;
    882882                if (!assign) {
    883                         auto td = new ast::TypeDecl({}, "T", {}, nullptr, ast::TypeDecl::Dtype, true);
    884                         assign = new ast::FunctionDecl({}, "?=?", {},
    885                         { new ast::ObjectDecl({}, "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))),
    886                           new ast::ObjectDecl({}, "_src", new ast::TypeInstType("T", td))},
    887                         { new ast::ObjectDecl({}, "_ret", new ast::TypeInstType("T", td))}, nullptr, {}, ast::Linkage::Intrinsic);
     883                        auto td = new ast::TypeDecl(CodeLocation(), "T", {}, nullptr, ast::TypeDecl::Dtype, true);
     884                        assign = new ast::FunctionDecl(CodeLocation(), "?=?", {},
     885                        { new ast::ObjectDecl(CodeLocation(), "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))),
     886                          new ast::ObjectDecl(CodeLocation(), "_src", new ast::TypeInstType("T", td))},
     887                        { new ast::ObjectDecl(CodeLocation(), "_ret", new ast::TypeInstType("T", td))}, nullptr, {}, ast::Linkage::Intrinsic);
    888888                }
    889889                if (dst->result.as<ast::ReferenceType>()) {
Note: See TracChangeset for help on using the changeset viewer.