LLVM API Documentation
#include "llvm/Bitcode/ReaderWriter.h"#include "BitcodeReader.h"#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/InlineAsm.h"#include "llvm/Instructions.h"#include "llvm/Module.h"#include "llvm/AutoUpgrade.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/SmallVector.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/MemoryBuffer.h"#include "llvm/OperandTraits.h"

Go to the source code of this file.
Namespaces | |
| namespace | llvm |
Classes | |
| struct | llvm::OperandTraits< ConstantPlaceHolder > |
Functions | |
| template<typename StrTy> | |
| static bool | ConvertToString (SmallVector< uint64_t, 64 > &Record, unsigned Idx, StrTy &Result) |
| static GlobalValue::LinkageTypes | GetDecodedLinkage (unsigned Val) |
| static GlobalValue::VisibilityTypes | GetDecodedVisibility (unsigned Val) |
| static int | GetDecodedCastOpcode (unsigned Val) |
| static int | GetDecodedBinaryOpcode (unsigned Val, const Type *Ty) |
| static uint64_t | DecodeSignRotatedValue (uint64_t V) |
| static bool | SkipWrapperHeader (unsigned char *&BufPtr, unsigned char *&BufEnd) |
| ModuleProvider * | llvm::getBitcodeModuleProvider (MemoryBuffer *Buffer, std::string *ErrMsg=0) |
| Module * | llvm::ParseBitcodeFile (MemoryBuffer *Buffer, std::string *ErrMsg=0) |
| static bool ConvertToString | ( | SmallVector< uint64_t, 64 > & | Record, | |
| unsigned | Idx, | |||
| StrTy & | Result | |||
| ) | [inline, static] |
ConvertToString - Convert a string from a record into an std::string, return true on failure.
Definition at line 48 of file BitcodeReader.cpp.
References llvm::SmallVectorImpl< T >::size().
| static uint64_t DecodeSignRotatedValue | ( | uint64_t | V | ) | [static] |
DecodeSignRotatedValue - Decode a signed value stored with the sign bit in the LSB for dense VBR encoding.
Definition at line 669 of file BitcodeReader.cpp.
Definition at line 99 of file BitcodeReader.cpp.
References Add(), And(), llvm::bitc::BINOP_ADD, llvm::bitc::BINOP_AND, llvm::bitc::BINOP_ASHR, llvm::bitc::BINOP_LSHR, llvm::bitc::BINOP_MUL, llvm::bitc::BINOP_OR, llvm::bitc::BINOP_SDIV, llvm::bitc::BINOP_SHL, llvm::bitc::BINOP_SREM, llvm::bitc::BINOP_SUB, llvm::bitc::BINOP_UDIV, llvm::bitc::BINOP_UREM, llvm::bitc::BINOP_XOR, llvm::Type::isFPOrFPVector(), LShr, llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
| static int GetDecodedCastOpcode | ( | unsigned | Val | ) | [static] |
Definition at line 82 of file BitcodeReader.cpp.
References BitCast, llvm::bitc::CAST_BITCAST, llvm::bitc::CAST_FPEXT, llvm::bitc::CAST_FPTOSI, llvm::bitc::CAST_FPTOUI, llvm::bitc::CAST_FPTRUNC, llvm::bitc::CAST_INTTOPTR, llvm::bitc::CAST_PTRTOINT, llvm::bitc::CAST_SEXT, llvm::bitc::CAST_SITOFP, llvm::bitc::CAST_TRUNC, llvm::bitc::CAST_UITOFP, llvm::bitc::CAST_ZEXT, FPToUI, FPTrunc, PtrToInt, llvm::Attribute::SExt, UIToFP, and ZExt.
| static GlobalValue::LinkageTypes GetDecodedLinkage | ( | unsigned | Val | ) | [static] |
Definition at line 58 of file BitcodeReader.cpp.
References llvm::GlobalValue::AppendingLinkage, llvm::GlobalValue::CommonLinkage, llvm::GlobalValue::DLLExportLinkage, llvm::GlobalValue::DLLImportLinkage, llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::ExternalWeakLinkage, llvm::GlobalValue::InternalLinkage, llvm::GlobalValue::LinkOnceLinkage, and llvm::GlobalValue::WeakLinkage.
| static GlobalValue::VisibilityTypes GetDecodedVisibility | ( | unsigned | Val | ) | [static] |
Definition at line 73 of file BitcodeReader.cpp.
References llvm::GlobalValue::DefaultVisibility, llvm::GlobalValue::HiddenVisibility, and llvm::GlobalValue::ProtectedVisibility.
SkipWrapperHeader - Some systems wrap bc files with a special header for padding or other reasons. The format of this header is:
struct bc_header { uint32_t Magic; // 0x0B17C0DE uint32_t Version; // Version, currently always 0. uint32_t BitcodeOffset; // Offset to traditional bitcode file. uint32_t BitcodeSize; // Size of traditional bitcode file. ... potentially other gunk ... };
This function is called when we find a file with a matching magic number. In this case, skip down to the subsection of the file that is actually a BC file.
Definition at line 1287 of file BitcodeReader.cpp.
References Offset.
Referenced by llvm::BitcodeReader::ParseBitcode().