aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
index 536d04f2fe26..28941d6c41cf 100644
--- a/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
+++ b/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
@@ -19,10 +19,20 @@
using namespace llvm;
PreservedAnalyses BitcodeWriterPass::run(Module &M, ModuleAnalysisManager &AM) {
+ // RemoveDIs: there's no bitcode representation of the DPValue debug-info,
+ // convert to dbg.values before writing out.
+ bool IsNewDbgInfoFormat = M.IsNewDbgInfoFormat;
+ if (IsNewDbgInfoFormat)
+ M.convertFromNewDbgValues();
+
const ModuleSummaryIndex *Index =
EmitSummaryIndex ? &(AM.getResult<ModuleSummaryIndexAnalysis>(M))
: nullptr;
WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, Index, EmitModuleHash);
+
+ if (IsNewDbgInfoFormat)
+ M.convertToNewDbgValues();
+
return PreservedAnalyses::all();
}
@@ -54,8 +64,17 @@ namespace {
EmitSummaryIndex
? &(getAnalysis<ModuleSummaryIndexWrapperPass>().getIndex())
: nullptr;
+ // RemoveDIs: there's no bitcode representation of the DPValue debug-info,
+ // convert to dbg.values before writing out.
+ bool IsNewDbgInfoFormat = M.IsNewDbgInfoFormat;
+ if (IsNewDbgInfoFormat)
+ M.convertFromNewDbgValues();
+
WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, Index,
EmitModuleHash);
+
+ if (IsNewDbgInfoFormat)
+ M.convertToNewDbgValues();
return false;
}
void getAnalysisUsage(AnalysisUsage &AU) const override {