Index: llvm/test/tools/llvm-dwarfdump/X86/locstats-big-number-of-bytes.yaml =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dwarfdump/X86/locstats-big-number-of-bytes.yaml @@ -0,0 +1,92 @@ +# RUN: yaml2obj %s | llvm-dwarfdump --statistics - | FileCheck %s + +## Check that we are covering the situation when +## sum of bytes in scope is a huge (uint64_t) number. +## +## The yaml represents this DWARF: +## +## DW_TAG_compile_unit +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0x000000000000000b) +## +## DW_TAG_subprogram +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0x00000000ffffffff) +## DW_TAG_variable +## DW_AT_location (0x00000023: +## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX) +## DW_TAG_subprogram +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0x00000000ffffffff) +## DW_TAG_variable +## DW_AT_location (0x00000023: +## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX) + +# CHECK: "version": 9, +# CHECK: "sum_all_variables(#bytes in parent scope)": 8589934590 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 +Sections: + - Name: .debug_loc + Type: SHT_PROGBITS + AddressAlign: 0x01 + Content: '00000000000000000600000000000000010055000000000000000000000000000000000300000000000000050000000000000001005200000000000000000000000000000000' + - Name: .debug_ranges + Type: SHT_PROGBITS + AddressAlign: 0x01 + Content: '000000000000000003000000000000000500000000000000080000000000000000000000000000000000000000000000' +DWARF: + debug_abbrev: + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data4 + - Code: 3 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_sec_offset + debug_info: + - Version: 4 + AbbrOffset: 0x00 + Entries: + - AbbrCode: 1 ## DW_TAG_compile_unit + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0x0b ## DW_AT_high_pc + - AbbrCode: 2 ## DW_TAG_subprogram + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0xFFFFFFFF ## DW_AT_high_pc + - AbbrCode: 3 ## DW_TAG_variable + Values: + - Value: 0x23 ## DW_AT_sec_offset + - AbbrCode: 0 ## NULL + - AbbrCode: 2 ## DW_TAG_subprogram + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0xFFFFFFFF ## DW_AT_high_pc + - AbbrCode: 3 ## DW_TAG_variable + Values: + - Value: 0x23 ## DW_AT_sec_offset + - AbbrCode: 0 ## NULL + - AbbrCode: 0 ## NULL Index: llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml @@ -0,0 +1,91 @@ +# REQUIRES: asserts +# RUN: yaml2obj %s | not --crash llvm-dwarfdump --statistics - -o /dev/null %s 2>&1 | FileCheck %s + +## Check that we are covering the situation when a stat field overflows. +## +## The yaml represents this DWARF: +## +## DW_TAG_compile_unit +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0x000000000000000b) +## +## DW_TAG_subprogram +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0xffffffffffffffff) +## DW_TAG_variable +## DW_AT_location (0x00000023: +## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX) +## DW_TAG_subprogram +## DW_AT_low_pc (0x0000000000000000) +## DW_AT_high_pc (0xffffffffffffffff) +## DW_TAG_variable +## DW_AT_location (0x00000023: +## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX) + +# CHECK: Stat field overflow + +--- !ELF +FileHeader: + Class: ELFCLASS[[BITS=64]] + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 +Sections: + - Name: .debug_loc + Type: SHT_PROGBITS + AddressAlign: 0x01 + Content: '00000000000000000600000000000000010055000000000000000000000000000000000300000000000000050000000000000001005200000000000000000000000000000000' + - Name: .debug_ranges + Type: SHT_PROGBITS + AddressAlign: 0x01 + Content: '000000000000000003000000000000000500000000000000080000000000000000000000000000000000000000000000' +DWARF: + debug_abbrev: + - Table: + - Code: 1 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data8 + - Code: 2 + Tag: DW_TAG_subprogram + Children: DW_CHILDREN_yes + Attributes: + - Attribute: DW_AT_low_pc + Form: DW_FORM_addr + - Attribute: DW_AT_high_pc + Form: DW_FORM_data8 + - Code: 3 + Tag: DW_TAG_variable + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_location + Form: DW_FORM_sec_offset + debug_info: + - Version: 4 + AbbrOffset: 0x00 + Entries: + - AbbrCode: 1 ## DW_TAG_compile_unit + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0x0b ## DW_AT_high_pc + - AbbrCode: 2 ## DW_TAG_subprogram + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0xFFFFFFFFFFFFFFFF ## DW_AT_high_pc + - AbbrCode: 3 ## DW_TAG_variable + Values: + - Value: 0x23 ## DW_AT_sec_offset + - AbbrCode: 0 ## NULL + - AbbrCode: 2 ## DW_TAG_subprogram + Values: + - Value: 0x00 ## DW_AT_low_pc + - Value: 0xFFFFFFFFFFFFFFFF ## DW_AT_high_pc + - AbbrCode: 3 ## DW_TAG_variable + Values: + - Value: 0x23 ## DW_AT_sec_offset + - AbbrCode: 0 ## NULL + - AbbrCode: 0 ## NULL Index: llvm/test/tools/llvm-dwarfdump/X86/locstats-for-absctract-origin-vars.yaml =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/locstats-for-absctract-origin-vars.yaml +++ llvm/test/tools/llvm-dwarfdump/X86/locstats-for-absctract-origin-vars.yaml @@ -120,7 +120,7 @@ ## DW_TAG_subprogram ## DW_AT_abstract_origin (0x000000f0) -# CHECK: "version": 8, +# CHECK: "version": 9, # CHECK: "#variables processed by location statistics": 17, # CHECK: "#variables with 0% of parent scope covered by DW_AT_location": 13, # CHECK: "#variables with 100% of parent scope covered by DW_AT_location": 4, 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 @@ -69,7 +69,7 @@ # } # -CHECK: "version": 8, +CHECK: "version": 9, CHECK: "#functions": 3, CHECK: "#functions with location": 3, CHECK: "#inlined functions": 7, 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 @@ -64,7 +64,7 @@ # } # -CHECK: "version": 8, +CHECK: "version": 9, CHECK: "#functions": 3, CHECK: "#functions with location": 3, CHECK: "#inlined functions": 8, Index: llvm/test/tools/llvm-dwarfdump/X86/statistics.ll =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/statistics.ll +++ 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": 8, +; CHECK: "version": 9, ; namespace test { ; extern int a; Index: llvm/test/tools/llvm-dwarfdump/X86/stats-scope-bytes-covered.yaml =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/stats-scope-bytes-covered.yaml +++ llvm/test/tools/llvm-dwarfdump/X86/stats-scope-bytes-covered.yaml @@ -33,7 +33,7 @@ ## DW_AT_location (0x00000023: ## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX) -# CHECK: "version": 8, +# CHECK: "version": 9, # CHECK: "sum_all_variables(#bytes in parent scope)": 12, # CHECK: "sum_all_variables(#bytes in any scope covered by DW_AT_location)": 8 # CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 4 Index: llvm/tools/llvm-dwarfdump/Statistics.cpp =================================================================== --- llvm/tools/llvm-dwarfdump/Statistics.cpp +++ llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -36,22 +36,63 @@ /// This represents function DIE offsets containing an abstract_origin. using FunctionsWithAbstractOriginTy = llvm::SmallVector; +/// This represents a data type for the stats and it helps us to +/// detect an overflow. +/// NOTE: This can be implemented as a template if there is an another type +/// needing this. +struct SaturatingUINT64 { + /// Number that represents the stats. + uint64_t Value; + + SaturatingUINT64(uint64_t Value_) : Value(Value_) {} + + void operator++(int) { + if (!IsOverflow) { + if (Value <= UINT64_MAX - 1) { + ++Value; + } else { + WithColor::warning(errs(), "llvm-dwarfdump --statistics") + << "A stat field overflow.\n"; + Value = UINT64_MAX; + IsOverflow = true; + } + } + assert(!IsOverflow && "Stat field overflow"); + } + void operator+=(uint64_t Value_) { + if (!IsOverflow) { + if (Value <= UINT64_MAX - Value_) + Value += Value_; + else { + WithColor::warning(errs(), "llvm-dwarfdump --statistics") + << "A stat field overflow.\n"; + Value = UINT64_MAX; + IsOverflow = true; + } + } + assert(!IsOverflow && "Stat field overflow"); + } + + /// Indicate if there is an overflow. + bool IsOverflow = false; +}; + /// Holds statistics for one function (or other entity that has a PC range and /// contains variables, such as a compile unit). struct PerFunctionStats { /// Number of inlined instances of this function. - unsigned NumFnInlined = 0; + uint64_t NumFnInlined = 0; /// Number of out-of-line instances of this function. - unsigned NumFnOutOfLine = 0; + uint64_t NumFnOutOfLine = 0; /// Number of inlined instances that have abstract origins. - unsigned NumAbstractOrigins = 0; + uint64_t NumAbstractOrigins = 0; /// Number of variables and parameters with location across all inlined /// instances. - unsigned TotalVarWithLoc = 0; + uint64_t TotalVarWithLoc = 0; /// Number of constants with location across all inlined instances. - unsigned ConstantMembers = 0; + uint64_t ConstantMembers = 0; /// Number of arificial variables, parameters or members across all instances. - unsigned NumArtificial = 0; + uint64_t NumArtificial = 0; /// List of all Variables and parameters in this function. StringSet<> VarsInFunction; /// Compile units also cover a PC range, but have this flag set to false. @@ -59,63 +100,63 @@ /// Function has source location information. bool HasSourceLocation = false; /// Number of function parameters. - unsigned NumParams = 0; + uint64_t NumParams = 0; /// Number of function parameters with source location. - unsigned NumParamSourceLocations = 0; + uint64_t NumParamSourceLocations = 0; /// Number of function parameters with type. - unsigned NumParamTypes = 0; + uint64_t NumParamTypes = 0; /// Number of function parameters with a DW_AT_location. - unsigned NumParamLocations = 0; + uint64_t NumParamLocations = 0; /// Number of local variables. - unsigned NumLocalVars = 0; + uint64_t NumLocalVars = 0; /// Number of local variables with source location. - unsigned NumLocalVarSourceLocations = 0; + uint64_t NumLocalVarSourceLocations = 0; /// Number of local variables with type. - unsigned NumLocalVarTypes = 0; + uint64_t NumLocalVarTypes = 0; /// Number of local variables with DW_AT_location. - unsigned NumLocalVarLocations = 0; + uint64_t NumLocalVarLocations = 0; }; /// Holds accumulated global statistics about DIEs. struct GlobalStats { /// Total number of PC range bytes covered by DW_AT_locations. - unsigned TotalBytesCovered = 0; + SaturatingUINT64 TotalBytesCovered = 0; /// Total number of parent DIE PC range bytes covered by DW_AT_Locations. - unsigned ScopeBytesCovered = 0; + SaturatingUINT64 ScopeBytesCovered = 0; /// Total number of PC range bytes in each variable's enclosing scope. - unsigned ScopeBytes = 0; + SaturatingUINT64 ScopeBytes = 0; /// Total number of PC range bytes covered by DW_AT_locations with /// the debug entry values (DW_OP_entry_value). - unsigned ScopeEntryValueBytesCovered = 0; + SaturatingUINT64 ScopeEntryValueBytesCovered = 0; /// Total number of PC range bytes covered by DW_AT_locations of /// formal parameters. - unsigned ParamScopeBytesCovered = 0; + SaturatingUINT64 ParamScopeBytesCovered = 0; /// Total number of PC range bytes in each parameter's enclosing scope. - unsigned ParamScopeBytes = 0; + SaturatingUINT64 ParamScopeBytes = 0; /// Total number of PC range bytes covered by DW_AT_locations with /// the debug entry values (DW_OP_entry_value) (only for parameters). - unsigned ParamScopeEntryValueBytesCovered = 0; + SaturatingUINT64 ParamScopeEntryValueBytesCovered = 0; /// Total number of PC range bytes covered by DW_AT_locations (only for local /// variables). - unsigned LocalVarScopeBytesCovered = 0; + SaturatingUINT64 LocalVarScopeBytesCovered = 0; /// Total number of PC range bytes in each local variable's enclosing scope. - unsigned LocalVarScopeBytes = 0; + SaturatingUINT64 LocalVarScopeBytes = 0; /// Total number of PC range bytes covered by DW_AT_locations with /// the debug entry values (DW_OP_entry_value) (only for local variables). - unsigned LocalVarScopeEntryValueBytesCovered = 0; + SaturatingUINT64 LocalVarScopeEntryValueBytesCovered = 0; /// Total number of call site entries (DW_AT_call_file & DW_AT_call_line). - unsigned CallSiteEntries = 0; + SaturatingUINT64 CallSiteEntries = 0; /// Total number of call site DIEs (DW_TAG_call_site). - unsigned CallSiteDIEs = 0; + SaturatingUINT64 CallSiteDIEs = 0; /// Total number of call site parameter DIEs (DW_TAG_call_site_parameter). - unsigned CallSiteParamDIEs = 0; + SaturatingUINT64 CallSiteParamDIEs = 0; /// Total byte size of concrete functions. This byte size includes /// inline functions contained in the concrete functions. - unsigned FunctionSize = 0; + SaturatingUINT64 FunctionSize = 0; /// Total byte size of inlined functions. This is the total number of bytes /// for the top inline functions within concrete functions. This can help /// tune the inline settings when compiling to match user expectations. - unsigned InlineFunctionSize = 0; + SaturatingUINT64 InlineFunctionSize = 0; }; /// Holds accumulated debug location statistics about local variables and @@ -126,37 +167,37 @@ /// of variables with the no debug location at all, but the last element /// in the vector represents the number of fully covered variables within /// its scope. - std::vector VarParamLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector VarParamLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// Map non debug entry values coverage. - std::vector VarParamNonEntryValLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector VarParamNonEntryValLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// The debug location statistics for formal parameters. - std::vector ParamLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector ParamLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// Map non debug entry values coverage for formal parameters. - std::vector ParamNonEntryValLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector ParamNonEntryValLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// The debug location statistics for local variables. - std::vector LocalVarLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector LocalVarLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// Map non debug entry values coverage for local variables. - std::vector LocalVarNonEntryValLocStats{ - std::vector(NumOfCoverageCategories, 0)}; + std::vector LocalVarNonEntryValLocStats{ + std::vector(NumOfCoverageCategories, 0)}; /// Total number of local variables and function parameters processed. - unsigned NumVarParam = 0; + uint64_t NumVarParam = 0; /// Total number of formal parameters processed. - unsigned NumParam = 0; + uint64_t NumParam = 0; /// Total number of local variables processed. - unsigned NumVar = 0; + uint64_t NumVar = 0; }; } // namespace /// Collect debug location statistics for one DIE. static void collectLocStats(uint64_t ScopeBytesCovered, uint64_t BytesInScope, - std::vector &VarParamLocStats, - std::vector &ParamLocStats, - std::vector &LocalVarLocStats, + std::vector &VarParamLocStats, + std::vector &ParamLocStats, + std::vector &LocalVarLocStats, bool IsParam, bool IsLocalVar) { auto getCoverageBucket = [ScopeBytesCovered, BytesInScope]() -> unsigned { // No debug location at all for the variable. @@ -389,7 +430,7 @@ GlobalStats.LocalVarScopeEntryValueBytesCovered += BytesEntryValuesCovered; } - assert(GlobalStats.ScopeBytesCovered <= GlobalStats.ScopeBytes); + assert(GlobalStats.ScopeBytesCovered.Value <= GlobalStats.ScopeBytes.Value); } if (IsConstantMember) { @@ -608,7 +649,7 @@ } static void printLocationStats(json::OStream &J, const char *Key, - std::vector &LocationStats) { + std::vector &LocationStats) { J.attribute( (Twine(Key) + " with 0% of parent scope covered by DW_AT_location").str(), LocationStats[0]); @@ -750,31 +791,31 @@ /// The version number should be increased every time the algorithm is changed /// (including bug fixes). New metrics may be added without increasing the /// version. - unsigned Version = 8; - unsigned VarParamTotal = 0; - unsigned VarParamUnique = 0; - unsigned VarParamWithLoc = 0; - unsigned NumFunctions = 0; - unsigned NumInlinedFunctions = 0; - unsigned NumFuncsWithSrcLoc = 0; - unsigned NumAbstractOrigins = 0; - unsigned ParamTotal = 0; - unsigned ParamWithType = 0; - unsigned ParamWithLoc = 0; - unsigned ParamWithSrcLoc = 0; - unsigned LocalVarTotal = 0; - unsigned LocalVarWithType = 0; - unsigned LocalVarWithSrcLoc = 0; - unsigned LocalVarWithLoc = 0; + unsigned Version = 9; + uint64_t VarParamTotal = 0; + uint64_t VarParamUnique = 0; + uint64_t VarParamWithLoc = 0; + uint64_t NumFunctions = 0; + uint64_t NumInlinedFunctions = 0; + uint64_t NumFuncsWithSrcLoc = 0; + uint64_t NumAbstractOrigins = 0; + uint64_t ParamTotal = 0; + uint64_t ParamWithType = 0; + uint64_t ParamWithLoc = 0; + uint64_t ParamWithSrcLoc = 0; + uint64_t LocalVarTotal = 0; + uint64_t LocalVarWithType = 0; + uint64_t LocalVarWithSrcLoc = 0; + uint64_t LocalVarWithLoc = 0; for (auto &Entry : Statistics) { PerFunctionStats &Stats = Entry.getValue(); - unsigned TotalVars = Stats.VarsInFunction.size() * + uint64_t TotalVars = Stats.VarsInFunction.size() * (Stats.NumFnInlined + Stats.NumFnOutOfLine); // Count variables in global scope. if (!Stats.IsFunction) TotalVars = Stats.NumLocalVars + Stats.ConstantMembers + Stats.NumArtificial; - unsigned Constants = Stats.ConstantMembers; + uint64_t Constants = Stats.ConstantMembers; VarParamWithLoc += Stats.TotalVarWithLoc + Constants; VarParamTotal += TotalVars; VarParamUnique += Stats.VarsInFunction.size(); @@ -816,48 +857,49 @@ printDatum(J, "#source variables", VarParamTotal); printDatum(J, "#source variables with location", VarParamWithLoc); - printDatum(J, "#call site entries", GlobalStats.CallSiteEntries); - printDatum(J, "#call site DIEs", GlobalStats.CallSiteDIEs); - printDatum(J, "#call site parameter DIEs", GlobalStats.CallSiteParamDIEs); + printDatum(J, "#call site entries", GlobalStats.CallSiteEntries.Value); + printDatum(J, "#call site DIEs", GlobalStats.CallSiteDIEs.Value); + printDatum(J, "#call site parameter DIEs", + GlobalStats.CallSiteParamDIEs.Value); printDatum(J, "sum_all_variables(#bytes in parent scope)", - GlobalStats.ScopeBytes); + GlobalStats.ScopeBytes.Value); printDatum(J, "sum_all_variables(#bytes in any scope covered by DW_AT_location)", - GlobalStats.TotalBytesCovered); + GlobalStats.TotalBytesCovered.Value); printDatum(J, "sum_all_variables(#bytes in parent scope covered by " "DW_AT_location)", - GlobalStats.ScopeBytesCovered); + GlobalStats.ScopeBytesCovered.Value); printDatum(J, "sum_all_variables(#bytes in parent scope covered by " "DW_OP_entry_value)", - GlobalStats.ScopeEntryValueBytesCovered); + GlobalStats.ScopeEntryValueBytesCovered.Value); printDatum(J, "sum_all_params(#bytes in parent scope)", - GlobalStats.ParamScopeBytes); + GlobalStats.ParamScopeBytes.Value); printDatum(J, "sum_all_params(#bytes in parent scope covered by DW_AT_location)", - GlobalStats.ParamScopeBytesCovered); + GlobalStats.ParamScopeBytesCovered.Value); printDatum(J, "sum_all_params(#bytes in parent scope covered by " "DW_OP_entry_value)", - GlobalStats.ParamScopeEntryValueBytesCovered); + GlobalStats.ParamScopeEntryValueBytesCovered.Value); printDatum(J, "sum_all_local_vars(#bytes in parent scope)", - GlobalStats.LocalVarScopeBytes); + GlobalStats.LocalVarScopeBytes.Value); printDatum(J, "sum_all_local_vars(#bytes in parent scope covered by " "DW_AT_location)", - GlobalStats.LocalVarScopeBytesCovered); + GlobalStats.LocalVarScopeBytesCovered.Value); printDatum(J, "sum_all_local_vars(#bytes in parent scope covered by " "DW_OP_entry_value)", - GlobalStats.LocalVarScopeEntryValueBytesCovered); + GlobalStats.LocalVarScopeEntryValueBytesCovered.Value); - printDatum(J, "#bytes within functions", GlobalStats.FunctionSize); + printDatum(J, "#bytes within functions", GlobalStats.FunctionSize.Value); printDatum(J, "#bytes within inlined functions", - GlobalStats.InlineFunctionSize); + GlobalStats.InlineFunctionSize.Value); // Print the summary for formal parameters. printDatum(J, "#params", ParamTotal); @@ -901,8 +943,8 @@ << (int)std::round((VarParamWithLoc * 100.0) / VarParamTotal) << "%\n"; llvm::dbgs() << "PC Ranges covered: " - << (int)std::round((GlobalStats.ScopeBytesCovered * 100.0) / - GlobalStats.ScopeBytes) + << (int)std::round((GlobalStats.ScopeBytesCovered.Value * 100.0) / + GlobalStats.ScopeBytes.Value) << "%\n"); return true; }