[DebugInfo] Fix PR37395.
DbgLabelInst has no address as its operands.
Differential Revision: https://reviews.llvm.org/D46738
Patch by Hsiangkai Wang.
llvm-svn: 336176
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 9ffcae1..7878899 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -45,7 +45,10 @@
return V->getValue();
// When the value goes to null, it gets replaced by an empty MDNode.
- assert(!cast<MDNode>(MD)->getNumOperands() && "Expected an empty MDNode");
+ assert((isa<DbgLabelInst>(this)
+ || !cast<MDNode>(MD)->getNumOperands())
+ && "DbgValueInst Expected an empty MDNode");
+
return nullptr;
}