LLVM API Documentation
#include "llvm/Bitcode/ReaderWriter.h"
#include "BitcodeReader.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/OperandTraits.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/DataStream.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Classes | |
struct | llvm::OperandTraits< ConstantPlaceHolder > |
Namespaces | |
namespace | llvm |
List of target independent CodeGen pass IDs. | |
Enumerations | |
enum | { SWITCH_INST_MAGIC = 0x4B5 } |
Functions | |
template<typename StrTy > | |
static bool | ConvertToString (ArrayRef< uint64_t > Record, unsigned Idx, StrTy &Result) |
static GlobalValue::LinkageTypes | GetDecodedLinkage (unsigned Val) |
static GlobalValue::VisibilityTypes | GetDecodedVisibility (unsigned Val) |
static GlobalValue::DLLStorageClassTypes | GetDecodedDLLStorageClass (unsigned Val) |
static GlobalVariable::ThreadLocalMode | GetDecodedThreadLocalMode (unsigned Val) |
static int | GetDecodedCastOpcode (unsigned Val) |
static int | GetDecodedBinaryOpcode (unsigned Val, Type *Ty) |
static AtomicRMWInst::BinOp | GetDecodedRMWOperation (unsigned Val) |
static AtomicOrdering | GetDecodedOrdering (unsigned Val) |
static SynchronizationScope | GetDecodedSynchScope (unsigned Val) |
static Comdat::SelectionKind | getDecodedComdatSelectionKind (unsigned Val) |
static void | UpgradeDLLImportExportLinkage (llvm::GlobalValue *GV, unsigned Val) |
static void | decodeLLVMAttributesForBitcode (AttrBuilder &B, uint64_t EncodedAttrs) |
This fills an AttrBuilder object with the LLVM attributes that have been decoded from the given integer. This function must stay in sync with 'encodeLLVMAttributesForBitcode'. | |
static Attribute::AttrKind | GetAttrFromCode (uint64_t Code) |
static APInt | ReadWideAPInt (ArrayRef< uint64_t > Vals, unsigned TypeBits) |
static ErrorOr< Module * > | getLazyBitcodeModuleImpl (std::unique_ptr< MemoryBuffer > &&Buffer, LLVMContext &Context, bool WillMaterializeAll) |
Get a lazy one-at-time loading module from bitcode. |
anonymous enum |
Definition at line 30 of file BitcodeReader.cpp.
static bool ConvertToString | ( | ArrayRef< uint64_t > | Record, |
unsigned | Idx, | ||
StrTy & | Result | ||
) | [static] |
ConvertToString - Convert a string from a record into an std::string, return true on failure.
Definition at line 91 of file BitcodeReader.cpp.
References llvm::ArrayRef< T >::size().
static void decodeLLVMAttributesForBitcode | ( | AttrBuilder & | B, |
uint64_t | EncodedAttrs | ||
) | [static] |
This fills an AttrBuilder object with the LLVM attributes that have been decoded from the given integer. This function must stay in sync with 'encodeLLVMAttributesForBitcode'.
Definition at line 499 of file BitcodeReader.cpp.
References llvm::AttrBuilder::addAlignmentAttr(), llvm::AttrBuilder::addRawValue(), and llvm::isPowerOf2_32().
static Attribute::AttrKind GetAttrFromCode | ( | uint64_t | Code | ) | [static] |
Definition at line 574 of file BitcodeReader.cpp.
References llvm::Attribute::Alignment, llvm::Attribute::AlwaysInline, llvm::bitc::ATTR_KIND_ALIGNMENT, llvm::bitc::ATTR_KIND_ALWAYS_INLINE, llvm::bitc::ATTR_KIND_BUILTIN, llvm::bitc::ATTR_KIND_BY_VAL, llvm::bitc::ATTR_KIND_COLD, llvm::bitc::ATTR_KIND_DEREFERENCEABLE, llvm::bitc::ATTR_KIND_IN_ALLOCA, llvm::bitc::ATTR_KIND_IN_REG, llvm::bitc::ATTR_KIND_INLINE_HINT, llvm::bitc::ATTR_KIND_JUMP_TABLE, llvm::bitc::ATTR_KIND_MIN_SIZE, llvm::bitc::ATTR_KIND_NAKED, llvm::bitc::ATTR_KIND_NEST, llvm::bitc::ATTR_KIND_NO_ALIAS, llvm::bitc::ATTR_KIND_NO_BUILTIN, llvm::bitc::ATTR_KIND_NO_CAPTURE, llvm::bitc::ATTR_KIND_NO_DUPLICATE, llvm::bitc::ATTR_KIND_NO_IMPLICIT_FLOAT, llvm::bitc::ATTR_KIND_NO_INLINE, llvm::bitc::ATTR_KIND_NO_RED_ZONE, llvm::bitc::ATTR_KIND_NO_RETURN, llvm::bitc::ATTR_KIND_NO_UNWIND, llvm::bitc::ATTR_KIND_NON_LAZY_BIND, llvm::bitc::ATTR_KIND_NON_NULL, llvm::bitc::ATTR_KIND_OPTIMIZE_FOR_SIZE, llvm::bitc::ATTR_KIND_OPTIMIZE_NONE, llvm::bitc::ATTR_KIND_READ_NONE, llvm::bitc::ATTR_KIND_READ_ONLY, llvm::bitc::ATTR_KIND_RETURNED, llvm::bitc::ATTR_KIND_RETURNS_TWICE, llvm::bitc::ATTR_KIND_S_EXT, llvm::bitc::ATTR_KIND_SANITIZE_ADDRESS, llvm::bitc::ATTR_KIND_SANITIZE_MEMORY, llvm::bitc::ATTR_KIND_SANITIZE_THREAD, llvm::bitc::ATTR_KIND_STACK_ALIGNMENT, llvm::bitc::ATTR_KIND_STACK_PROTECT, llvm::bitc::ATTR_KIND_STACK_PROTECT_REQ, llvm::bitc::ATTR_KIND_STACK_PROTECT_STRONG, llvm::bitc::ATTR_KIND_STRUCT_RET, llvm::bitc::ATTR_KIND_UW_TABLE, llvm::bitc::ATTR_KIND_Z_EXT, llvm::Attribute::Builtin, llvm::Attribute::ByVal, llvm::Attribute::Cold, llvm::Attribute::Dereferenceable, llvm::Attribute::InAlloca, llvm::Attribute::InlineHint, llvm::Attribute::InReg, llvm::Attribute::JumpTable, llvm::Attribute::MinSize, llvm::Attribute::Naked, llvm::Attribute::Nest, llvm::Attribute::NoAlias, llvm::Attribute::NoBuiltin, llvm::Attribute::NoCapture, llvm::Attribute::NoDuplicate, llvm::Attribute::NoImplicitFloat, llvm::Attribute::NoInline, llvm::Attribute::None, llvm::Attribute::NonLazyBind, llvm::Attribute::NonNull, llvm::Attribute::NoRedZone, llvm::Attribute::NoReturn, llvm::Attribute::NoUnwind, llvm::Attribute::OptimizeForSize, llvm::Attribute::OptimizeNone, llvm::Attribute::ReadNone, llvm::Attribute::ReadOnly, llvm::Attribute::Returned, llvm::Attribute::ReturnsTwice, llvm::Attribute::SanitizeAddress, llvm::Attribute::SanitizeMemory, llvm::Attribute::SanitizeThread, llvm::Attribute::SExt, llvm::Attribute::StackAlignment, llvm::Attribute::StackProtect, llvm::Attribute::StackProtectReq, llvm::Attribute::StackProtectStrong, llvm::Attribute::StructRet, llvm::Attribute::UWTable, and llvm::Attribute::ZExt.
static int GetDecodedBinaryOpcode | ( | unsigned | Val, |
Type * | Ty | ||
) | [static] |
Definition at line 172 of file BitcodeReader.cpp.
References llvm::APIntOps::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::isFPOrFPVectorTy(), llvm::LShr, llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
static int GetDecodedCastOpcode | ( | unsigned | Val | ) | [static] |
Definition at line 154 of file BitcodeReader.cpp.
References llvm::AddrSpaceCast, llvm::bitc::CAST_ADDRSPACECAST, 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, llvm::FPExt, llvm::FPToSI, llvm::IntToPtr, llvm::SExt, llvm::SIToFP, and llvm::Trunc.
static Comdat::SelectionKind getDecodedComdatSelectionKind | ( | unsigned | Val | ) | [static] |
Definition at line 234 of file BitcodeReader.cpp.
References llvm::Comdat::Any, llvm::bitc::COMDAT_SELECTION_KIND_ANY, llvm::bitc::COMDAT_SELECTION_KIND_EXACT_MATCH, llvm::bitc::COMDAT_SELECTION_KIND_LARGEST, llvm::bitc::COMDAT_SELECTION_KIND_NO_DUPLICATES, llvm::bitc::COMDAT_SELECTION_KIND_SAME_SIZE, llvm::Comdat::ExactMatch, llvm::Comdat::Largest, llvm::Comdat::NoDuplicates, and llvm::Comdat::SameSize.
static GlobalValue::DLLStorageClassTypes GetDecodedDLLStorageClass | ( | unsigned | Val | ) | [static] |
Definition at line 134 of file BitcodeReader.cpp.
References llvm::GlobalValue::DefaultStorageClass, llvm::GlobalValue::DLLExportStorageClass, and llvm::GlobalValue::DLLImportStorageClass.
static GlobalValue::LinkageTypes GetDecodedLinkage | ( | unsigned | Val | ) | [static] |
Definition at line 101 of file BitcodeReader.cpp.
References llvm::GlobalValue::AppendingLinkage, llvm::GlobalValue::AvailableExternallyLinkage, llvm::GlobalValue::CommonLinkage, llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::ExternalWeakLinkage, llvm::GlobalValue::InternalLinkage, llvm::GlobalValue::LinkOnceAnyLinkage, llvm::GlobalValue::LinkOnceODRLinkage, llvm::GlobalValue::PrivateLinkage, llvm::GlobalValue::WeakAnyLinkage, and llvm::GlobalValue::WeakODRLinkage.
static AtomicOrdering GetDecodedOrdering | ( | unsigned | Val | ) | [static] |
Definition at line 213 of file BitcodeReader.cpp.
References llvm::Acquire, llvm::AcquireRelease, llvm::Monotonic, llvm::NotAtomic, llvm::bitc::ORDERING_ACQREL, llvm::bitc::ORDERING_ACQUIRE, llvm::bitc::ORDERING_MONOTONIC, llvm::bitc::ORDERING_NOTATOMIC, llvm::bitc::ORDERING_RELEASE, llvm::bitc::ORDERING_SEQCST, llvm::bitc::ORDERING_UNORDERED, llvm::Release, llvm::SequentiallyConsistent, and llvm::Unordered.
static AtomicRMWInst::BinOp GetDecodedRMWOperation | ( | unsigned | Val | ) | [static] |
Definition at line 196 of file BitcodeReader.cpp.
References llvm::AtomicRMWInst::Add, llvm::AtomicRMWInst::And, llvm::AtomicRMWInst::BAD_BINOP, llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::AtomicRMWInst::Nand, llvm::AtomicRMWInst::Or, llvm::bitc::RMW_ADD, llvm::bitc::RMW_AND, llvm::bitc::RMW_MAX, llvm::bitc::RMW_MIN, llvm::bitc::RMW_NAND, llvm::bitc::RMW_OR, llvm::bitc::RMW_SUB, llvm::bitc::RMW_UMAX, llvm::bitc::RMW_UMIN, llvm::bitc::RMW_XCHG, llvm::bitc::RMW_XOR, llvm::AtomicRMWInst::Sub, llvm::AtomicRMWInst::UMax, llvm::AtomicRMWInst::UMin, llvm::AtomicRMWInst::Xchg, and llvm::AtomicRMWInst::Xor.
static SynchronizationScope GetDecodedSynchScope | ( | unsigned | Val | ) | [static] |
Definition at line 226 of file BitcodeReader.cpp.
References llvm::CrossThread, llvm::SingleThread, llvm::bitc::SYNCHSCOPE_CROSSTHREAD, and llvm::bitc::SYNCHSCOPE_SINGLETHREAD.
static GlobalVariable::ThreadLocalMode GetDecodedThreadLocalMode | ( | unsigned | Val | ) | [static] |
Definition at line 143 of file BitcodeReader.cpp.
References llvm::GlobalValue::GeneralDynamicTLSModel, llvm::GlobalValue::InitialExecTLSModel, llvm::GlobalValue::LocalDynamicTLSModel, llvm::GlobalValue::LocalExecTLSModel, and llvm::GlobalValue::NotThreadLocal.
static GlobalValue::VisibilityTypes GetDecodedVisibility | ( | unsigned | Val | ) | [static] |
Definition at line 124 of file BitcodeReader.cpp.
References llvm::GlobalValue::DefaultVisibility, llvm::GlobalValue::HiddenVisibility, and llvm::GlobalValue::ProtectedVisibility.
static ErrorOr<Module *> getLazyBitcodeModuleImpl | ( | std::unique_ptr< MemoryBuffer > && | Buffer, |
LLVMContext & | Context, | ||
bool | WillMaterializeAll | ||
) | [static] |
Get a lazy one-at-time loading module from bitcode.
This isn't always used in a lazy context. In particular, it's also used by parseBitcodeFile(). If this is truly lazy, then we need to eagerly pull in forward-referenced functions from block address references.
[in] | WillMaterializeAll | Set to true if the caller promises to materialize everything -- in particular, if this isn't truly lazy. |
Definition at line 3523 of file BitcodeReader.cpp.
References llvm::Module::setMaterializer().
Referenced by llvm::getLazyBitcodeModule(), and llvm::parseBitcodeFile().
static APInt ReadWideAPInt | ( | ArrayRef< uint64_t > | Vals, |
unsigned | TypeBits | ||
) | [static] |
Definition at line 1200 of file BitcodeReader.cpp.
References llvm::ArrayRef< T >::begin(), llvm::BitcodeReader::decodeSignRotatedValue(), llvm::ArrayRef< T >::end(), and llvm::ArrayRef< T >::size().
static void UpgradeDLLImportExportLinkage | ( | llvm::GlobalValue * | GV, |
unsigned | Val | ||
) | [static] |
Definition at line 250 of file BitcodeReader.cpp.
References llvm::GlobalValue::DLLExportStorageClass, llvm::GlobalValue::DLLImportStorageClass, and llvm::GlobalValue::setDLLStorageClass().