diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index b950f4fdbcf79..088e76029f1a3 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #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" @@ -16,25 +14,13 @@ #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 #include -#include -#include -#include using namespace llvm; using namespace llvm::dwarf; -static cl::opt - DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden, - cl::desc("Disable debug info printing")); - // Out of line virtual method. MachineModuleInfoImpl::~MachineModuleInfoImpl() = default; @@ -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; } @@ -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); } diff --git a/llvm/test/CodeGen/Generic/disable-debug-info-print.ll b/llvm/test/CodeGen/Generic/disable-debug-info-print.ll deleted file mode 100644 index befa91c15d3c8..0000000000000 --- a/llvm/test/CodeGen/Generic/disable-debug-info-print.ll +++ /dev/null @@ -1,50 +0,0 @@ -; RUN: llc -disable-debug-info-print=true -exception-model=dwarf -o - %s | FileCheck %s -; RUN: llc -disable-debug-info-print=true -exception-model=sjlj -o - %s | FileCheck %s --check-prefix=SJLJ-CHECK - -define i16 @main() nounwind !dbg !7 { -entry: - ret i16 0, !dbg !9 -} - -define i16 @helper() !dbg !10 { -entry: - ret i16 0, !dbg !11 -} - - -; CHECK: main -; CHECK-NOT: cfi_startproc -; CHECK-NOT: .file -; CHECK-NOT: .loc -; CHECK: helper -; CHECK: cfi_startproc -; CHECK-NOT: .file -; CHECK-NOT: .loc -; CHECK: cfi_endproc - -; SJLJ-CHECK: main -; SJLJ-CHECK-NOT: cfi_startproc -; SJLJ-CHECK-NOT: .file -; SJLJ-CHECK-NOT: .loc -; SJLJ-CHECK: helper -; SJLJ-CHECK-NOT: cfi_startproc -; SJLJ-CHECK-NOT: .file -; SJLJ-CHECK-NOT: .loc - - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!3, !4, !5} -!llvm.ident = !{!6} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, splitDebugInlining: false, nameTableKind: None) -!1 = !DIFile(filename: "unwind-tables.c", directory: "/tmp") -!2 = !{} -!3 = !{i32 7, !"Dwarf Version", i32 4} -!4 = !{i32 2, !"Debug Info Version", i32 3} -!5 = !{i32 1, !"wchar_size", i32 4} -!6 = !{!"clang version 12.0.0"} -!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!8 = !DISubroutineType(types: !2) -!9 = !DILocation(line: 2, column: 3, scope: !7) -!10 = distinct !DISubprogram(name: "helper", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!11 = !DILocation(line: 2, column: 3, scope: !10) diff --git a/llvm/test/CodeGen/X86/disable-debug-info-print-codeview.ll b/llvm/test/CodeGen/X86/disable-debug-info-print-codeview.ll deleted file mode 100644 index 930dafc119b3c..0000000000000 --- a/llvm/test/CodeGen/X86/disable-debug-info-print-codeview.ll +++ /dev/null @@ -1,19 +0,0 @@ -; RUN: llc -disable-debug-info-print -o - %s | FileCheck %s - -; Check that debug info isn't emitted for CodeView with -; -disable-debug-info-print. - -; CHECK-NOT: CodeViewTypes -; CHECK-NOT: CodeViewDebugInfo - -source_filename = "empty" -target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-pc-windows-msvc19.0.24215" - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!2, !3} - -!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "clang", emissionKind: FullDebug) -!1 = !DIFile(filename: "empty", directory: "path/to") -!2 = !{i32 2, !"CodeView", i32 1} -!3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/CodeGen/X86/frame-order.ll b/llvm/test/CodeGen/X86/frame-order.ll index 2857a738e8efc..dcbcb481f927c 100644 --- a/llvm/test/CodeGen/X86/frame-order.ll +++ b/llvm/test/CodeGen/X86/frame-order.ll @@ -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.