mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Start trying to make InstCombine preserve more debug info. The idea here is to set the debug location on the IRBuilder, which will be then right location in most cases. This should magically give many transformations debug locations, and fixing places which are missing a debug location will usually just means changing the code creating it to use the IRBuilder.
As an example, the change to InstCombineCalls catches a common case where a call to a bitcast of a function is rewritten. Chris, does this approach look reasonable? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131516 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1106,15 +1106,15 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
Instruction *NC;
|
||||
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
|
||||
NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
|
||||
Args.begin(), Args.end(),
|
||||
Caller->getName(), Caller);
|
||||
NC = Builder->CreateInvoke(Callee, II->getNormalDest(),
|
||||
II->getUnwindDest(), Args.begin(), Args.end());
|
||||
NC->takeName(II);
|
||||
cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
|
||||
cast<InvokeInst>(NC)->setAttributes(NewCallerPAL);
|
||||
} else {
|
||||
NC = CallInst::Create(Callee, Args.begin(), Args.end(),
|
||||
Caller->getName(), Caller);
|
||||
CallInst *CI = cast<CallInst>(Caller);
|
||||
NC = Builder->CreateCall(Callee, Args.begin(), Args.end());
|
||||
NC->takeName(CI);
|
||||
if (CI->isTailCall())
|
||||
cast<CallInst>(NC)->setTailCall();
|
||||
cast<CallInst>(NC)->setCallingConv(CI->getCallingConv());
|
||||
|
||||
Reference in New Issue
Block a user