summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-31 20:28:04 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-31 20:28:04 +0000
commit7779b4fd8ee578a587deb7299c3337cb969276c6 (patch)
treed2cbd65e3ed657803a7325f98fb6a72196378a02 /llvm/lib
parente5d641ebcafc3586f4981bc3a04f01b7f6b6acb8 (diff)
downloadbcm5719-llvm-7779b4fd8ee578a587deb7299c3337cb969276c6.tar.gz
bcm5719-llvm-7779b4fd8ee578a587deb7299c3337cb969276c6.zip
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
Diffstat (limited to 'llvm/lib')
-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