Index: llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test +++ llvm/test/tools/llvm-dwarfdump/X86/statistics-dwo.test @@ -72,8 +72,8 @@ CHECK: "version": 7, CHECK: "#functions": 3, CHECK: "#functions with location": 3, -CHECK: "#inlined functions": 7, -CHECK: "#inlined functions with abstract origins": 7, +CHECK: "#inlined functions": 8, +CHECK: "#inlined functions with abstract origins": 8, CHECK: "#unique source variables": 9, CHECK: "#source variables": 30, @@ -82,8 +82,8 @@ 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: "#bytes within functions": 524, +CHECK: "#bytes within inlined functions": 415, CHECK: "#params": 12, CHECK-NEXT: "#params with source location": 12, CHECK-NEXT: "#params with type": 12, Index: llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test +++ llvm/test/tools/llvm-dwarfdump/X86/statistics-v3.test @@ -67,8 +67,8 @@ CHECK: "version": 7, CHECK: "#functions": 3, CHECK: "#functions with location": 3, -CHECK: "#inlined functions": 8, -CHECK: "#inlined functions with abstract origins": 8, +CHECK: "#inlined functions": 9, +CHECK: "#inlined functions with abstract origins": 9, CHECK: "#unique source variables": 9, CHECK: "#source variables": 33, @@ -77,8 +77,8 @@ 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: "#bytes within functions": 566, +CHECK: "#bytes within inlined functions": 458, CHECK: "#params": 13, CHECK-NEXT: "#params with source location": 13, CHECK-NEXT: "#params with type": 13, Index: llvm/tools/llvm-dwarfdump/Statistics.cpp =================================================================== --- llvm/tools/llvm-dwarfdump/Statistics.cpp +++ llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -462,9 +462,15 @@ return; // Handle any kind of lexical scope. - const bool IsFunction = Tag == dwarf::DW_TAG_subprogram; + const bool HasAbstractOriginAttr = + Die.find(dwarf::DW_AT_abstract_origin) != None; + const bool IsFunction = + ((Tag == dwarf::DW_TAG_subprogram) && !HasAbstractOriginAttr); const bool IsBlock = Tag == dwarf::DW_TAG_lexical_block; - const bool IsInlinedFunction = Tag == dwarf::DW_TAG_inlined_subroutine; + const bool IsInlinedFunction = + (Tag == dwarf::DW_TAG_inlined_subroutine || + (Tag == dwarf::DW_TAG_subprogram && HasAbstractOriginAttr)); + InlinedVarsTy InlinedVars; // Get the vars of the inlined fn, so the locstats // reports the missing vars (with coverage 0%).