aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2022-04-17 12:55:24 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2022-04-19 21:08:37 -0400
commit9592e88f59cfd399e9285cfec50a23675f43a43a (patch)
treea5f641a88fbb2a68e047d7a56e4a3caf9a56e151 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parent9a519179d9efcde3eb8e1808258de1f0d637e990 (diff)
downloadllvm-9592e88f59cfd399e9285cfec50a23675f43a43a.zip
llvm-9592e88f59cfd399e9285cfec50a23675f43a43a.tar.gz
llvm-9592e88f59cfd399e9285cfec50a23675f43a43a.tar.bz2
MachineModuleInfo: Don't allow dynamically setting DbgInfoAvailable
This can be set up front, and used only as a cache. This avoids a field that looks like it requires MIR serialization. I believe this fixes 2 bugs for CodeView. First, this addresses a FIXME that the flag -diable-debug-info-print only works with DWARF. Second, it fixes emitting debug info with emissionKind NoDebug.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index c0b7883..83d77cb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -608,18 +608,16 @@ static SourceLanguage MapDWLangToCVLang(unsigned DWLang) {
void CodeViewDebug::beginModule(Module *M) {
// If module doesn't have named metadata anchors or COFF debug section
// is not available, skip any debug info related stuff.
- NamedMDNode *CUs = M->getNamedMetadata("llvm.dbg.cu");
- if (!CUs || !Asm->getObjFileLowering().getCOFFDebugSymbolsSection()) {
+ if (!MMI->hasDebugInfo() ||
+ !Asm->getObjFileLowering().getCOFFDebugSymbolsSection()) {
Asm = nullptr;
return;
}
- // Tell MMI that we have and need debug info.
- MMI->setDebugInfoAvailability(true);
TheCPU = mapArchToCVCPUType(Triple(M->getTargetTriple()).getArch());
// Get the current source language.
- const MDNode *Node = *CUs->operands().begin();
+ const MDNode *Node = *M->debug_compile_units_begin();
const auto *CU = cast<DICompileUnit>(Node);
CurrentSourceLanguage = MapDWLangToCVLang(CU->getSourceLanguage());