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 = 0;
61 unsigned NumAbbrev = 0;
63 PerRecordStats() =
default;
66 struct PerBlockIDStats {
68 unsigned NumInstances = 0;
72 unsigned NumSubBlocks = 0;
74 unsigned NumAbbrevs = 0;
77 unsigned NumRecords = 0, NumAbbreviatedRecords = 0;
79 std::vector<PerRecordStats> CodeFreq;
80 PerBlockIDStats() =
default;
83 std::map<unsigned, PerBlockIDStats> BlockIDStats;
87 std::optional<StringRef> BlockInfoBuffer = std::nullopt);
89 Error analyze(std::optional<BCDumpOptions> O = std::nullopt,
90 std::optional<StringRef> CheckHash = std::nullopt);
93 std::optional<StringRef> Filename = std::nullopt);
97 Error parseBlock(
unsigned BlockID,
unsigned IndentLevel,
98 std::optional<BCDumpOptions> O = std::nullopt,
99 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.