Index: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -996,7 +996,7 @@ } bool DwarfCompileUnit::useGNUAnalogForDwarf5Feature() const { - return DD->getDwarfVersion() == 4 && DD->tuneForGDB(); + return DD->getDwarfVersion() == 4 && !DD->tuneForLLDB(); } dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag(dwarf::Tag Tag) const { Index: llvm/test/DebugInfo/MIR/X86/call-site-gnu-vs-dwarf5-attrs.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/call-site-gnu-vs-dwarf5-attrs.mir +++ llvm/test/DebugInfo/MIR/X86/call-site-gnu-vs-dwarf5-attrs.mir @@ -1,48 +1,54 @@ -# Test the call site encoding in DWARF5 vs GNU extensions. -# -# === DWARF4, tune for gdb === +## Test the call site encoding in DWARF5 vs GNU extensions. + +## === DWARF4, tune for gdb === # RUN: llc -emit-call-site-info -dwarf-version 4 -debugger-tune=gdb -filetype=obj \ # RUN: -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s \ # RUN: | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-GNU -implicit-check-not=DW_AT_call -# + # === DWARF5, tune for gdb === # RUN: llc -dwarf-version 5 -debugger-tune=gdb -emit-call-site-info -filetype=obj \ # RUN: -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s \ # RUN: | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5 -implicit-check-not=DW_AT_call -# -# === DWARF4, tune for lldb === + +## === DWARF4, tune for lldb === # RUN: llc -dwarf-version 4 -debugger-tune=lldb -emit-call-site-info -filetype=obj \ # RUN: -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s \ # RUN: | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5 -implicit-check-not=DW_AT_call -# -# === DWARF5, tune for lldb === + +## === DWARF5, tune for lldb === # RUN: llc -dwarf-version 5 -debugger-tune=lldb -emit-call-site-info -filetype=obj \ # RUN: -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s \ # RUN: | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5 -implicit-check-not=DW_AT_call -# + +## === DWARF4, tune for sce === +# RUN: llc -emit-call-site-info -dwarf-version 4 -filetype=obj -debugger-tune=sce \ +# RUN: -emit-debug-entry-values -debug-entry-values -mtriple=x86_64-unknown-unknown \ +# RUN: -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-GNU + +## === DWARF5, tune for sce === # RUN: llc -emit-call-site-info -dwarf-version 5 -filetype=obj -debugger-tune=sce \ # RUN: -emit-debug-entry-values -debug-entry-values -mtriple=x86_64-unknown-unknown \ # RUN: -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5 -# -# This is based on the following reproducer: -# -# extern void fn(); -# extern void fn2(int x); -# extern int fn3(); -# -# int fn1(int (*fn4) ()) { -# fn(); -# fn2(5); -# -# int x = (*fn4)(); -# if (!x) -# return fn3(); -# else -# return -1; -# } -# -# Check GNU extensions: -# + +## This is based on the following reproducer: +## +## extern void fn(); +## extern void fn2(int x); +## extern int fn3(); +## +## int fn1(int (*fn4) ()) { +## fn(); +## fn2(5); +## +## int x = (*fn4)(); +## if (!x) +## return fn3(); +## else +## return -1; +## } + +## Check GNU extensions: + # CHECK-GNU: DW_TAG_subprogram # CHECK-GNU: DW_AT_GNU_all_call_sites (true) # CHECK-GNU: DW_TAG_GNU_call_site @@ -58,10 +64,9 @@ # CHECK-GNU-NEXT: DW_AT_abstract_origin # CHECK-GNU-NEXT: DW_AT_GNU_tail_call # CHECK-GNU-NEXT: DW_AT_low_pc -# -# -# Check DWARF 5: -# + +## Check DWARF 5: + # CHECK-DWARF5: DW_TAG_subprogram # CHECK-DWARF5: DW_AT_call_all_calls (true) # CHECK-DWARF5: DW_TAG_call_site @@ -80,7 +85,7 @@ # CHECK-DWARF5-NEXT: DW_AT_call_origin # CHECK-DWARF5-NEXT: DW_AT_call_tail_call # CHECK-DWARF5-NEXT: DW_AT_call_pc -# + --- | ; ModuleID = 'call-site-attrs.c' source_filename = "call-site-attrs.c"