summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/StripSymbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/StripSymbols.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/StripSymbols.cpp17
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;
OpenPOWER on IntegriCloud