LLVM  10.0.0svn
Macros | Functions
BitcodeAnalyzer.cpp File Reference
#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 dependency graph for BitcodeAnalyzer.cpp:

Go to the source code of this file.

Macros

#define STRINGIFY_CODE(PREFIX, CODE)
 

Functions

static Error reportError (StringRef Message)
 
static Optional< const char * > GetBlockName (unsigned BlockID, const BitstreamBlockInfo &BlockInfo, CurStreamTypeType CurStreamType)
 Return a symbolic block name if known, otherwise return null. More...
 
static Optional< const char * > GetCodeName (unsigned CodeID, unsigned BlockID, const BitstreamBlockInfo &BlockInfo, CurStreamTypeType CurStreamType)
 Return a symbolic code name if known, otherwise return null. More...
 
static void printSize (raw_ostream &OS, double Bits)
 
static void printSize (raw_ostream &OS, uint64_t Bits)
 
static Expected< CurStreamTypeTypeReadSignature (BitstreamCursor &Stream)
 
static Expected< CurStreamTypeTypeanalyzeHeader (Optional< BCDumpOptions > O, BitstreamCursor &Stream)
 
static bool canDecodeBlob (unsigned Code, unsigned BlockID)
 

Macro Definition Documentation

◆ STRINGIFY_CODE

#define STRINGIFY_CODE (   PREFIX,
  CODE 
)
Value:
case bitc::PREFIX##_##CODE: \
return #CODE;
#define PREFIX(NAME, VALUE)
#define _

Referenced by GetCodeName().

Function Documentation

◆ analyzeHeader()

static Expected<CurStreamTypeType> analyzeHeader ( Optional< BCDumpOptions O,
BitstreamCursor Stream 
)
static

◆ canDecodeBlob()

static bool canDecodeBlob ( unsigned  Code,
unsigned  BlockID 
)
static

◆ GetBlockName()

static Optional<const char *> GetBlockName ( unsigned  BlockID,
const BitstreamBlockInfo BlockInfo,
CurStreamTypeType  CurStreamType 
)
static

◆ GetCodeName()

static Optional<const char *> GetCodeName ( unsigned  CodeID,
unsigned  BlockID,
const BitstreamBlockInfo BlockInfo,
CurStreamTypeType  CurStreamType 
)
static

Return a symbolic code name if known, otherwise return null.

Definition at line 87 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, llvm::numbers::e, ENTRY, ENUMERATOR, 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::ISD::INLINEASM, 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, NODE, llvm::None, 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, llvm::bitc::TYPE_BLOCK_ID_NEW, llvm::ISD::UNDEF, llvm::bitc::USELIST_BLOCK_ID, llvm::bitc::USELIST_CODE_BB, llvm::bitc::USELIST_CODE_DEFAULT, llvm::bitc::VALUE_SYMTAB_BLOCK_ID, R600_InstFlag::VECTOR, and llvm::BTF::VERSION.

Referenced by llvm::BitcodeAnalyzer::printStats().

◆ printSize() [1/2]

static void printSize ( raw_ostream OS,
double  Bits 
)
static

Definition at line 399 of file BitcodeAnalyzer.cpp.

References llvm::format().

Referenced by llvm::BitcodeAnalyzer::printStats().

◆ printSize() [2/2]

static void printSize ( raw_ostream OS,
uint64_t  Bits 
)
static

Definition at line 402 of file BitcodeAnalyzer.cpp.

References llvm::format().

◆ ReadSignature()

static Expected<CurStreamTypeType> ReadSignature ( BitstreamCursor Stream)
static

◆ reportError()

static Error reportError ( StringRef  Message)
static