aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2024-07-26 13:06:27 +0400
committerGitHub <noreply@github.com>2024-07-26 13:06:27 +0400
commit4ce3993ee2b6ee883ef62100df68db9e10ef1dc9 (patch)
tree4c977d23215746144c7eca1f7b5666ed511b8a00 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parent6f83a031e452bb33c0ee23b8c5c4dee97ce2bf52 (diff)
downloadllvm-4ce3993ee2b6ee883ef62100df68db9e10ef1dc9.zip
llvm-4ce3993ee2b6ee883ef62100df68db9e10ef1dc9.tar.gz
llvm-4ce3993ee2b6ee883ef62100df68db9e10ef1dc9.tar.bz2
DebugInfo: Avoid some MMI::hasDebugInfo checks (#100333)
I assume getSubprogram will do the correct thing in hasDebugInfo, and this is redundant with the debug_compile_units distance check. This is in preparation for removing the field.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 6c70c47..ed99eb3 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -241,10 +241,7 @@ bool DebugHandlerBase::isUnsignedDIType(const DIType *Ty) {
Ty->getTag() == dwarf::DW_TAG_unspecified_type;
}
-static bool hasDebugInfo(const MachineModuleInfo *MMI,
- const MachineFunction *MF) {
- if (!MMI->hasDebugInfo())
- return false;
+static bool hasDebugInfo(const MachineFunction *MF) {
auto *SP = MF->getFunction().getSubprogram();
if (!SP)
return false;
@@ -258,7 +255,7 @@ static bool hasDebugInfo(const MachineModuleInfo *MMI,
void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
PrevInstBB = nullptr;
- if (!Asm || !hasDebugInfo(MMI, MF)) {
+ if (!Asm || !hasDebugInfo(MF)) {
skippedNonDebugFunction();
return;
}
@@ -415,7 +412,7 @@ void DebugHandlerBase::endInstruction() {
}
void DebugHandlerBase::endFunction(const MachineFunction *MF) {
- if (Asm && hasDebugInfo(MMI, MF))
+ if (Asm && hasDebugInfo(MF))
endFunctionImpl(MF);
DbgValues.clear();
DbgLabels.clear();