Use stripPointerCasts instead of partially rewriting it.
authorDale Johannesen <dalej@apple.com>
Thu, 6 Aug 2009 22:45:51 +0000 (22:45 +0000)
committerDale Johannesen <dalej@apple.com>
Thu, 6 Aug 2009 22:45:51 +0000 (22:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78350 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

index c991bae93ba2fd0d738910f79e8c435244d8f47a..73b75797d6b60919327c924079c46ef884e72061 100644 (file)
@@ -5137,10 +5137,8 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
     // 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);
+      OpInfo.CallOperandVal = OpInfo.CallOperandVal->stripPointerCasts();
+
       if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal)) {
         OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
       } else {