isa+cast -> dyn_cast
authorChris Lattner <sabre@nondot.org>
Sun, 27 Apr 2008 00:16:18 +0000 (00:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Apr 2008 00:16:18 +0000 (00:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50314 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 888d4605bd5733f92edb3467024b1e3d510aa86c..7e8b61465ad42675aebc862418510f5148318890 100644 (file)
@@ -3789,10 +3789,8 @@ 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) {
-      if (isa<BasicBlock>(OpInfo.CallOperandVal))
-        OpInfo.CallOperand = 
-          DAG.getBasicBlock(FuncInfo.MBBMap[cast<BasicBlock>(
-                                                 OpInfo.CallOperandVal)]);
+      if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal))
+        OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
       else {
         OpInfo.CallOperand = getValue(OpInfo.CallOperandVal);
         const Type *OpTy = OpInfo.CallOperandVal->getType();