13#ifndef LLVM_BITCODE_BITCODEANALYZER_H
14#define LLVM_BITCODE_BITCODEANALYZER_H
56 std::optional<BitstreamCursor> BlockInfoStream;
57 unsigned NumTopBlocks = 0;
59 struct PerRecordStats {
60 unsigned NumInstances;
63 PerRecordStats() : NumInstances(0), NumAbbrev(0), TotalBits(0) {}
66 struct PerBlockIDStats {
68 unsigned NumInstances;
72 unsigned NumSubBlocks;
77 unsigned NumRecords, NumAbbreviatedRecords;
79 std::vector<PerRecordStats> CodeFreq;
81 : NumInstances(0), NumBits(0), NumSubBlocks(0), NumAbbrevs(0),
82 NumRecords(0), NumAbbreviatedRecords(0) {}
85 std::map<unsigned, PerBlockIDStats> BlockIDStats;
89 std::optional<StringRef> BlockInfoBuffer = std::nullopt);
91 Error analyze(std::optional<BCDumpOptions> O = std::nullopt,
92 std::optional<StringRef> CheckHash = std::nullopt);
95 std::optional<StringRef> Filename = std::nullopt);
99 Error parseBlock(
unsigned BlockID,
unsigned IndentLevel,
100 std::optional<BCDumpOptions> O = std::nullopt,
101 std::optional<StringRef> CheckHash = std::nullopt);
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Error analyze(std::optional< BCDumpOptions > O=std::nullopt, std::optional< StringRef > CheckHash=std::nullopt)
Analyze the bitcode file.
void printStats(BCDumpOptions O, std::optional< StringRef > Filename=std::nullopt)
Print stats about the bitcode file.
This class maintains the abbreviations read from a block info block.
This represents a position within a bitcode file, implemented on top of a SimpleBitstreamCursor.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
CurStreamTypeType
CurStreamTypeType - A type for CurStreamType.
@ ClangSerializedDiagnosticsBitstream
@ ClangSerializedASTBitstream
BCDumpOptions(raw_ostream &OS)
raw_ostream & OS
The stream.
bool Histogram
Print per-code histogram.
bool Symbolic
Don't emit numeric info in dump if symbolic info is available.
bool DumpBlockinfo
Print BLOCKINFO block details.
bool ShowBinaryBlobs
Print binary blobs using hex escapes.