summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2018-12-14 18:15:11 +0000
committerMichael Kruse <llvm@meinersbur.de>2018-12-14 18:15:11 +0000
commit5948b7f30fc4ac9c2ddc142ffb4341bd9eb2289b (patch)
treee57a864621757cf7aa7565bef65fdc49a1dcf615 /llvm/lib/Transforms
parent8fb9a71dde4a2f738f4b77e990dd7ec93d87a889 (diff)
downloadbcm5719-llvm-5948b7f30fc4ac9c2ddc142ffb4341bd9eb2289b.tar.gz
bcm5719-llvm-5948b7f30fc4ac9c2ddc142ffb4341bd9eb2289b.zip
[Transforms] Preserve metadata when converting invoke to call.
The `changeToCall` function did not preserve the invoke's metadata. Currently, there is probably no metadata that depends on being applied on a CallInst or InvokeInst. Therefore we can replace the instruction's metadata. This fixes http://llvm.org/PR39994 Suggested-by: Moritz Kreutzer <moritz.kreutzer@siemens.com> Differential Revision: https://reviews.llvm.org/D55666 llvm-svn: 349170
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 2b7d7ad9d4d..fa0151dbd9f 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1970,6 +1970,7 @@ static void changeToCall(InvokeInst *II, DomTreeUpdater *DTU = nullptr) {
NewCall->setCallingConv(II->getCallingConv());
NewCall->setAttributes(II->getAttributes());
NewCall->setDebugLoc(II->getDebugLoc());
+ NewCall->copyMetadata(*II);
II->replaceAllUsesWith(NewCall);
// Follow the call by a branch to the normal destination.
OpenPOWER on IntegriCloud