LLVM  4.0.0
Enumerations | Functions | Variables
BitcodeReader.cpp File Reference
#include "llvm/Bitcode/BitcodeReader.h"
#include "MetadataLoader.h"
#include "ValueList.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Bitcode/BitstreamReader.h"
#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Comdat.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalIFunc.h"
#include "llvm/IR/GlobalIndirectSymbol.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/GVMaterializer.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/IR/OperandTraits.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/TrackingMDRef.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <limits>
#include <map>
#include <memory>
#include <string>
#include <system_error>
#include <tuple>
#include <utility>
#include <vector>

Go to the source code of this file.

Enumerations

enum  
 

Functions

static bool hasImplicitComdat (size_t Val)
 
static GlobalValue::LinkageTypes getDecodedLinkage (unsigned Val)
 
static GlobalValueSummary::GVFlags getDecodedGVSummaryFlags (uint64_t RawFlags, uint64_t Version)
 Decode the flags for GlobalValue in the summary. More...
 
static GlobalValue::VisibilityTypes getDecodedVisibility (unsigned Val)
 
static
GlobalValue::DLLStorageClassTypes 
getDecodedDLLStorageClass (unsigned Val)
 
static
GlobalVariable::ThreadLocalMode 
getDecodedThreadLocalMode (unsigned Val)
 
static GlobalVariable::UnnamedAddr getDecodedUnnamedAddrType (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 FastMathFlags getDecodedFastMathFlags (unsigned Val)
 
static void upgradeDLLImportExportLinkage (GlobalValue *GV, unsigned Val)
 
static uint64_t getRawAttributeMask (Attribute::AttrKind Val)
 
static void addRawAttributeValue (AttrBuilder &B, uint64_t 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. More...
 
static Attribute::AttrKind getAttrFromCode (uint64_t Code)
 
static uint64_t jumpToValueSymbolTable (uint64_t Offset, BitstreamCursor &Stream)
 Helper to note and return the current location, and jump to the given offset. More...
 
static APInt readWideAPInt (ArrayRef< uint64_t > Vals, unsigned TypeBits)
 
static Expected< BitcodeModulegetSingleModule (MemoryBufferRef Buffer)
 

Variables

static cl::opt< boolPrintSummaryGUIDs ("print-summary-global-ids", cl::init(false), cl::Hidden, cl::desc("Print the global id for each value when reading the module summary"))
 
static ManagedStatic
< BitcodeErrorCategoryType > 
ErrorCategory
 

Enumeration Type Documentation

anonymous enum

Definition at line 98 of file BitcodeReader.cpp.

Function Documentation

static void addRawAttributeValue ( AttrBuilder B,
uint64_t  Val 
)
static
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 1110 of file BitcodeReader.cpp.

References llvm::AttrBuilder::addAlignmentAttr(), addRawAttributeValue(), assert(), and llvm::isPowerOf2_32().

static Attribute::AttrKind getAttrFromCode ( uint64_t  Code)
static

Definition at line 1185 of file BitcodeReader.cpp.

References llvm::bitc::ATTR_KIND_ALIGNMENT, llvm::bitc::ATTR_KIND_ALLOC_SIZE, llvm::bitc::ATTR_KIND_ALWAYS_INLINE, llvm::bitc::ATTR_KIND_ARGMEMONLY, llvm::bitc::ATTR_KIND_BUILTIN, llvm::bitc::ATTR_KIND_BY_VAL, llvm::bitc::ATTR_KIND_COLD, llvm::bitc::ATTR_KIND_CONVERGENT, llvm::bitc::ATTR_KIND_DEREFERENCEABLE, llvm::bitc::ATTR_KIND_DEREFERENCEABLE_OR_NULL, llvm::bitc::ATTR_KIND_IN_ALLOCA, llvm::bitc::ATTR_KIND_IN_REG, llvm::bitc::ATTR_KIND_INACCESSIBLEMEM_ONLY, llvm::bitc::ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEMONLY, 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_RECURSE, 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_SAFESTACK, 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_SWIFT_ERROR, llvm::bitc::ATTR_KIND_SWIFT_SELF, llvm::bitc::ATTR_KIND_UW_TABLE, llvm::bitc::ATTR_KIND_WRITEONLY, llvm::bitc::ATTR_KIND_Z_EXT, llvm::CallingConv::Cold, llvm::MCID::Convergent, llvm::ISD::JumpTable, llvm::NoAlias, llvm::None, AMDGPU::RuntimeMD::KernelArg::ReadOnly, and AMDGPU::RuntimeMD::KernelArg::WriteOnly.

static int getDecodedBinaryOpcode ( unsigned  Val,
Type Ty 
)
static
static int getDecodedCastOpcode ( unsigned  Val)
static
static Comdat::SelectionKind getDecodedComdatSelectionKind ( unsigned  Val)
static
static GlobalValue::DLLStorageClassTypes getDecodedDLLStorageClass ( unsigned  Val)
static

Definition at line 822 of file BitcodeReader.cpp.

static FastMathFlags getDecodedFastMathFlags ( unsigned  Val)
static
static GlobalValueSummary::GVFlags getDecodedGVSummaryFlags ( uint64_t  RawFlags,
uint64_t  Version 
)
static

Decode the flags for GlobalValue in the summary.

Definition at line 797 of file BitcodeReader.cpp.

static GlobalValue::LinkageTypes getDecodedLinkage ( unsigned  Val)
static

Definition at line 754 of file BitcodeReader.cpp.

static AtomicOrdering getDecodedOrdering ( unsigned  Val)
static
static AtomicRMWInst::BinOp getDecodedRMWOperation ( unsigned  Val)
static
static SynchronizationScope getDecodedSynchScope ( unsigned  Val)
static
static GlobalVariable::ThreadLocalMode getDecodedThreadLocalMode ( unsigned  Val)
static

Definition at line 831 of file BitcodeReader.cpp.

static GlobalVariable::UnnamedAddr getDecodedUnnamedAddrType ( unsigned  Val)
static
static GlobalValue::VisibilityTypes getDecodedVisibility ( unsigned  Val)
static

Definition at line 812 of file BitcodeReader.cpp.

static uint64_t getRawAttributeMask ( Attribute::AttrKind  Val)
static
static Expected<BitcodeModule> getSingleModule ( MemoryBufferRef  Buffer)
static
static bool hasImplicitComdat ( size_t  Val)
static

Definition at line 742 of file BitcodeReader.cpp.

static uint64_t jumpToValueSymbolTable ( uint64_t  Offset,
BitstreamCursor Stream 
)
static
static APInt readWideAPInt ( ArrayRef< uint64_t >  Vals,
unsigned  TypeBits 
)
static
static void upgradeDLLImportExportLinkage ( GlobalValue GV,
unsigned  Val 
)
static

Definition at line 977 of file BitcodeReader.cpp.

References llvm::GlobalValue::setDLLStorageClass().

Variable Documentation

ManagedStatic<BitcodeErrorCategoryType> ErrorCategory
static

Definition at line 5145 of file BitcodeReader.cpp.

Referenced by llvm::BitcodeErrorCategory().

cl::opt<bool> PrintSummaryGUIDs("print-summary-global-ids", cl::init(false), cl::Hidden, cl::desc("Print the global id for each value when reading the module summary"))
static