From 7779b4fd8ee578a587deb7299c3337cb969276c6 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 31 Oct 2014 20:28:04 +0000 Subject: [PATCH] IR: Instruction::setMetadata() should use cast_or_null Not sure why this assertion didn't fire locally [1], but in r220994 `Instruction::setMetadata()` should be using `cast_or_null`. [1]: http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/12327 llvm-svn: 220995 --- llvm/lib/IR/Metadata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 24c78fe..3d869e8 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(MD); + MDNode *Node = cast_or_null(MD); // Handle 'dbg' as a special case since it is not stored in the hash table. if (KindID == LLVMContext::MD_dbg) { -- 2.7.4