LLVM API Documentation

BitcodeReader.cpp File Reference

#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"

Include dependency graph for BitcodeReader.cpp:

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)
ModuleProviderllvm::getBitcodeModuleProvider (MemoryBuffer *Buffer, std::string *ErrMsg=0)
Modulellvm::ParseBitcodeFile (MemoryBuffer *Buffer, std::string *ErrMsg=0)


Function Documentation

template<typename StrTy>
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.

static int GetDecodedBinaryOpcode ( unsigned  Val,
const Type Ty 
) [static]

static int GetDecodedCastOpcode ( unsigned  Val  )  [static]

static GlobalValue::LinkageTypes GetDecodedLinkage ( unsigned  Val  )  [static]

static GlobalValue::VisibilityTypes GetDecodedVisibility ( unsigned  Val  )  [static]

static bool SkipWrapperHeader ( unsigned char *&  BufPtr,
unsigned char *&  BufEnd 
) [static]

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().




This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.