aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorChih-Ping Chen <chih-ping.chen@intel.com>2021-12-07 11:26:28 -0500
committerChih-Ping Chen <chih-ping.chen@intel.com>2021-12-07 13:45:48 -0500
commitb5c42ef3da4ddf32a57781b8a44c30eee3dc0545 (patch)
tree21f257fc608ba2ffdfbd04b3b8431bedd746c4e1 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parenta3a8ed33a1d6a5047aae29790e02f3c7955297af (diff)
downloadllvm-b5c42ef3da4ddf32a57781b8a44c30eee3dc0545.zip
llvm-b5c42ef3da4ddf32a57781b8a44c30eee3dc0545.tar.gz
llvm-b5c42ef3da4ddf32a57781b8a44c30eee3dc0545.tar.bz2
[NFC][CodeView] Use one unified access to the module in beginModule.
Differential Revision: https://reviews.llvm.org/D115257
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 85ff844..928252a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -611,8 +611,8 @@ 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.
- if (!M->getNamedMetadata("llvm.dbg.cu") ||
- !Asm->getObjFileLowering().getCOFFDebugSymbolsSection()) {
+ NamedMDNode *CUs = M->getNamedMetadata("llvm.dbg.cu");
+ if (!CUs || !Asm->getObjFileLowering().getCOFFDebugSymbolsSection()) {
Asm = nullptr;
return;
}
@@ -622,7 +622,6 @@ void CodeViewDebug::beginModule(Module *M) {
TheCPU = mapArchToCVCPUType(Triple(M->getTargetTriple()).getArch());
// Get the current source language.
- NamedMDNode *CUs = MMI->getModule()->getNamedMetadata("llvm.dbg.cu");
const MDNode *Node = *CUs->operands().begin();
const auto *CU = cast<DICompileUnit>(Node);