aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-07-20 23:27:39 +0000
committerDale Johannesen <dalej@apple.com>2009-07-20 23:27:39 +0000
commit5339c551b508d8231672b417d9df1629e42af89b (patch)
tree962dccb3b3ad04cd5222fd96091a4c4a59fd9577 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent0d5bae41fb86188d62dbc39de629ae0de71f93e0 (diff)
Move stripping of bitcasts in inline asm arguments
to a place where it affects everything. Occurs only on calls AFAIK. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 05622f2d6c..3fa6047ad5 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -5059,6 +5059,11 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
// If this is an input or an indirect output, process the call argument.
// BasicBlocks are labels, currently appearing only in asm's.
if (OpInfo.CallOperandVal) {
+ // Strip bitcasts, if any. This mostly comes up for functions.
+ ConstantExpr* CE = NULL;
+ while ((CE = dyn_cast<ConstantExpr>(OpInfo.CallOperandVal)) &&
+ CE->getOpcode()==Instruction::BitCast)
+ OpInfo.CallOperandVal = CE->getOperand(0);
if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal)) {
OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
} else {