LLVM 20.0.0git
|
#include "llvm/Bitcode/BitcodeAnalyzer.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/Bitstream/BitCodes.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/SHA1.h"
#include <optional>
Go to the source code of this file.
Macros | |
#define | STRINGIFY_CODE(PREFIX, CODE) |
Functions | |
static Error | reportError (StringRef Message) |
static std::optional< const char * > | GetBlockName (unsigned BlockID, const BitstreamBlockInfo &BlockInfo, CurStreamTypeType CurStreamType) |
Return a symbolic block name if known, otherwise return null. | |
static std::optional< const char * > | GetCodeName (unsigned CodeID, unsigned BlockID, const BitstreamBlockInfo &BlockInfo, CurStreamTypeType CurStreamType) |
Return a symbolic code name if known, otherwise return null. | |
static void | printSize (raw_ostream &OS, double Bits) |
static void | printSize (raw_ostream &OS, uint64_t Bits) |
static Expected< CurStreamTypeType > | ReadSignature (BitstreamCursor &Stream) |
static Expected< CurStreamTypeType > | analyzeHeader (std::optional< BCDumpOptions > O, BitstreamCursor &Stream) |
static bool | canDecodeBlob (unsigned Code, unsigned BlockID) |
#define STRINGIFY_CODE | ( | PREFIX, | |
CODE | |||
) |
|
static |
Definition at line 484 of file BitcodeAnalyzer.cpp.
References llvm::BWH_CPUTypeField, llvm::BWH_HeaderSize, llvm::BWH_MagicField, llvm::BWH_OffsetField, llvm::BWH_SizeField, llvm::BWH_VersionField, llvm::ArrayRef< T >::data(), llvm::format_hex(), llvm::BitstreamCursor::getBitcodeBytes(), llvm::isBitcodeWrapper(), llvm::Offset, llvm::support::endian::read32le(), ReadSignature(), reportError(), llvm::ArrayRef< T >::size(), Size, and llvm::SkipBitcodeWrapperHeader().
Referenced by llvm::BitcodeAnalyzer::analyze().
Definition at line 521 of file BitcodeAnalyzer.cpp.
References llvm::bitc::METADATA_BLOCK_ID, and llvm::bitc::METADATA_STRINGS.
|
static |
Return a symbolic block name if known, otherwise return null.
Definition at line 26 of file BitcodeAnalyzer.cpp.
References llvm::bitc::BLOCKINFO_BLOCK_ID, llvm::bitc::CONSTANTS_BLOCK_ID, llvm::bitc::FIRST_APPLICATION_BLOCKID, llvm::bitc::FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID, llvm::bitc::FUNCTION_BLOCK_ID, llvm::BitstreamBlockInfo::getBlockInfo(), llvm::bitc::GLOBALVAL_SUMMARY_BLOCK_ID, llvm::bitc::IDENTIFICATION_BLOCK_ID, Info, llvm::LLVMIRBitstream, llvm::bitc::METADATA_ATTACHMENT_ID, llvm::bitc::METADATA_BLOCK_ID, llvm::bitc::METADATA_KIND_BLOCK_ID, llvm::bitc::MODULE_BLOCK_ID, llvm::bitc::MODULE_STRTAB_BLOCK_ID, llvm::bitc::OPERAND_BUNDLE_TAGS_BLOCK_ID, llvm::bitc::PARAMATTR_BLOCK_ID, llvm::bitc::PARAMATTR_GROUP_BLOCK_ID, llvm::bitc::STRTAB_BLOCK_ID, llvm::bitc::SYMTAB_BLOCK_ID, llvm::bitc::TYPE_BLOCK_ID_NEW, llvm::bitc::USELIST_BLOCK_ID, and llvm::bitc::VALUE_SYMTAB_BLOCK_ID.
Referenced by llvm::BitcodeAnalyzer::printStats().
|
static |
Return a symbolic code name if known, otherwise return null.
Definition at line 89 of file BitcodeAnalyzer.cpp.
References llvm::bitc::BLOCKINFO_BLOCK_ID, llvm::bitc::BLOCKINFO_CODE_BLOCKNAME, llvm::bitc::BLOCKINFO_CODE_SETBID, llvm::bitc::BLOCKINFO_CODE_SETRECORDNAME, llvm::bitc::CONSTANTS_BLOCK_ID, llvm::bitc::CST_CODE_BLOCKADDRESS, ENTRY, llvm::bitc::FIRST_APPLICATION_BLOCKID, llvm::bitc::FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID, FUNCTION, llvm::bitc::FUNCTION_BLOCK_ID, llvm::BitstreamBlockInfo::getBlockInfo(), llvm::bitc::GLOBALVAL_SUMMARY_BLOCK_ID, llvm::bitc::IDENTIFICATION_BLOCK_ID, Info, KIND, llvm::LLVMIRBitstream, llvm::bitc::METADATA_ATTACHMENT_ID, llvm::bitc::METADATA_BLOCK_ID, llvm::bitc::METADATA_KIND_BLOCK_ID, llvm::MODULE, llvm::bitc::MODULE_BLOCK_ID, llvm::bitc::MODULE_STRTAB_BLOCK_ID, NODE, llvm::bitc::OPERAND_BUNDLE_TAG, llvm::bitc::OPERAND_BUNDLE_TAGS_BLOCK_ID, llvm::bitc::PARAMATTR_BLOCK_ID, llvm::bitc::PARAMATTR_CODE_ENTRY, llvm::bitc::PARAMATTR_CODE_ENTRY_OLD, llvm::bitc::PARAMATTR_GROUP_BLOCK_ID, llvm::bitc::PARAMATTR_GRP_CODE_ENTRY, STRINGIFY_CODE, llvm::bitc::STRTAB_BLOB, llvm::bitc::STRTAB_BLOCK_ID, llvm::bitc::SYMTAB_BLOB, llvm::bitc::SYMTAB_BLOCK_ID, TOKEN, llvm::bitc::TYPE_BLOCK_ID_NEW, llvm::bitc::USELIST_BLOCK_ID, llvm::bitc::USELIST_CODE_BB, llvm::bitc::USELIST_CODE_DEFAULT, and llvm::bitc::VALUE_SYMTAB_BLOCK_ID.
Referenced by llvm::BitcodeAnalyzer::printStats().
|
static |
Definition at line 423 of file BitcodeAnalyzer.cpp.
References llvm::format(), and OS.
Referenced by llvm::BitcodeAnalyzer::printStats().
|
static |
Definition at line 426 of file BitcodeAnalyzer.cpp.
References llvm::format(), and OS.
|
static |
Definition at line 431 of file BitcodeAnalyzer.cpp.
References llvm::ClangSerializedASTBitstream, llvm::ClangSerializedDiagnosticsBitstream, llvm::LLVMBitstreamRemarks, llvm::LLVMIRBitstream, llvm::BitstreamCursor::Read(), llvm::size(), llvm::Error::success(), and llvm::UnknownBitstream.
Referenced by analyzeHeader().
Definition at line 20 of file BitcodeAnalyzer.cpp.
References llvm::createStringError(), and llvm::StringRef::data().
Referenced by llvm::BitcodeAnalyzer::analyze(), analyzeHeader(), getAddrSpace(), getInt(), getIntInBytes(), split(), and llvm::GenericCycleInfo< ContextT >::validateTree().