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 | 7fa6629d7d5df922c74b05152f2baa98f3462fc3 (patch) | |
| tree | b80927e7d8553bf3108dcd48b2cd82f4e095aeee /llvm/lib/Transforms/IPO | |
| parent | fa92b4c9d8b86fb21c8c53e2985cc7086f30044e (diff) | |
| download | bcm5719-llvm-7fa6629d7d5df922c74b05152f2baa98f3462fc3.tar.gz bcm5719-llvm-7fa6629d7d5df922c74b05152f2baa98f3462fc3.zip | |
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).
llvm-svn: 234792
Diffstat (limited to 'llvm/lib/Transforms/IPO')
| -rw-r--r-- | llvm/lib/Transforms/IPO/StripSymbols.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp index 74c96eaafa2..10066958300 100644 --- a/llvm/lib/Transforms/IPO/StripSymbols.cpp +++ b/llvm/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; |

