Changeset e8616b6
- Timestamp:
- Jul 26, 2022, 11:35:02 AM (17 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 3992098, 7ce8873
- Parents:
- 5cf1228
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r5cf1228 re8616b6 108 108 ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, 109 109 const Init * init = nullptr, Storage::Classes storage = {}, 110 Linkage::Spec linkage = Linkage::C , const Expr * bitWd = nullptr,110 Linkage::Spec linkage = Linkage::Cforall, const Expr * bitWd = nullptr, 111 111 std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} ) 112 112 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ), -
src/AST/Pass.impl.hpp
r5cf1228 re8616b6 597 597 guard_symtab guard { *this }; 598 598 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 599 // This is a C name and so has C linkage. 599 600 static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{ 600 601 CodeLocation{}, "__func__", … … 602 603 new ast::BasicType{ ast::BasicType::Char, ast::CV::Const }, 603 604 nullptr, VariableLen, DynamicDim 604 } 605 }, 606 nullptr, 607 ast::Storage::Classes(), 608 ast::Linkage::C, 605 609 } }; 606 610 __pass::symtab::addId( core, 0, func ); -
src/Concurrency/KeywordsNew.cpp
r5cf1228 re8616b6 398 398 new ast::ReferenceType( vtable_object->type, ast::CV::Const ), 399 399 new ast::SingleInit( location, 400 new ast::VariableExpr( location, vtable_object ) ), 401 ast::Storage::Classes(), 402 ast::Linkage::Cforall 400 new ast::VariableExpr( location, vtable_object ) ) 403 401 ) 404 402 ); … … 471 469 location, 472 470 "this", 473 new ast::ReferenceType( new ast::StructInstType( decl ) ), 474 nullptr, 475 ast::Storage::Classes(), 476 ast::Linkage::Cforall 471 new ast::ReferenceType( new ast::StructInstType( decl ) ) 477 472 ); 478 473 … … 480 475 location, 481 476 "ret", 482 new ast::PointerType( new ast::StructInstType( type_decl ) ), 483 nullptr, 484 ast::Storage::Classes(), 485 ast::Linkage::Cforall 477 new ast::PointerType( new ast::StructInstType( type_decl ) ) 486 478 ); 487 479 … … 530 522 location, 531 523 field_name, 532 new ast::StructInstType( type_decl ), 533 nullptr, 534 ast::Storage::Classes(), 535 ast::Linkage::Cforall 524 new ast::StructInstType( type_decl ) 536 525 ); 537 526 … … 577 566 location, 578 567 "this", 579 new ast::ReferenceType( new ast::StructInstType( decl ) ), 580 nullptr, 581 ast::Storage::Classes(), 582 ast::Linkage::Cforall 568 new ast::ReferenceType( new ast::StructInstType( decl ) ) 583 569 ); 584 570 … … 1077 1063 ) } 1078 1064 ) 1079 ), 1080 ast::Storage::Classes(), 1081 ast::Linkage::Cforall 1065 ) 1082 1066 ); 1083 1067 … … 1107 1091 {}, 1108 1092 ast::MaybeConstruct 1109 ), 1110 ast::Storage::Classes(), 1111 ast::Linkage::Cforall 1093 ) 1112 1094 )) 1113 1095 ); … … 1161 1143 } 1162 1144 ) 1163 ), 1164 ast::Storage::Classes(), 1165 ast::Linkage::Cforall 1145 ) 1166 1146 ); 1167 1147 … … 1190 1170 {}, 1191 1171 ast::MaybeConstruct 1192 ), 1193 ast::Storage::Classes(), 1194 ast::Linkage::Cforall 1172 ) 1195 1173 )) 1196 1174 ); … … 1296 1274 } 1297 1275 ) 1298 ), 1299 ast::Storage::Classes(), 1300 ast::Linkage::Cforall 1276 ) 1301 1277 ); 1302 1278 … … 1370 1346 {}, 1371 1347 ast::MaybeConstruct 1372 ), 1373 ast::Storage::Classes(), 1374 ast::Linkage::Cforall 1348 ) 1375 1349 ) 1376 1350 ) … … 1513 1487 {}, 1514 1488 ast::MaybeConstruct 1515 ), 1516 ast::Storage::Classes(), 1517 ast::Linkage::Cforall 1489 ) 1518 1490 ) 1519 1491 )); -
src/ControlStruct/ExceptDeclNew.cpp
r5cf1228 re8616b6 110 110 "parent", 111 111 new ast::PointerType( 112 new ast::StructInstType( "__cfavir_type_info", ast::CV::Const ) ), 113 nullptr, 114 ast::Storage::Classes(), 115 ast::Linkage::Cforall 112 new ast::StructInstType( "__cfavir_type_info", ast::CV::Const ) ) 116 113 ) ); 117 114 decl->body = true; … … 166 163 location, 167 164 "__cfavir_typeid", 168 new ast::PointerType( typeIdType ), 169 nullptr, 170 ast::Storage::Classes(), 171 ast::Linkage::Cforall 165 new ast::PointerType( typeIdType ) 172 166 ); 173 167 ast::ObjectDecl * size = new ast::ObjectDecl( 174 168 location, 175 169 "size", 176 new ast::TypeInstType( "size_t", ast::TypeDecl::Dtype ), 177 nullptr, 178 ast::Storage::Classes(), 179 ast::Linkage::Cforall 170 new ast::TypeInstType( "size_t", ast::TypeDecl::Dtype ) 180 171 ); 181 172 ast::ObjectDecl * copy = new ast::ObjectDecl( 182 173 location, 183 174 "copy", 184 new ast::PointerType( createCopyFuncType( exceptionName, params ) ), 185 nullptr, 186 ast::Storage::Classes(), 187 ast::Linkage::Cforall 175 new ast::PointerType( createCopyFuncType( exceptionName, params ) ) 188 176 ); 189 177 ast::ObjectDecl * dtor = new ast::ObjectDecl( 190 178 location, 191 179 "^?{}", 192 new ast::PointerType( createDtorFuncType( exceptionName, params ) ), 193 nullptr, 194 ast::Storage::Classes(), 195 ast::Linkage::Cforall 180 new ast::PointerType( createDtorFuncType( exceptionName, params ) ) 196 181 ); 197 182 ast::ObjectDecl * msg = new ast::ObjectDecl( 198 183 location, 199 184 "msg", 200 new ast::PointerType( createMsgFuncType( exceptionName, params ) ), 201 nullptr, 202 ast::Storage::Classes(), 203 ast::Linkage::Cforall 185 new ast::PointerType( createMsgFuncType( exceptionName, params ) ) 204 186 ); 205 187 ast::StructDecl * decl = new ast::StructDecl( … … 229 211 "virtual_table", 230 212 new ast::PointerType( 231 createVTableInstType( exceptionName, params ) ), 232 nullptr, 233 ast::Storage::Classes(), 234 ast::Linkage::Cforall 213 createVTableInstType( exceptionName, params ) ) 235 214 ) ); 236 215 for ( ast::ptr<ast::Decl> const & member : members ) { … … 289 268 "this", 290 269 new ast::PointerType( 291 createExceptionInstType( exceptionName, params ) ), 292 nullptr, 293 ast::Storage::Classes(), 294 ast::Linkage::Cforall 270 createExceptionInstType( exceptionName, params ) ) 295 271 ), 296 272 new ast::ObjectDecl( … … 298 274 "that", 299 275 new ast::PointerType( 300 createExceptionInstType( exceptionName, params ) ), 301 nullptr, 302 ast::Storage::Classes(), 303 ast::Linkage::Cforall 276 createExceptionInstType( exceptionName, params ) ) 304 277 ), 305 278 }, 306 279 { 307 new ast::ObjectDecl( 308 location, 309 "", 310 new ast::VoidType(), 311 nullptr, 312 ast::Storage::Classes(), 313 ast::Linkage::Cforall 314 ), 280 new ast::ObjectDecl( location, "", new ast::VoidType() ), 315 281 }, 316 282 new ast::CompoundStmt( location, { … … 366 332 "this", 367 333 new ast::PointerType( 368 createExceptionInstType( exceptionName, params ) ), 369 nullptr, 370 ast::Storage::Classes(), 371 ast::Linkage::Cforall 334 createExceptionInstType( exceptionName, params ) ) 372 335 ), 373 336 }, … … 377 340 "", 378 341 new ast::PointerType( 379 new ast::BasicType( ast::BasicType::Char, ast::CV::Const ) ), 380 nullptr, 381 ast::Storage::Classes(), 382 ast::Linkage::Cforall 342 new ast::BasicType( ast::BasicType::Char, ast::CV::Const ) ) 383 343 ), 384 344 }, … … 432 392 tableName, 433 393 createVTableInstType( exceptionName, params ), 434 new ast::ListInit( location, std::move( inits ), std::move( dsigs ) ), 435 ast::Storage::Classes(), 436 ast::Linkage::Cforall 394 new ast::ListInit( location, std::move( inits ), std::move( dsigs ) ) 437 395 ); 438 396 } -
src/ControlStruct/ExceptTranslateNew.cpp
r5cf1228 re8616b6 190 190 location, 191 191 "__handler_index", 192 new ast::BasicType(ast::BasicType::SignedInt), 193 nullptr, //init 194 ast::Storage::Classes{}, 195 ast::Linkage::Cforall 192 new ast::BasicType( ast::BasicType::SignedInt ) 196 193 ); 197 194 } … … 203 200 location, 204 201 "__exception_inst", 205 new ast::PointerType( 206 new ast::StructInstType( except_decl ) 207 ), 208 nullptr, //init 209 ast::Storage::Classes{}, 210 ast::Linkage::Cforall 202 new ast::PointerType( new ast::StructInstType( except_decl ) ) 211 203 ); 212 204 } -
src/InitTweak/FixInitNew.cpp
r5cf1228 re8616b6 595 595 if ( arg && isIntrinsicCallExpr( dtor ) ) { 596 596 return new ast::CommaExpr(loc, arg, new ast::VariableExpr(loc, ret ) ); 597 // return;598 597 } 599 598 … … 654 653 if ( ! result->isVoid() ) { 655 654 static UniqueName retNamer("_tmp_cp_ret"); 656 // result = result->clone();657 655 auto subResult = env->apply( result ).node; 658 656 auto ret = new ast::ObjectDecl(loc, retNamer.newName(), subResult, nullptr ); … … 833 831 } 834 832 835 // stmtsToAddBefore.splice( stmtsToAddBefore.end(), fixer.pass.stmtsToAddBefore );836 // stmtsToAddAfter.splice( stmtsToAddAfter.end(), fixer.pass.stmtsToAddAfter );837 833 unqMap[mutExpr->id] = mutExpr; 838 834 } else { … … 1349 1345 auto tmp = new ast::ObjectDecl(loc, tempNamer.newName(), callExpr->args.front()->result ); 1350 1346 declsToAddBefore.push_back( tmp ); 1351 // delete ctorExpr;1352 1347 1353 1348 // build assignment and replace constructor's first argument with new temporary -
src/Validate/Autogen.cpp
r5cf1228 re8616b6 370 370 ast::ObjectDecl * FuncGenerator::dstParam() const { 371 371 return new ast::ObjectDecl( getLocation(), "_dst", 372 new ast::ReferenceType( ast::deepCopy( type ) ), 373 nullptr, {}, ast::Linkage::Cforall ); 372 new ast::ReferenceType( ast::deepCopy( type ) ) ); 374 373 } 375 374 376 375 ast::ObjectDecl * FuncGenerator::srcParam() const { 377 376 return new ast::ObjectDecl( getLocation(), "_src", 378 ast::deepCopy( type ), 379 nullptr, {}, ast::Linkage::Cforall ); 377 ast::deepCopy( type ) ); 380 378 } 381 379 … … 429 427 ast::ObjectDecl * param = new ast::ObjectDecl( 430 428 getLocation(), member->name, paramType ); 431 param->linkage = ast::Linkage::Cforall;432 429 for ( auto & attr : member->attributes ) { 433 430 if ( attr->isValidOnFuncParam() ) {
Note: See TracChangeset
for help on using the changeset viewer.