summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-18 21:30:12 +0100
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 22:11:55 +0200
commit5f757f3ff9144b609b3c433dfd370cc6bdc191ad (patch)
tree1b4e980b866cd26a00af34c0a653eb640bd09caf /contrib/llvm-project/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
parent3e1c8a35f741a5d114d0ba670b15191355711fe9 (diff)
parent312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff)
Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb. PR: 276104 MFC after: 1 month
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 {