summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-07-04 23:15:18 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-07-04 23:15:18 +0000
commit9a300bda389f26ec510f41933fa1b7d3906d4dbb (patch)
tree3b85eb13cec5c728b42cd1b27d5aa598a8cd9188 /llvm/lib
parentb46f7b974ed2f74bd3cb36de191351781f4cba76 (diff)
downloadbcm5719-llvm-9a300bda389f26ec510f41933fa1b7d3906d4dbb.tar.gz
bcm5719-llvm-9a300bda389f26ec510f41933fa1b7d3906d4dbb.zip
DebugInfo: Consider global variables without locations to be valid
We were being a bit too aggresive here in classifying global variables with no global reference or constant value to be invalid - this would cause LLVM to not emit the DWARF description of the global variable if it had been optimized away, which isn't helpful for users who might benefit from the global variable's description even if there's no location information. This also fixes a crasher issue here that I was unable to reduce a test case for - involving a using decl (& subsequent DW_TAG_imported_declaration ) of such a global variable that, once optimized away, would crash when an attempt to emit the imported declaration was made. llvm-svn: 185675
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 1ab39b6fe8c..25d4ea4fc2a 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -514,9 +514,6 @@ bool DIGlobalVariable::Verify() const {
if (!Ty.Verify())
return false;
- if (!getGlobal() && !getConstant())
- return false;
-
return DbgNode->getNumOperands() == 13;
}
OpenPOWER on IntegriCloud