13#ifndef LLVM_BITCODE_BITCODEANALYZER_H
14#define LLVM_BITCODE_BITCODEANALYZER_H
57 std::optional<BitstreamCursor> BlockInfoStream;
58 unsigned NumTopBlocks = 0;
60 struct PerRecordStats {
61 unsigned NumInstances = 0;
62 unsigned NumAbbrev = 0;
64 PerRecordStats() =
default;
67 struct PerBlockIDStats {
69 unsigned NumInstances = 0;
73 unsigned NumSubBlocks = 0;
75 unsigned NumAbbrevs = 0;
78 unsigned NumRecords = 0, NumAbbreviatedRecords = 0;
80 std::vector<PerRecordStats> CodeFreq;
81 PerBlockIDStats() =
default;
84 std::map<unsigned, PerBlockIDStats> BlockIDStats;
89 std::optional<StringRef> BlockInfoBuffer = 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),...
LLVM_ABI Error analyze(std::optional< BCDumpOptions > O=std::nullopt, std::optional< StringRef > CheckHash=std::nullopt)
Analyze the bitcode file.
LLVM_ABI 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.