summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Metadata.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 24c78fea646..3d869e87c4d 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -660,7 +660,7 @@ void Instruction::setMetadata(unsigned KindID, Value *MD) {
if (!MD && !hasMetadata()) return;
// For now, we only expect MDNodes here.
- MDNode *Node = cast<MDNode>(MD);
+ MDNode *Node = cast_or_null<MDNode>(MD);
// Handle 'dbg' as a special case since it is not stored in the hash table.
if (KindID == LLVMContext::MD_dbg) {
OpenPOWER on IntegriCloud