- Timestamp:
- Nov 29, 2023, 1:41:52 PM (13 months ago)
- Branches:
- master
- Children:
- 4dc3b8c
- Parents:
- 4f1b2d69 (diff), ab9c1b3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
r4f1b2d69 r7f2bfb7 41 41 42 42 FunctionDecl::FunctionDecl( const CodeLocation & loc, const std::string & name, 43 std::vector<ptr<TypeDecl>>&& forall,44 43 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 45 44 CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage, 46 45 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, ArgumentFlag isVarArgs ) 47 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), 48 type_params(std::move(forall)), assertions(), 49 params(std::move(params)), returns(std::move(returns)), stmts( stmts ) { 50 FunctionType * ftype = new FunctionType( isVarArgs ); 51 for (auto & param : this->params) { 52 ftype->params.emplace_back(param->get_type()); 53 } 54 for (auto & ret : this->returns) { 55 ftype->returns.emplace_back(ret->get_type()); 56 } 57 for (auto & tp : this->type_params) { 58 ftype->forall.emplace_back(new TypeInstType(tp)); 59 for (auto & ap: tp->assertions) { 60 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); 61 } 62 } 63 this->type = ftype; 46 : FunctionDecl( loc, name, {}, {}, std::move(params), std::move(returns), 47 stmts, storage, linkage, std::move(attrs), fs, isVarArgs ) { 64 48 } 65 49 -
src/AST/Decl.hpp
r4f1b2d69 r7f2bfb7 135 135 std::vector< ptr<Expr> > withExprs; 136 136 137 // The difference between the two constructors is in how they handle 138 // assertions. The first constructor uses the assertions from the type 139 // parameters, in the style of the old ast, and puts them on the type. 140 // The second takes an explicite list of assertions and builds a list of 141 // references to them on the type. 142 143 FunctionDecl( const CodeLocation & loc, const std::string & name, std::vector<ptr<TypeDecl>>&& forall, 137 /// Monomorphic Function Constructor: 138 FunctionDecl( const CodeLocation & locaction, const std::string & name, 144 139 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 145 140 CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::Cforall, 146 141 std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {}, ArgumentFlag isVarArgs = FixedArgs ); 147 142 143 /// Polymorphic Function Constructor: 148 144 FunctionDecl( const CodeLocation & location, const std::string & name, 149 145 std::vector<ptr<TypeDecl>>&& forall, std::vector<ptr<DeclWithType>>&& assertions, -
src/Concurrency/Actors.cpp
r4f1b2d69 r7f2bfb7 265 265 decl->location, 266 266 "__CFA_receive_wrap", 267 {}, // forall268 267 { 269 268 new ObjectDecl( … … 288 287 ) 289 288 }, // params 290 { 289 { 291 290 new ObjectDecl( 292 291 decl->location, … … 400 399 ) 401 400 )); 402 401 403 402 // Generates: return receiver; 404 403 sendBody->push_back( new ReturnStmt( decl->location, new NameExpr( decl->location, "receiver" ) ) ); … … 408 407 decl->location, 409 408 "?|?", 410 {}, // forall411 409 { 412 410 new ObjectDecl( … … 421 419 ) 422 420 }, // params 423 { 421 { 424 422 new ObjectDecl( 425 423 decl->location, … … 434 432 { Function::Inline } 435 433 ); 436 434 437 435 // forward decls to resolve use before decl problem for '|' routines 438 436 forwardDecls.insertDecl( *actorIter, *messageIter , ast::deepCopy( sendOperatorFunction ) ); -
src/Concurrency/Corun.cpp
r4f1b2d69 r7f2bfb7 113 113 new FunctionDecl( loc, 114 114 fnName, // name 115 {}, // forall116 115 { 117 116 new ObjectDecl( loc, … … 261 260 new FunctionDecl( loc, 262 261 fnName, // name 263 {}, // forall264 262 {}, // params 265 263 {}, // return -
src/Concurrency/KeywordsNew.cpp
r4f1b2d69 r7f2bfb7 482 482 location, 483 483 getter_name, 484 {}, // forall485 484 { this_decl }, // params 486 485 { ret_decl }, // returns … … 499 498 location, 500 499 "main", 501 {},502 500 { ast::deepCopy( this_decl ) }, 503 501 {}, … … 575 573 location, 576 574 "lock", 577 { /* forall */ },578 575 { 579 576 // Copy the declaration of this. … … 607 604 location, 608 605 "unlock", 609 { /* forall */ },610 606 { 611 607 // Last use, consume the declaration of this. -
src/Concurrency/Waituntil.cpp
r4f1b2d69 r7f2bfb7 553 553 return new FunctionDecl( loc, 554 554 predName, 555 {}, // forall556 555 { 557 556 new ObjectDecl( loc, … … 560 559 ) 561 560 }, 562 { 561 { 563 562 new ObjectDecl( loc, 564 563 "sat_ret", -
src/ControlStruct/ExceptTranslateNew.cpp
r4f1b2d69 r7f2bfb7 253 253 location, 254 254 "try", 255 {}, //forall256 255 {}, //no param 257 256 {}, //no return … … 267 266 location, 268 267 "catch", 269 {}, //forall270 268 { make_index_object( location ), make_exception_object( location ) }, 271 269 {}, //return void … … 281 279 location, 282 280 "match", 283 {}, //forall284 281 { make_exception_object( location ) }, 285 282 { make_unused_index_object( location ) }, … … 295 292 location, 296 293 "handle", 297 {}, //forall298 294 { make_exception_object( location ) }, 299 295 { make_bool_object( location ) }, … … 309 305 location, 310 306 "finally", 311 {}, //forall312 307 { make_voidptr_object( location ) }, 313 308 {}, //return void -
src/InitTweak/FixGlobalInit.cc
r4f1b2d69 r7f2bfb7 84 84 if (inLibrary) ctorParams.emplace_back(ast::ConstantExpr::from_int(location, 200)); 85 85 auto initFunction = new ast::FunctionDecl(location, 86 "__global_init__", {}, {}, {}, 86 "__global_init__", {}, {}, {}, {}, 87 87 new ast::CompoundStmt(location, std::move(fixer.core.initStmts)), 88 88 ast::Storage::Static, ast::Linkage::C, … … 96 96 if (inLibrary) dtorParams.emplace_back(ast::ConstantExpr::from_int(location, 200)); 97 97 auto destroyFunction = new ast::FunctionDecl( location, 98 "__global_destroy__", {}, {}, {}, 98 "__global_destroy__", {}, {}, {}, {}, 99 99 new ast::CompoundStmt(location, std::move(fixer.core.destroyStmts)), 100 100 ast::Storage::Static, ast::Linkage::C, -
src/InitTweak/FixInitNew.cpp
r4f1b2d69 r7f2bfb7 74 74 fname, 75 75 std::move(typeParams), 76 {}, 76 77 {dstParam}, 77 78 {}, … … 899 900 900 901 // void __objName_dtor_atexitN(...) {...} 901 ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );902 ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C ); 902 903 dtorCaller->fixUniqueId(); 903 904 // dtorCaller->stmts->push_back( dtor ); -
src/InitTweak/InitTweak.cc
r4f1b2d69 r7f2bfb7 342 342 if (!assign) { 343 343 auto td = new ast::TypeDecl(CodeLocation(), "T", {}, nullptr, ast::TypeDecl::Dtype, true); 344 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, 344 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, {}, 345 345 { new ast::ObjectDecl(CodeLocation(), "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))), 346 346 new ast::ObjectDecl(CodeLocation(), "_src", new ast::TypeInstType("T", td))}, -
src/Makefile.am
r4f1b2d69 r7f2bfb7 72 72 73 73 cfa_cpplib_PROGRAMS += $(DEMANGLER) 74 EXTRA_PROGRAMS = demangler75 demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete76 demangler_LDADD = libdemangle.a -ldl # yywrap74 EXTRA_PROGRAMS = ../driver/demangler 75 ___driver_demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete 76 ___driver_demangler_LDADD = libdemangle.a -ldl # yywrap 77 77 noinst_LIBRARIES = $(LIBDEMANGLE) 78 78 EXTRA_LIBRARIES = libdemangle.a -
src/ResolvExpr/CurrentObject.cc
r4f1b2d69 r7f2bfb7 498 498 PRINT( std::cerr << "____untyped: " << expr << std::endl; ) 499 499 auto dit = desigAlts.begin(); 500 auto nexpr = dynamic_cast< const NameExpr * >( expr ); 500 501 501 502 for ( const Type * t : curTypes ) { 502 503 assert( dit != desigAlts.end() ); 503 504 DesignatorChain & d = *dit; 504 if ( auto nexpr = dynamic_cast< const NameExpr *>( expr ) ) { 505 // Name Designation: 506 if ( nexpr ) { 505 507 PRINT( std::cerr << "____actual: " << t << std::endl; ) 506 508 if ( auto refType = dynamic_cast< const BaseInstType * >( t ) ) { … … 515 517 } 516 518 } 517 } else if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {518 auto nexpr = dynamic_cast< const NameExpr *>( expr );519 for ( const Decl * mem : refType->lookup( nexpr->name ) ) {520 if ( auto field = dynamic_cast< const ObjectDecl * >( mem ) ) {521 DesignatorChain d2 = d;522 d2.emplace_back( new VariableExpr{ expr->location, field } );523 newDesigAlts.emplace_back( std::move( d2 ) );524 newTypes.emplace_back( at->base );525 }526 }527 519 } 528 520 529 521 ++dit; 522 // Index Designation: 530 523 } else { 531 524 if ( auto at = dynamic_cast< const ArrayType * >( t ) ) { -
src/Virtual/Tables.cc
r4f1b2d69 r7f2bfb7 165 165 location, 166 166 functionName, 167 { /* forall */ },168 167 { new ast::ObjectDecl( 169 168 location, -
src/Virtual/VirtualDtor.cpp
r4f1b2d69 r7f2bfb7 248 248 decl->location, 249 249 "__CFA_set_dtor", 250 {}, // forall251 250 { 252 251 new ObjectDecl( … … 320 319 decl->location, 321 320 "delete", 322 {}, // forall323 321 { 324 322 new ObjectDecl(
Note: See TracChangeset
for help on using the changeset viewer.