From 03c6d31a3b308afb2c6a4c506002c88c48c9d58d Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 16 Dec 2016 01:00:30 +0000 Subject: Revert "[IR] Remove the DIExpression field from DIGlobalVariable." This reverts commit 289902 while investigating bot berakage. llvm-svn: 289906 --- llvm/lib/Transforms/IPO/StripSymbols.cpp | 17 +++++++---------- .../lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'llvm/lib/Transforms') 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 LiveGlobalVariables; - DenseSet VisitedSet; + DenseSet VisitedSet; - std::set LiveGVs; + std::set LiveGVs; for (GlobalVariable &GV : M.globals()) { - SmallVector GVEs; - GV.getDebugInfo(GVEs); - for (auto *GVE : GVEs) - LiveGVs.insert(GVE); + SmallVector 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; diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 6a7cb0e45c6..acc13aaeaf4 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1655,7 +1655,7 @@ bool AddressSanitizerModule::InstrumentGlobals(IRBuilder<> &IRB, Module &M) { // Transfer the debug info. The payload starts at offset zero so we can // copy the debug info over as is. - SmallVector GVs; + SmallVector GVs; G->getDebugInfo(GVs); for (auto *GV : GVs) NewGlobal->addDebugInfo(GV); -- cgit v1.2.3