diff --git a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll @@ -1,88 +1,94 @@ ; RUN: llc -debug-entry-values %s -o - -filetype=obj \ ; RUN: | llvm-dwarfdump -statistics - | FileCheck %s -; CHECK: "sum_all_variables(#bytes in parent scope covered by DW_OP_entry_value)":5 -; CHECK: "sum_all_params(#bytes in parent scope)":20 -; CHECK: "sum_all_params(#bytes in parent scope covered by DW_AT_location)":20 -; CHECK: "sum_all_params(#bytes in parent scope covered by DW_OP_entry_value)":5 -; CHECK: "sum_all_local_vars(#bytes in parent scope)":90 -; CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)":60 -; CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_OP_entry_value)":0 -; CHECK: "#variables processed by location statistics":6 -; CHECK: "#variables with 0% of parent scope covered by DW_AT_location":1 -; CHECK: "#variables with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [50%,60%) of parent scope covered by DW_AT_location":1 -; CHECK: "#variables with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with [80%,90%) of parent scope covered by DW_AT_location":1 -; CHECK: "#variables with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables with 100% of parent scope covered by DW_AT_location":3 -; CHECK: "#variables - entry values with 0% of parent scope covered by DW_AT_location":1 -; CHECK: "#variables - entry values with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [50%,60%) of parent scope covered by DW_AT_location":2 -; CHECK: "#variables - entry values with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with [80%,90%) of parent scope covered by DW_AT_location":1 -; CHECK: "#variables - entry values with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#variables - entry values with 100% of parent scope covered by DW_AT_location":2 -; CHECK: "#params processed by location statistics":2 -; CHECK: "#params with 0% of parent scope covered by DW_AT_location":0 -; CHECK: "#params with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [50%,60%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [80%,90%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params with 100% of parent scope covered by DW_AT_location":2 -; CHECK: "#params - entry values with 0% of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [50%,60%) of parent scope covered by DW_AT_location":1 -; CHECK: "#params - entry values with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [80%,90%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#params - entry values with 100% of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars processed by location statistics":4 -; CHECK: "#local vars with 0% of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [50%,60%) of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with [80%,90%) of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars with 100% of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars - entry values with 0% of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars - entry values with (0%,10%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [10%,20%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [20%,30%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [30%,40%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [40%,50%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [50%,60%) of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars - entry values with [60%,70%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [70%,80%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with [80%,90%) of parent scope covered by DW_AT_location":1 -; CHECK: "#local vars - entry values with [90%,100%) of parent scope covered by DW_AT_location":0 -; CHECK: "#local vars - entry values with 100% of parent scope covered by DW_AT_location":1 +; CHECK: "sum_all_variables(#bytes in parent scope covered by DW_OP_entry_value)": 5, +; CHECK-NEXT: "sum_all_params(#bytes in parent scope)": 20, +; CHECK-NEXT: "sum_all_params(#bytes in parent scope covered by DW_AT_location)": 20, +; CHECK-NEXT: "sum_all_params(#bytes in parent scope covered by DW_OP_entry_value)": 5, +; CHECK-NEXT: "sum_all_local_vars(#bytes in parent scope)": 90, +; CHECK-NEXT: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": 60, +; CHECK-NEXT: "sum_all_local_vars(#bytes in parent scope covered by DW_OP_entry_value)": 0, +; CHECK-NEXT: "#bytes within functions": 45, +; CHECK-NEXT: "#bytes within inlined functions": 0, +; CHECK-NEXT: "#params": 2, +; CHECK-NEXT: "#params with source location": 2, +; CHECK-NEXT: "#params with type": 2, +; CHECK-NEXT: "#params with binary location": 2, +; CHECK: "#variables processed by location statistics": 6, +; CHECK-NEXT: "#variables with 0% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#variables with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [50%,60%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#variables with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with [80%,90%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#variables with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables with 100% of parent scope covered by DW_AT_location": 3, +; CHECK-NEXT: "#variables - entry values with 0% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#variables - entry values with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [50%,60%) of parent scope covered by DW_AT_location": 2, +; CHECK-NEXT: "#variables - entry values with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with [80%,90%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#variables - entry values with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#variables - entry values with 100% of parent scope covered by DW_AT_location": 2, +; CHECK-NEXT: "#params processed by location statistics": 2, +; CHECK-NEXT: "#params with 0% of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [50%,60%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [80%,90%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params with 100% of parent scope covered by DW_AT_location": 2, +; CHECK-NEXT: "#params - entry values with 0% of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [50%,60%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#params - entry values with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [80%,90%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#params - entry values with 100% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars processed by location statistics": 4, +; CHECK-NEXT: "#local vars with 0% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [50%,60%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with [80%,90%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars with 100% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars - entry values with 0% of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars - entry values with (0%,10%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [10%,20%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [20%,30%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [30%,40%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [40%,50%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [50%,60%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars - entry values with [60%,70%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [70%,80%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with [80%,90%) of parent scope covered by DW_AT_location": 1, +; CHECK-NEXT: "#local vars - entry values with [90%,100%) of parent scope covered by DW_AT_location": 0, +; CHECK-NEXT: "#local vars - entry values with 100% of parent scope covered by DW_AT_location": 1 ; The source code of the test case: ; extern void fn3(int *); diff --git a/llvm/test/tools/llvm-dwarfdump/X86/statistics-base-address.s b/llvm/test/tools/llvm-dwarfdump/X86/statistics-base-address.s --- a/llvm/test/tools/llvm-dwarfdump/X86/statistics-base-address.s +++ b/llvm/test/tools/llvm-dwarfdump/X86/statistics-base-address.s @@ -5,8 +5,8 @@ # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o %t # RUN: llvm-dwarfdump --statistics %t | FileCheck %s -# CHECK: "sum_all_local_vars(#bytes in parent scope)":12 -# CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)":8 +# CHECK: "sum_all_local_vars(#bytes in parent scope)": 12, +# CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": 8, .text diff --git a/llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test b/llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test --- a/llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test +++ b/llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test @@ -69,28 +69,28 @@ # } # -CHECK: "version":5 -CHECK: "#functions":3 -CHECK: "#functions with location":3 -CHECK: "#inlined functions":7 -CHECK: "#inlined functions with abstract origins":7 -CHECK: "#unique source variables":9 -CHECK: "#source variables":30 +CHECK: "version": 5, +CHECK: "#functions": 3, +CHECK: "#functions with location": 3, +CHECK: "#inlined functions": 7, +CHECK: "#inlined functions with abstract origins": 7, +CHECK: "#unique source variables": 9, +CHECK: "#source variables": 30, # Ideally the value below would be 33 but currently it's not. -CHECK: "#source variables with location":22 -CHECK: "#call site entries":7 -CHECK: "sum_all_variables(#bytes in parent scope)":2817 -CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)":1160 -CHECK: "#bytes within functions":594 -CHECK: "#bytes within inlined functions":345 -CHECK: "#params":12 -CHECK: "#params with source location":12 -CHECK: "#params with type":12 -CHECK: "#params with binary location":12 -CHECK: "#local vars":18 -CHECK: "#local vars with source location":18 -CHECK: "#local vars with type":18 +CHECK: "#source variables with location": 22, +CHECK: "#call site entries": 7, +CHECK: "sum_all_variables(#bytes in parent scope)": 2817, +CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1160, +CHECK: "#bytes within functions": 594, +CHECK: "#bytes within inlined functions": 345, +CHECK: "#params": 12, +CHECK-NEXT: "#params with source location": 12, +CHECK-NEXT: "#params with type": 12, +CHECK-NEXT: "#params with binary location": 12, +CHECK-NEXT: "#local vars": 18, +CHECK-NEXT: "#local vars with source location": 18, +CHECK-NEXT: "#local vars with type": 18, # Ideally the value below would be 18, but currently it's not. -CHECK: "#local vars with binary location":10 +CHECK: "#local vars with binary location": 10, diff --git a/llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test b/llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test --- a/llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test +++ b/llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test @@ -64,28 +64,28 @@ # } # -CHECK: "version":5 -CHECK: "#functions":3 -CHECK: "#functions with location":3 -CHECK: "#inlined functions":8 -CHECK: "#inlined functions with abstract origins":8 -CHECK: "#unique source variables":9 -CHECK: "#source variables":33 +CHECK: "version": 5, +CHECK: "#functions": 3, +CHECK: "#functions with location": 3, +CHECK: "#inlined functions": 8, +CHECK: "#inlined functions with abstract origins": 8, +CHECK: "#unique source variables": 9, +CHECK: "#source variables": 33, # Ideally the value below would be 33 but currently it's not. -CHECK: "#source variables with location":24 -CHECK: "#call site entries":8 -CHECK: "sum_all_variables(#bytes in parent scope)":3072 -CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)":1188 -CHECK: "#bytes within functions":636 -CHECK: "#bytes within inlined functions":388 -CHECK: "#params":13 -CHECK: "#params with source location":13 -CHECK: "#params with type":13 -CHECK: "#params with binary location":13 -CHECK: "#local vars":20 -CHECK: "#local vars with source location":20 -CHECK: "#local vars with type":20 +CHECK: "#source variables with location": 24, +CHECK: "#call site entries": 8, +CHECK: "sum_all_variables(#bytes in parent scope)": 3072, +CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 1188, +CHECK: "#bytes within functions": 636, +CHECK: "#bytes within inlined functions": 388, +CHECK: "#params": 13, +CHECK-NEXT: "#params with source location": 13, +CHECK-NEXT: "#params with type": 13, +CHECK-NEXT: "#params with binary location": 13, +CHECK-NEXT: "#local vars": 20, +CHECK-NEXT: "#local vars with source location": 20, +CHECK-NEXT: "#local vars with type": 20, # Ideally the value below would be 20, but currently it's not. -CHECK: "#local vars with binary location":11 +CHECK-NEXT: "#local vars with binary location": 11, diff --git a/llvm/test/tools/llvm-dwarfdump/X86/statistics.ll b/llvm/test/tools/llvm-dwarfdump/X86/statistics.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/statistics.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/statistics.ll @@ -1,6 +1,6 @@ ; RUN: llc -O0 %s -o - -filetype=obj \ ; RUN: | llvm-dwarfdump -statistics - | FileCheck %s -; CHECK: "version":5 +; CHECK: "version": 5, ; namespace test { ; extern int a; @@ -41,24 +41,24 @@ ; - non-constant member S:fn, ; - arguments of S:fn. -; CHECK: "#unique source variables":10 +; CHECK: "#unique source variables": 10, ; +1 extra inline i. -; CHECK: "#source variables":11 +; CHECK: "#source variables": 11, ; -1 square::i -; CHECK: "#source variables with location":10 -; CHECK: "sum_all_local_vars(#bytes in parent scope)":[[BYTES:[0-9]+]] +; CHECK: "#source variables with location": 10, +; CHECK: "sum_all_local_vars(#bytes in parent scope)": [[BYTES:[0-9]+]] ; Because of the dbg.value in the middle of the function, the pc range coverage ; must be below 100%. -; CHECK-NOT: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)":0 -; CHECK-NOT: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)":[[BYTES]] -; CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": -; CHECK: "#bytes within functions":[[FUNCSIZE:[0-9]+]] -; CHECK: "#bytes within inlined functions":[[INLINESIZE:[0-9]+]] -; CHECK: "#bytes in __debug_info":459 -; CHECK: "#bytes in __debug_loc":35 -; CHECK: "#bytes in __debug_abbrev":384 -; CHECK: "#bytes in __debug_line":126 -; CHECK: "#bytes in __debug_str":231 +; CHECK-NOT: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": 0, +; CHECK-NOT: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": [[BYTES]] +; CHECK: "sum_all_local_vars(#bytes in parent scope covered by DW_AT_location)": +; CHECK: "#bytes within functions": [[FUNCSIZE:[0-9]+]] +; CHECK: "#bytes within inlined functions": [[INLINESIZE:[0-9]+]] +; CHECK: "#bytes in __debug_info": 459, +; CHECK-NEXT: "#bytes in __debug_loc": 35, +; CHECK-NEXT: "#bytes in __debug_abbrev": 384, +; CHECK-NEXT: "#bytes in __debug_line": 126, +; CHECK-NEXT: "#bytes in __debug_str": 231, ; ModuleID = '/tmp/quality.cpp' source_filename = "/tmp/quality.cpp" diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll @@ -12,8 +12,8 @@ ; foo(&local1, arg2, 10, 15, arg3 + 3, arg1 + arg2); ; } ; -; CHECK: "#call site DIEs":2 -; CHECK-SAME: "#call site parameter DIEs":6 +; CHECK: "#call site DIEs": 2, +; CHECK-NEXT: "#call site parameter DIEs": 6, ; ; ModuleID = 'test.c' source_filename = "test.c" diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-multi-cu.ll @@ -3,11 +3,11 @@ ; Test that abstract origins in multiple CUs are uniqued. -; CHECK: "#functions":4, -; CHECK-SAME: "#inlined functions":2, -; CHECK-SAME: "#unique source variables":4 -; CHECK-SAME: "#source variables":6 -; CHECK-SAME: "#source variables with location":6 +; CHECK: "#functions": 4, +; CHECK: "#inlined functions": 2, +; CHECK: "#unique source variables": 4, +; CHECK-NEXT: "#source variables": 6, +; CHECK-NEXT: "#source variables with location": 6, ;header.h: ;extern "C" int getchar(); diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-inlining-single-cu.ll @@ -4,11 +4,11 @@ ; This test serves as a baseline / sanity-check for stats-inlining-multi-cu.ll ; The results for both tests should be identical. -; CHECK: "#functions":4, -; CHECK-SAME: "#inlined functions":2, -; CHECK-SAME: "#unique source variables":4 -; CHECK-SAME: "#source variables":6 -; CHECK-SAME: "#source variables with location":6 +; CHECK: "#functions": 4, +; CHECK: "#inlined functions": 2, +; CHECK: "#unique source variables": 4, +; CHECK-NEXT: "#source variables": 6, +; CHECK-NEXT: "#source variables with location": 6, ;header.h: ;extern "C" int getchar(); diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-mulitple-cu-out-of-line.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-mulitple-cu-out-of-line.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-mulitple-cu-out-of-line.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-mulitple-cu-out-of-line.ll @@ -18,12 +18,13 @@ ; #include "test.h" ; int far() { return foo(42); } -; CHECK: "#functions":3 -; CHECK-SAME: "#functions with location":3 -; CHECK-SAME: "#inlined functions":0 -; CHECK-SAME: "#unique source variables":1 -; CHECK-SAME: "#source variables":2 -; CHECK-SAME: "#source variables with location":2 +; CHECK: "#functions": 3, +; CHECK-NEXT: "#functions with location": 3, +; CHECK-NEXT: "#inlined functions": 0, +; CHECK-NEXT: "#inlined functions with abstract origins": 0, +; CHECK-NEXT: "#unique source variables": 1, +; CHECK-NEXT: "#source variables": 2, +; CHECK-NEXT: "#source variables with location": 2, target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-members.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-members.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-members.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-members.ll @@ -16,8 +16,8 @@ ; #include "test.h" ; s S2; -; CHECK: "#source variables":4 -; CHECK-SAME: "#source variables with location":4 +; CHECK: "#source variables": 4, +; CHECK: "#source variables with location": 4, source_filename = "llvm-link" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-same-name.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-same-name.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-same-name.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-multiple-cu-same-name.ll @@ -3,9 +3,9 @@ ; Test that statistics distinguish functions with the same name. -; CHECK: "#functions":4, -; CHECK-SAME: "#unique source variables":2 -; CHECK-SAME: "#source variables":2 +; CHECK: "#functions": 4, +; CHECK: "#unique source variables": 2, +; CHECK-NEXT: "#source variables": 2, ; $ cat test1.cpp ; static int foo(int a) { diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp --- a/llvm/tools/llvm-dwarfdump/Statistics.cpp +++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -593,7 +593,7 @@ // Print summary. OS.SetBufferSize(1024); - json::OStream J(OS); + json::OStream J(OS, 2); J.objectBegin(); J.attribute("version", Version); LLVM_DEBUG(llvm::dbgs() << "Variable location quality metrics\n";