Skip to content

Commit

Permalink
[NFC][CodeView] Use one unified access to the module in beginModule.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D115257
  • Loading branch information
cchen15 committed Dec 7, 2021
1 parent a3a8ed3 commit b5c42ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Expand Up @@ -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;
}
Expand All @@ -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);

Expand Down

0 comments on commit b5c42ef

Please sign in to comment.