[llvm-dwarfdump] Avoid possible div-by-zero in debug output
This commit is contained in:
parent
e81f566de6
commit
e5c1a908b3
|
@ -1044,14 +1044,19 @@ bool dwarfdump::collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue