From 17c4633e7faf76682e7c999576128848b10fb815 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Thu, 1 Feb 2018 11:25:10 +0000 Subject: [DebugInfo] Enable debug information for C99 VLA types Summary: This patch enables debugging of C99 VLA types by generating more precise LLVM Debug metadata, using the extended DISubrange 'count' field that takes a DIVariable. This should implement: Bug 30553: Debug info generated for arrays is not what GDB expects (not as good as GCC's) https://bugs.llvm.org/show_bug.cgi?id=30553 Reviewers: echristo, aprantl, dexonsmith, clayborg, pcc, kristof.beyls, dblaikie Reviewed By: aprantl Subscribers: jholewinski, schweitz, davide, fhahn, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D41698 llvm-svn: 323952 --- clang/test/CodeGenCXX/vla-consruct.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/test/CodeGenCXX/vla-consruct.cpp') diff --git a/clang/test/CodeGenCXX/vla-consruct.cpp b/clang/test/CodeGenCXX/vla-consruct.cpp index fd8314a5d71..87191fe99da 100644 --- a/clang/test/CodeGenCXX/vla-consruct.cpp +++ b/clang/test/CodeGenCXX/vla-consruct.cpp @@ -21,6 +21,8 @@ void test(int n) { // CHECK: define void {{.*test.*}}(i32 [[n:%.+]]) # // CHECK: [[n_addr:%.+]] = alloca // CHECK-NEXT: [[saved_stack:%.+]] = alloca + // CHECK-NEXT: [[vla_expr:%.+]] = alloca i64, align 8 + // CHECK-NEXT: [[vla_expr1:%.+]] = alloca i64, align 8 // CHECK-NEXT: [[sizeof_S:%.+]] = alloca // CHECK-NEXT: [[sizeof_array_t_0_0:%.+]] = alloca // CHECK-NEXT: [[sizeof_array_t_0:%.+]] = alloca @@ -37,6 +39,8 @@ void test(int n) { // CHECK-NEXT: store i8* [[t4]], i8** [[saved_stack]] // CHECK-NEXT: [[t5:%.+]] = mul nuw i64 [[t1]], [[t3]] // CHECK-NEXT: [[vla:%.+]] = alloca [[struct_S]], i64 [[t5]] + // CHECK-NEXT: store i64 [[t1]], i64* [[vla_expr]] + // CHECK-NEXT: store i64 [[t3]], i64* [[vla_expr1]] // CHECK-NEXT: [[t6:%.+]] = mul nuw i64 [[t1]], [[t3]] // CHECK-NEXT: [[isempty:%.+]] = icmp eq i64 [[t6]], 0 // CHECK-NEXT: br i1 [[isempty]], label %[[arrayctor_cont:.+]], label %[[new_ctorloop:.+]] -- cgit v1.2.3