MaskRay created this revision. MaskRay added reviewers: debug-info, aprantl, dblaikie. Herald added a subscriber: pengfei. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Tested with stage 2 -DCMAKE_BUILD_TYPE=Debug clang, the only difference of .debug_info appears to be: DW_AT_decl_line for the Clang synthesized `__va_list_tag` is now dropped. Depends on D94391 <https://reviews.llvm.org/D94391> Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D94735 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/test/CodeGen/X86/x86_64-arguments.c Index: clang/test/CodeGen/X86/x86_64-arguments.c =================================================================== --- clang/test/CodeGen/X86/x86_64-arguments.c +++ clang/test/CodeGen/X86/x86_64-arguments.c @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=NO-AVX512 -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-feature +avx | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=NO-AVX512 -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-feature +avx512f | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx512f | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX512 #include <stdarg.h> @@ -545,3 +545,6 @@ // AVX: @f65(<8 x float> %{{[^,)]+}}) void f65(struct t65 a0) { } + +/// The synthesized __va_list_tag does not have the line field. +// CHECK: = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__va_list_tag", file: ![[#FILE:]], size: Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -3336,8 +3336,7 @@ // Get overall information about the record type for the debug info. llvm::DIFile *DefUnit = getOrCreateFile(RD->getLocation()); - const unsigned Line = - getLineNumber(RD->getLocation().isValid() ? RD->getLocation() : CurLoc); + const unsigned Line = getLineNumber(RD->getLocation()); StringRef RDName = getClassName(RD); llvm::DIScope *RDContext = getDeclContextDescriptor(RD);
Index: clang/test/CodeGen/X86/x86_64-arguments.c =================================================================== --- clang/test/CodeGen/X86/x86_64-arguments.c +++ clang/test/CodeGen/X86/x86_64-arguments.c @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=NO-AVX512 -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-feature +avx | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=NO-AVX512 -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-feature +avx512f | \ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx512f | \ // RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX512 #include <stdarg.h> @@ -545,3 +545,6 @@ // AVX: @f65(<8 x float> %{{[^,)]+}}) void f65(struct t65 a0) { } + +/// The synthesized __va_list_tag does not have the line field. +// CHECK: = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "__va_list_tag", file: ![[#FILE:]], size: Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -3336,8 +3336,7 @@ // Get overall information about the record type for the debug info. llvm::DIFile *DefUnit = getOrCreateFile(RD->getLocation()); - const unsigned Line = - getLineNumber(RD->getLocation().isValid() ? RD->getLocation() : CurLoc); + const unsigned Line = getLineNumber(RD->getLocation()); StringRef RDName = getClassName(RD); llvm::DIScope *RDContext = getDeclContextDescriptor(RD);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits