diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-12-15 21:27:59 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-12-15 21:27:59 +0000 |
commit | 0b17d44faf9bb680a42a22653a9be1ea6c77034b (patch) | |
tree | cbda87221a1853c16ff79d6a64bccc68892c9191 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3bb88c0210d955628f0b0daf5da52769815f3f25 (diff) | |
download | bcm5719-llvm-0b17d44faf9bb680a42a22653a9be1ea6c77034b.tar.gz bcm5719-llvm-0b17d44faf9bb680a42a22653a9be1ea6c77034b.zip |
[WinEH] Update clang to use operand bundles on call sites
This updates clang to use bundle operands to associate an invoke with
the funclet which it is contained within.
Depends on D15517.
Differential Revision: http://reviews.llvm.org/D15518
llvm-svn: 255675
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 29c5f3eed5a..b207bac3dee 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2495,6 +2495,7 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, llvm::Type *newRetTy = newFn->getReturnType(); SmallVector<llvm::Value*, 4> newArgs; + SmallVector<llvm::OperandBundleDef, 1> newBundles; for (llvm::Value::use_iterator ui = old->use_begin(), ue = old->use_end(); ui != ue; ) { @@ -2562,16 +2563,19 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, // over the required information. newArgs.append(callSite.arg_begin(), callSite.arg_begin() + argNo); + // Copy over any operand bundles. + callSite.getOperandBundlesAsDefs(newBundles); + llvm::CallSite newCall; if (callSite.isCall()) { - newCall = llvm::CallInst::Create(newFn, newArgs, "", + newCall = llvm::CallInst::Create(newFn, newArgs, newBundles, "", callSite.getInstruction()); } else { auto *oldInvoke = cast<llvm::InvokeInst>(callSite.getInstruction()); newCall = llvm::InvokeInst::Create(newFn, oldInvoke->getNormalDest(), oldInvoke->getUnwindDest(), - newArgs, "", + newArgs, newBundles, "", callSite.getInstruction()); } newArgs.clear(); // for the next iteration @@ -2589,6 +2593,7 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, // Copy debug location attached to CI. if (callSite->getDebugLoc()) newCall->setDebugLoc(callSite->getDebugLoc()); + callSite->eraseFromParent(); } } |