#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
case bitc::FUNC_CODE_INST_INSERTVAL: return "INST_INSERTVAL";
case bitc::FUNC_CODE_INST_CMP2: return "INST_CMP2";
case bitc::FUNC_CODE_INST_VSELECT: return "INST_VSELECT";
+ case bitc::FUNC_CODE_DEBUG_LOC: return "DEBUG_LOC";
+ case bitc::FUNC_CODE_DEBUG_LOC_AGAIN: return "DEBUG_LOC_AGAIN";
}
case bitc::TYPE_SYMTAB_BLOCK_ID:
switch (CodeID) {
default:return 0;
case bitc::METADATA_STRING: return "MDSTRING";
case bitc::METADATA_NODE: return "MDNODE";
+ case bitc::METADATA_FN_NODE: return "FN_MDNODE";
case bitc::METADATA_NAME: return "METADATA_NAME";
case bitc::METADATA_NAMED_NODE: return "NAMEDMDNODE";
case bitc::METADATA_KIND: return "METADATA_KIND";
+ case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT";
}
}
}
errs() << " Total Size: ";
PrintSize(Stats.NumBits);
errs() << "\n";
- errs() << " % of file: "
- << Stats.NumBits/(double)BufferSizeBits*100 << "\n";
+ double pct = (Stats.NumBits * 100.0) / BufferSizeBits;
+ errs() << " Percent of file: " << format("%2.4f%%", pct) << "\n";
if (Stats.NumInstances > 1) {
errs() << " Average Size: ";
PrintSize(Stats.NumBits/(double)Stats.NumInstances);
errs() << " Num Abbrevs: " << Stats.NumAbbrevs << "\n";
errs() << " Num Records: " << Stats.NumRecords << "\n";
}
- if (Stats.NumRecords)
- errs() << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/
- (double)Stats.NumRecords)*100 << "\n";
+ if (Stats.NumRecords) {
+ double pct = (Stats.NumAbbreviatedRecords * 100.0) / Stats.NumRecords;
+ errs() << " Percent Abbrevs: " << format("%2.4f%%", pct) << "\n";
+ }
errs() << "\n";
// Print a histogram of the codes we see.