summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-10-31 21:56:03 +0000
committerManman Ren <manman.ren@gmail.com>2013-10-31 21:56:03 +0000
commit87a2adc7fe42108105fbd73e01fb8a306c4cbccc (patch)
tree1ca1d860768de917c69a53a109ffa1f4f8e0f9c8 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent627e2c0dd75e32c58a881b2119df16159d615b66 (diff)
downloadbcm5719-llvm-87a2adc7fe42108105fbd73e01fb8a306c4cbccc.tar.gz
bcm5719-llvm-87a2adc7fe42108105fbd73e01fb8a306c4cbccc.zip
Do not convert "call asm" to "invoke asm" in Inliner.
Given that backend does not handle "invoke asm" correctly ("invoke asm" will be handled by SelectionDAGBuilder::visitInlineAsm, which does not have the right setup for LPadToCallSiteMap) and we already made the assumption that inline asm does not throw in InstCombiner::visitCallSite, we are going to make the same assumption in Inliner to make sure we don't convert "call asm" to "invoke asm". If it becomes necessary to add support for "invoke asm" later on, we will need to modify the backend as well as remove the assumptions that inline asm does not throw. Fix rdar://15317907 llvm-svn: 193808
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 585658a8811..56429117f77 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -193,7 +193,8 @@ static bool HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
CallInst *CI = dyn_cast<CallInst>(I);
// If this call cannot unwind, don't convert it to an invoke.
- if (!CI || CI->doesNotThrow())
+ // Inline asm calls cannot throw.
+ if (!CI || CI->doesNotThrow() || isa<InlineAsm>(CI->getCalledValue()))
continue;
// Convert this function call into an invoke instruction. First, split the
OpenPOWER on IntegriCloud