- Timestamp:
- Oct 3, 2022, 1:46:49 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 890f67a
- Parents:
- c02cef1
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/SymbolTable.cpp
rc02cef1 r4b8b2a4 316 316 317 317 void SymbolTable::addStruct( const std::string &id ) { 318 addStruct( new StructDecl( CodeLocation {}, id ) );318 addStruct( new StructDecl( CodeLocation(), id ) ); 319 319 } 320 320 … … 358 358 359 359 void SymbolTable::addUnion( const std::string &id ) { 360 addUnion( new UnionDecl( CodeLocation {}, id ) );360 addUnion( new UnionDecl( CodeLocation(), id ) ); 361 361 } 362 362 -
src/AST/Type.cpp
rc02cef1 r4b8b2a4 176 176 for ( const Type * ty : types ) { 177 177 members.emplace_back( new ObjectDecl{ 178 CodeLocation {}, "", ty, new ListInit( CodeLocation{}, {}, {}, NoConstruct ),178 CodeLocation(), "", ty, new ListInit( CodeLocation(), {}, {}, NoConstruct ), 179 179 Storage::Classes{}, Linkage::Cforall } ); 180 180 } -
src/InitTweak/FixInit.cc
rc02cef1 r4b8b2a4 750 750 if ( StructInstType * inst = dynamic_cast< StructInstType * >( t ) ) { 751 751 // 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()); 753 753 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( t ) ) { 754 754 // 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()); 756 756 } 757 757 -
src/InitTweak/InitTweak.cc
rc02cef1 r4b8b2a4 881 881 static ast::ptr<ast::FunctionDecl> assign = nullptr; 882 882 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); 888 888 } 889 889 if (dst->result.as<ast::ReferenceType>()) {
Note: See TracChangeset
for help on using the changeset viewer.