summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 1d3c8299255..80f97b3e049 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -281,6 +281,15 @@ bool llvm::StripDebugInfo(Module &M) {
for (Function &F : M)
Changed |= stripDebugInfo(F);
+ for (auto &GV : M.globals()) {
+ SmallVector<MDNode *, 1> MDs;
+ GV.getMetadata(LLVMContext::MD_dbg, MDs);
+ if (!MDs.empty()) {
+ GV.eraseMetadata(LLVMContext::MD_dbg);
+ Changed = true;
+ }
+ }
+
if (GVMaterializer *Materializer = M.getMaterializer())
Materializer->setStripDebugInfo();
OpenPOWER on IntegriCloud