diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-12-16 19:39:01 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-12-16 19:39:01 +0000 |
commit | 73ec065604a8ff2512f478fb763eaa4f9c2bf354 (patch) | |
tree | 51d4abac2d0ddd62eff9bc43ea30b15d3486fa48 /llvm/lib/Transforms/IPO/StripSymbols.cpp | |
parent | d0fffd1d1405823e4dc1a4ad16e007e3bdd4bf69 (diff) | |
download | bcm5719-llvm-73ec065604a8ff2512f478fb763eaa4f9c2bf354.tar.gz bcm5719-llvm-73ec065604a8ff2512f478fb763eaa4f9c2bf354.zip |
Revert "[IR] Remove the DIExpression field from DIGlobalVariable."
This reverts commit 289920 (again).
I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable
has not DIExpression. Unfortunately it is not possible to safely upgrade
these variables without adding a flag to the bitcode record indicating which
version they are.
My plan of record is to roll the planned follow-up patch that adds a
unit: field to DIGlobalVariable into this patch before recomitting.
This way we only need one Bitcode upgrade for both changes (with a
version flag in the bitcode record to safely distinguish the record
formats).
Sorry for the churn!
llvm-svn: 289982
Diffstat (limited to 'llvm/lib/Transforms/IPO/StripSymbols.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/StripSymbols.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp index 8f6f161428e..5cb8ff56584 100644 --- a/llvm/lib/Transforms/IPO/StripSymbols.cpp +++ b/llvm/lib/Transforms/IPO/StripSymbols.cpp @@ -313,23 +313,20 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { // replace the current list of potentially dead global variables/functions // with the live list. SmallVector<Metadata *, 64> LiveGlobalVariables; - DenseSet<DIGlobalVariableExpression *> VisitedSet; + DenseSet<const MDNode *> VisitedSet; - std::set<DIGlobalVariableExpression *> LiveGVs; + std::set<DIGlobalVariable *> LiveGVs; for (GlobalVariable &GV : M.globals()) { - SmallVector<DIGlobalVariableExpression *, 1> GVEs; - GV.getDebugInfo(GVEs); - for (auto *GVE : GVEs) - LiveGVs.insert(GVE); + SmallVector<DIGlobalVariable *, 1> DIs; + GV.getDebugInfo(DIs); + for (DIGlobalVariable *DI : DIs) + LiveGVs.insert(DI); } for (DICompileUnit *DIC : F.compile_units()) { // Create our live global variable list. bool GlobalVariableChange = false; - for (auto *DIG : DIC->getGlobalVariables()) { - if (DIG->getExpression() && DIG->getExpression()->isConstant()) - LiveGVs.insert(DIG); - + for (DIGlobalVariable *DIG : DIC->getGlobalVariables()) { // Make sure we only visit each global variable only once. if (!VisitedSet.insert(DIG).second) continue; |