Mercurial > projects > ldc
comparison gen/tocall.cpp @ 1013:8c73ff5f69e0
Use llvm::CallSite instead of custom CallOrInvoke class.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 28 Feb 2009 22:16:52 +0100 |
parents | 7a0238db1962 |
children | e8c6dbcd33d1 |
comparison
equal
deleted
inserted
replaced
1012:39cf8fa483fd | 1013:8c73ff5f69e0 |
---|---|
457 | 457 |
458 if (Logger::enabled()) | 458 if (Logger::enabled()) |
459 Logger::cout() << "Calling: " << *callable << '\n'; | 459 Logger::cout() << "Calling: " << *callable << '\n'; |
460 | 460 |
461 // call the function | 461 // call the function |
462 CallOrInvoke* call = gIR->CreateCallOrInvoke(callable, args.begin(), args.end(), varname); | 462 LLCallSite call = gIR->CreateCallOrInvoke(callable, args.begin(), args.end(), varname); |
463 | 463 |
464 // get return value | 464 // get return value |
465 LLValue* retllval = (retinptr) ? args[0] : call->get(); | 465 LLValue* retllval = (retinptr) ? args[0] : call.getInstruction(); |
466 | 466 |
467 if (tf->linkage == LINKintrinsic) | 467 if (tf->linkage == LINKintrinsic) |
468 { | 468 { |
469 // Ignore ABI for intrinsics | 469 // Ignore ABI for intrinsics |
470 Type* rettype = tf->next; | 470 Type* rettype = tf->next; |
519 { | 519 { |
520 LLFunction* llfunc = llvm::dyn_cast<LLFunction>(dfnval->val); | 520 LLFunction* llfunc = llvm::dyn_cast<LLFunction>(dfnval->val); |
521 if (llfunc && llfunc->isIntrinsic()) // override intrinsic attrs | 521 if (llfunc && llfunc->isIntrinsic()) // override intrinsic attrs |
522 attrlist = llvm::Intrinsic::getAttributes((llvm::Intrinsic::ID)llfunc->getIntrinsicID()); | 522 attrlist = llvm::Intrinsic::getAttributes((llvm::Intrinsic::ID)llfunc->getIntrinsicID()); |
523 else | 523 else |
524 call->setCallingConv(callconv); | 524 call.setCallingConv(callconv); |
525 } | 525 } |
526 else | 526 else |
527 call->setCallingConv(callconv); | 527 call.setCallingConv(callconv); |
528 call->setAttributes(attrlist); | 528 call.setAttributes(attrlist); |
529 | 529 |
530 return new DImValue(resulttype, retllval); | 530 return new DImValue(resulttype, retllval); |
531 } | 531 } |