diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 20:13:30 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-13 20:13:30 +0000 |
commit | afb02d5d0d3cf2d7cd59a90410594901620d00f2 (patch) | |
tree | b9be0dde02a9c13b6fdef2809ec23a5b36ad2270 /lib/Transforms/IPO | |
parent | 55ba23d2fccfc7861671f710219097068d09a61f (diff) | |
download | llvm-afb02d5d0d3cf2d7cd59a90410594901620d00f2.tar.gz |
StripSymbols: Use DIGlobalVariable::getConstant() instead of getGlobal()
The only difference between the two is a `dyn_cast<>` to
`GlobalVariable`. If optimizations have left anything behind when a
global gets replaced, then it doesn't seem like the debug info is dead.
I can't seem to find an optimization that would leave behind a
non-`GlobalVariable` without nulling the reference entirely, so I
haven't added a testcase (but I'll be deleting `getGlobal()` in a future
commit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/StripSymbols.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 74c96eaafa27..100669583008 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -335,7 +335,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { // If the global variable referenced by DIG is not null, the global // variable is live. - if (DIG.getGlobal()) + if (DIG.getConstant()) LiveGlobalVariables.push_back(DIG); else GlobalVariableChange = true; |