diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-10-08 20:52:51 +0000 | 
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-10-08 20:52:51 +0000 | 
| commit | 3dc625cdcea833f1f6db7374dfa6683039d455fe (patch) | |
| tree | cf7551ea07c2efe7b568a03817c09636a665fc61 /llvm/lib/Analysis | |
| parent | 222b86cd54e732cf1b9ec66fe103c54211b6e44a (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 2 | 
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;  }  | 

