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 @@ -1044,14 +1044,19 @@ LocStats.LocalVarNonEntryValLocStats); J.objectEnd(); OS << '\n'; - LLVM_DEBUG(llvm::dbgs() << "Total Availability: " - << (int)std::round((VarParamWithLoc.Value * 100.0) / + LLVM_DEBUG( + llvm::dbgs() << "Total Availability: " + << (VarParamTotal.Value + ? (int)std::round((VarParamWithLoc.Value * 100.0) / VarParamTotal.Value) - << "%\n"; - llvm::dbgs() << "PC Ranges covered: " - << (int)std::round( + : 0) + << "%\n"; + llvm::dbgs() << "PC Ranges covered: " + << (GlobalStats.ScopeBytes.Value + ? (int)std::round( (GlobalStats.ScopeBytesCovered.Value * 100.0) / GlobalStats.ScopeBytes.Value) - << "%\n"); + : 0) + << "%\n"); return true; }