Fix printing of instructions with null operands.
authorDan Gohman <gohman@apple.com>
Mon, 17 Aug 2009 15:28:08 +0000 (15:28 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 17 Aug 2009 15:28:08 +0000 (15:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79243 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 82358e9b89abed7aef0c164cc18a441968e11aac..94256827f0a5a5b467c98fe92fcb6dfe4bb2798a 100644 (file)
@@ -689,7 +689,7 @@ void SlotTracker::processFunction() {
           !I->hasName())
         CreateFunctionSlot(I);
       for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) 
-        if (MDNode *N = dyn_cast<MDNode>(I->getOperand(i))) 
+        if (MDNode *N = dyn_cast_or_null<MDNode>(I->getOperand(i)))
           CreateMetadataSlot(N);
     }
   }