[llvm] [DebugInfo] Add clang flag to enable function-level debug line attribution (PR #93985)

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 07:45:59 PDT 2024


================
@@ -0,0 +1,68 @@
+; RUN: llc -mtriple=i686-w64-mingw32 -o %t -filetype=obj %s
+; RUN: llvm-dwarfdump -v -all %t | FileCheck %s -check-prefix=NO_STMT_SEQ
+
+; RUN: llc -mtriple=i686-w64-mingw32 -o %t -filetype=obj %s -emit-func-debug-line-table-offsets
+; RUN: llvm-dwarfdump -v -all %t | FileCheck %s -check-prefix=STMT_SEQ
+
+; NO_STMT_SEQ-NOT:      DW_AT_META_stmt_sequence
+
+; STMT_SEQ:   [2] DW_TAG_subprogram
+; STMT_SEQ:  	       DW_AT_META_stmt_sequence    DW_FORM_sec_offset
+; STMT_SEQ:   DW_TAG_subprogram [2]
+; STMT_SEQ:       DW_AT_META_stmt_sequence [DW_FORM_sec_offset]	(0x00000028)
+; STMT_SEQ:   DW_AT_name {{.*}}func01
+; STMT_SEQ:   DW_TAG_subprogram [2]
+; STMT_SEQ:       DW_AT_META_stmt_sequence [DW_FORM_sec_offset]	(0x00000038)
+; STMT_SEQ:   DW_AT_name {{.*}}main
----------------
pogo59 wrote:

The test verifies that the new attribute is emitted and points.... somewhere. It also needs to look at the line table, to show (a) the reference is to the right place, and (b) the extra end_sequence is emitted in the right place.

https://github.com/llvm/llvm-project/pull/93985


More information about the llvm-commits mailing list