LLVM API Documentation

Classes | Namespaces | Enumerations | Functions
BitcodeReader.cpp File Reference
#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"
Include dependency graph for BitcodeReader.cpp:

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.

Enumeration Type Documentation

anonymous enum
Enumerator:
SWITCH_INST_MAGIC 

Definition at line 30 of file BitcodeReader.cpp.


Function Documentation

template<typename StrTy >
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]
static int GetDecodedCastOpcode ( unsigned  Val) [static]
static AtomicOrdering GetDecodedOrdering ( unsigned  Val) [static]
static GlobalVariable::ThreadLocalMode GetDecodedThreadLocalMode ( unsigned  Val) [static]
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.

Parameters:
[in]WillMaterializeAllSet 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]
static void UpgradeDLLImportExportLinkage ( llvm::GlobalValue GV,
unsigned  Val 
) [static]