summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-10-08 20:52:51 +0000
committerBill Wendling <isanbard@gmail.com>2009-10-08 20:52:51 +0000
commit3dc625cdcea833f1f6db7374dfa6683039d455fe (patch)
treecf7551ea07c2efe7b568a03817c09636a665fc61 /llvm/lib/Analysis/DebugInfo.cpp
parent222b86cd54e732cf1b9ec66fe103c54211b6e44a (diff)
downloadbcm5719-llvm-3dc625cdcea833f1f6db7374dfa6683039d455fe.tar.gz
bcm5719-llvm-3dc625cdcea833f1f6db7374dfa6683039d455fe.zip
It's possible for a global variable to be optimized out of a metadata object. So
we should allow a "null" with this dyn_cast. llvm-svn: 83573
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 1436aa909e5..81d0ddb6f55 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -116,7 +116,7 @@ GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const {
return 0;
if (Elt < DbgNode->getNumElements())
- return dyn_cast<GlobalVariable>(DbgNode->getElement(Elt));
+ return dyn_cast_or_null<GlobalVariable>(DbgNode->getElement(Elt));
return 0;
}
OpenPOWER on IntegriCloud