Skip to content

Commit

Permalink
CodeGen: Remove -disable-debug-info-print cl::opt (#100319)
Browse files Browse the repository at this point in the history
This was first introduced way back in in 2010 by
6c74a87, and has little evidence
of use. Only one test attempts to make use of this, but it's
also redundant since it's also using strip to drop debug info anyway
(and that also makes the test buggy, since it's intended to test
with and without debug info).

The other tests using it were only added to test the option after
discovering it was untested and moved, in later commits.
  • Loading branch information
arsenm authored Jul 25, 2024
1 parent a466db2 commit af1d2b9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 89 deletions.
20 changes: 2 additions & 18 deletions llvm/lib/CodeGen/MachineModuleInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,20 @@
//===----------------------------------------------------------------------===//

#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/MCContext.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <memory>
#include <utility>
#include <vector>

using namespace llvm;
using namespace llvm::dwarf;

static cl::opt<bool>
DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden,
cl::desc("Disable debug info printing"));

// Out of line virtual method.
MachineModuleInfoImpl::~MachineModuleInfoImpl() = default;

Expand Down Expand Up @@ -224,8 +210,7 @@ bool MachineModuleInfoWrapperPass::doInitialization(Module &M) {
Ctx.diagnose(
DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie));
});
MMI.DbgInfoAvailable = !DisableDebugInfoPrinting &&
!M.debug_compile_units().empty();
MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
return false;
}

Expand All @@ -250,7 +235,6 @@ MachineModuleAnalysis::run(Module &M, ModuleAnalysisManager &) {
Ctx.diagnose(
DiagnosticInfoSrcMgr(SMD, M.getName(), IsInlineAsm, LocCookie));
});
MMI.DbgInfoAvailable =
!DisableDebugInfoPrinting && !M.debug_compile_units().empty();
MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
return Result(MMI);
}
50 changes: 0 additions & 50 deletions llvm/test/CodeGen/Generic/disable-debug-info-print.ll

This file was deleted.

19 changes: 0 additions & 19 deletions llvm/test/CodeGen/X86/disable-debug-info-print-codeview.ll

This file was deleted.

4 changes: 2 additions & 2 deletions llvm/test/CodeGen/X86/frame-order.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; RUN: llc -mtriple=x86_64-linux-gnueabi -disable-debug-info-print < %s | FileCheck %s
; RUN: opt -passes=strip -S < %s | llc -mtriple=x86_64-linux-gnueabi -disable-debug-info-print | FileCheck %s
; RUN: llc -mtriple=x86_64-linux-gnueabi < %s | FileCheck %s
; RUN: opt -passes=strip -S < %s | llc -mtriple=x86_64-linux-gnueabi | FileCheck %s

; This test checks if the code is generated correctly with and without debug info.

Expand Down

0 comments on commit af1d2b9

Please sign in to comment.