mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
Make llvm-bcanalyzer percentages more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82772 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include "llvm/Bitcode/LLVMBitCodes.h"
|
#include "llvm/Bitcode/LLVMBitCodes.h"
|
||||||
#include "llvm/Bitcode/ReaderWriter.h"
|
#include "llvm/Bitcode/ReaderWriter.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/Format.h"
|
||||||
#include "llvm/Support/ManagedStatic.h"
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include "llvm/Support/PrettyStackTrace.h"
|
#include "llvm/Support/PrettyStackTrace.h"
|
||||||
@@ -546,8 +547,8 @@ static int AnalyzeBitcode() {
|
|||||||
errs() << " Total Size: ";
|
errs() << " Total Size: ";
|
||||||
PrintSize(Stats.NumBits);
|
PrintSize(Stats.NumBits);
|
||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
errs() << " % of file: "
|
double pct = (Stats.NumBits * 100.0) / BufferSizeBits;
|
||||||
<< Stats.NumBits/(double)BufferSizeBits*100 << "\n";
|
errs() << " Percent of file: " << format("%2.4f%%", pct) << "\n";
|
||||||
if (Stats.NumInstances > 1) {
|
if (Stats.NumInstances > 1) {
|
||||||
errs() << " Average Size: ";
|
errs() << " Average Size: ";
|
||||||
PrintSize(Stats.NumBits/(double)Stats.NumInstances);
|
PrintSize(Stats.NumBits/(double)Stats.NumInstances);
|
||||||
@@ -563,9 +564,10 @@ static int AnalyzeBitcode() {
|
|||||||
errs() << " Num Abbrevs: " << Stats.NumAbbrevs << "\n";
|
errs() << " Num Abbrevs: " << Stats.NumAbbrevs << "\n";
|
||||||
errs() << " Num Records: " << Stats.NumRecords << "\n";
|
errs() << " Num Records: " << Stats.NumRecords << "\n";
|
||||||
}
|
}
|
||||||
if (Stats.NumRecords)
|
if (Stats.NumRecords) {
|
||||||
errs() << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/
|
double pct = (Stats.NumAbbreviatedRecords * 100.0) / Stats.NumRecords;
|
||||||
(double)Stats.NumRecords)*100 << "\n";
|
errs() << " Percent Abbrevs: " << format("%2.4f%%", pct) << "\n";
|
||||||
|
}
|
||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
|
|
||||||
// Print a histogram of the codes we see.
|
// Print a histogram of the codes we see.
|
||||||
|
|||||||
Reference in New Issue
Block a user