LLVM API Documentation

Enumerations | Functions
BitcodeWriter.cpp File Reference
#include "llvm/Bitcode/ReaderWriter.h"
#include "ValueEnumerator.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Bitcode/BitstreamWriter.h"
#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/UseListOrder.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>
#include <map>
Include dependency graph for BitcodeWriter.cpp:

Go to the source code of this file.

Enumerations

enum  {
  VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV, VST_ENTRY_7_ABBREV, VST_ENTRY_6_ABBREV, VST_BBENTRY_6_ABBREV,
  CONSTANTS_SETTYPE_ABBREV = bitc::FIRST_APPLICATION_ABBREV, CONSTANTS_INTEGER_ABBREV, CONSTANTS_CE_CAST_Abbrev, CONSTANTS_NULL_Abbrev,
  FUNCTION_INST_LOAD_ABBREV = bitc::FIRST_APPLICATION_ABBREV, FUNCTION_INST_BINOP_ABBREV, FUNCTION_INST_BINOP_FLAGS_ABBREV, FUNCTION_INST_CAST_ABBREV,
  FUNCTION_INST_RET_VOID_ABBREV, FUNCTION_INST_RET_VAL_ABBREV, FUNCTION_INST_UNREACHABLE_ABBREV
}
enum  { DarwinBCSizeFieldOffset = 3*4, DarwinBCHeaderSize = 5*4 }

Functions

static unsigned GetEncodedCastOpcode (unsigned Opcode)
static unsigned GetEncodedBinaryOpcode (unsigned Opcode)
static unsigned GetEncodedRMWOperation (AtomicRMWInst::BinOp Op)
static unsigned GetEncodedOrdering (AtomicOrdering Ordering)
static unsigned GetEncodedSynchScope (SynchronizationScope SynchScope)
static void WriteStringRecord (unsigned Code, StringRef Str, unsigned AbbrevToUse, BitstreamWriter &Stream)
static uint64_t getAttrKindEncoding (Attribute::AttrKind Kind)
static void WriteAttributeGroupTable (const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteAttributeTable (const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteTypeTable (const ValueEnumerator &VE, BitstreamWriter &Stream)
 WriteTypeTable - Write out the type table for a module.
static unsigned getEncodedLinkage (const GlobalValue &GV)
static unsigned getEncodedVisibility (const GlobalValue &GV)
static unsigned getEncodedDLLStorageClass (const GlobalValue &GV)
static unsigned getEncodedThreadLocalMode (const GlobalValue &GV)
static unsigned getEncodedComdatSelectionKind (const Comdat &C)
static void writeComdats (const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteModuleInfo (const Module *M, const ValueEnumerator &VE, BitstreamWriter &Stream)
static uint64_t GetOptimizationFlags (const Value *V)
static void WriteMDNode (const MDNode *N, const ValueEnumerator &VE, BitstreamWriter &Stream, SmallVectorImpl< uint64_t > &Record)
static void WriteModuleMetadata (const Module *M, const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteFunctionLocalMetadata (const Function &F, const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteMetadataAttachment (const Function &F, const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteModuleMetadataStore (const Module *M, BitstreamWriter &Stream)
static void emitSignedInt64 (SmallVectorImpl< uint64_t > &Vals, uint64_t V)
static void WriteConstants (unsigned FirstVal, unsigned LastVal, const ValueEnumerator &VE, BitstreamWriter &Stream, bool isGlobal)
static void WriteModuleConstants (const ValueEnumerator &VE, BitstreamWriter &Stream)
static bool PushValueAndType (const Value *V, unsigned InstID, SmallVectorImpl< unsigned > &Vals, ValueEnumerator &VE)
static void pushValue (const Value *V, unsigned InstID, SmallVectorImpl< unsigned > &Vals, ValueEnumerator &VE)
static void pushValueSigned (const Value *V, unsigned InstID, SmallVectorImpl< uint64_t > &Vals, ValueEnumerator &VE)
static void WriteInstruction (const Instruction &I, unsigned InstID, ValueEnumerator &VE, BitstreamWriter &Stream, SmallVectorImpl< unsigned > &Vals)
 WriteInstruction - Emit an instruction to the specified stream.
static void WriteValueSymbolTable (const ValueSymbolTable &VST, const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteUseList (ValueEnumerator &VE, UseListOrder &&Order, BitstreamWriter &Stream)
static void WriteUseListBlock (const Function *F, ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteFunction (const Function &F, ValueEnumerator &VE, BitstreamWriter &Stream)
 WriteFunction - Emit a function body to the module stream.
static void WriteBlockInfo (const ValueEnumerator &VE, BitstreamWriter &Stream)
static void WriteModule (const Module *M, BitstreamWriter &Stream)
 WriteModule - Emit the specified module to the bitstream.
static void WriteInt32ToBuffer (uint32_t Value, SmallVectorImpl< char > &Buffer, uint32_t &Position)
static void EmitDarwinBCHeaderAndTrailer (SmallVectorImpl< char > &Buffer, const Triple &TT)

Enumeration Type Documentation

anonymous enum

These are manifest constants used by the bitcode writer. They do not need to be kept in sync with the reader, but need to be consistent within this file.

Enumerator:
VST_ENTRY_8_ABBREV 
VST_ENTRY_7_ABBREV 
VST_ENTRY_6_ABBREV 
VST_BBENTRY_6_ABBREV 
CONSTANTS_SETTYPE_ABBREV 
CONSTANTS_INTEGER_ABBREV 
CONSTANTS_CE_CAST_Abbrev 
CONSTANTS_NULL_Abbrev 
FUNCTION_INST_LOAD_ABBREV 
FUNCTION_INST_BINOP_ABBREV 
FUNCTION_INST_BINOP_FLAGS_ABBREV 
FUNCTION_INST_CAST_ABBREV 
FUNCTION_INST_RET_VOID_ABBREV 
FUNCTION_INST_RET_VAL_ABBREV 
FUNCTION_INST_UNREACHABLE_ABBREV 

Definition at line 38 of file BitcodeWriter.cpp.

anonymous enum

EmitDarwinBCHeader - If generating a bc file on darwin, we have to emit a header and trailer to make it compatible with the system archiver. To do this we emit the following header, and then emit a trailer that pads the file out to be a multiple of 16 bytes.

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. uint32_t CPUType; // CPU specifier. ... potentially more later ... };

Enumerator:
DarwinBCSizeFieldOffset 
DarwinBCHeaderSize 

Definition at line 1940 of file BitcodeWriter.cpp.


Function Documentation

static void EmitDarwinBCHeaderAndTrailer ( SmallVectorImpl< char > &  Buffer,
const Triple TT 
) [static]
static void emitSignedInt64 ( SmallVectorImpl< uint64_t > &  Vals,
uint64_t  V 
) [static]
static uint64_t getAttrKindEncoding ( Attribute::AttrKind  Kind) [static]

Definition at line 157 of file BitcodeWriter.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::EndAttrKinds, llvm::Attribute::InAlloca, llvm::Attribute::InlineHint, llvm::Attribute::InReg, llvm::Attribute::JumpTable, llvm_unreachable, 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.

Referenced by WriteAttributeGroupTable().

static unsigned GetEncodedBinaryOpcode ( unsigned  Opcode) [static]
static unsigned GetEncodedCastOpcode ( unsigned  Opcode) [static]
static unsigned getEncodedLinkage ( const GlobalValue GV) [static]
static unsigned GetEncodedOrdering ( AtomicOrdering  Ordering) [static]
static unsigned GetEncodedSynchScope ( SynchronizationScope  SynchScope) [static]
static unsigned getEncodedVisibility ( const GlobalValue GV) [static]
static uint64_t GetOptimizationFlags ( const Value V) [static]
static void pushValue ( const Value V,
unsigned  InstID,
SmallVectorImpl< unsigned > &  Vals,
ValueEnumerator VE 
) [static]

pushValue - Like PushValueAndType, but where the type of the value is omitted (perhaps it was already encoded in an earlier operand).

Definition at line 1211 of file BitcodeWriter.cpp.

References llvm::ValueEnumerator::getValueID(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by WriteInstruction().

static bool PushValueAndType ( const Value V,
unsigned  InstID,
SmallVectorImpl< unsigned > &  Vals,
ValueEnumerator VE 
) [static]

PushValueAndType - The file has to encode both the value and type id for many values, because we need to know what type to create for forward references. However, most operands are not forward references, so this type field is not needed.

This function adds V's value ID to Vals. If the value ID is higher than the instruction ID, then it is a forward reference, and it also includes the type ID. The value ID that is written is encoded relative to the InstID.

Definition at line 1196 of file BitcodeWriter.cpp.

References llvm::Value::getType(), llvm::ValueEnumerator::getTypeID(), llvm::ValueEnumerator::getValueID(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by WriteInstruction().

static void pushValueSigned ( const Value V,
unsigned  InstID,
SmallVectorImpl< uint64_t > &  Vals,
ValueEnumerator VE 
) [static]

Definition at line 1218 of file BitcodeWriter.cpp.

References emitSignedInt64(), and llvm::ValueEnumerator::getValueID().

Referenced by WriteInstruction().

static void WriteAttributeGroupTable ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteAttributeTable ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteBlockInfo ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void writeComdats ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteConstants ( unsigned  FirstVal,
unsigned  LastVal,
const ValueEnumerator VE,
BitstreamWriter Stream,
bool  isGlobal 
) [static]

Definition at line 909 of file BitcodeWriter.cpp.

References llvm::BitCodeAbbrev::Add(), llvm::BitCodeAbbrevOp::Array, llvm::CallingConv::C, llvm::WinEH::CE, llvm::BitCodeAbbrevOp::Char6, llvm::SmallVectorImpl< T >::clear(), llvm::tgtok::Code, llvm::bitc::CONSTANTS_BLOCK_ID, CONSTANTS_CE_CAST_Abbrev, CONSTANTS_INTEGER_ABBREV, CONSTANTS_SETTYPE_ABBREV, llvm::bitc::CST_CODE_AGGREGATE, llvm::bitc::CST_CODE_BLOCKADDRESS, llvm::bitc::CST_CODE_CE_BINOP, llvm::bitc::CST_CODE_CE_CAST, llvm::bitc::CST_CODE_CE_CMP, llvm::bitc::CST_CODE_CE_EXTRACTELT, llvm::bitc::CST_CODE_CE_GEP, llvm::bitc::CST_CODE_CE_INBOUNDS_GEP, llvm::bitc::CST_CODE_CE_INSERTELT, llvm::bitc::CST_CODE_CE_SELECT, llvm::bitc::CST_CODE_CE_SHUFFLEVEC, llvm::bitc::CST_CODE_CE_SHUFVEC_EX, llvm::bitc::CST_CODE_CSTRING, llvm::bitc::CST_CODE_DATA, llvm::bitc::CST_CODE_FLOAT, llvm::bitc::CST_CODE_INLINEASM, llvm::bitc::CST_CODE_INTEGER, llvm::bitc::CST_CODE_NULL, llvm::bitc::CST_CODE_SETTYPE, llvm::bitc::CST_CODE_STRING, llvm::bitc::CST_CODE_UNDEF, llvm::bitc::CST_CODE_WIDE_INTEGER, llvm::Value::dump(), llvm::BitstreamWriter::EmitAbbrev(), llvm::BitstreamWriter::EmitRecord(), emitSignedInt64(), llvm::BitstreamWriter::EnterSubblock(), llvm::BitstreamWriter::ExitBlock(), ExtractElement(), F(), llvm::FCmp, llvm::BitCodeAbbrevOp::Fixed, llvm::ConstantDataSequential::getElementAsInteger(), GetEncodedBinaryOpcode(), GetEncodedCastOpcode(), llvm::ValueEnumerator::getGlobalBasicBlockID(), llvm::ConstantDataSequential::getNumElements(), llvm::User::getNumOperands(), llvm::User::getOperand(), GetOptimizationFlags(), llvm::APInt::getRawData(), llvm::Value::getType(), llvm::ValueEnumerator::getTypeID(), llvm::ValueEnumerator::getValueID(), llvm::ValueEnumerator::getValues(), I, llvm::InsertElement, llvm::Instruction::isCast(), llvm::BitCodeAbbrevOp::isChar6(), llvm::ConstantDataSequential::isCString(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isFP128Ty(), llvm::Type::isHalfTy(), llvm::Constant::isNullValue(), llvm::Type::isPPC_FP128Ty(), llvm::Type::isX86_FP80Ty(), llvm_unreachable, llvm::Log2_32_Ceil(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::MCID::Select.

Referenced by WriteFunction(), and WriteModuleConstants().

static void WriteFunction ( const Function F,
ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteFunctionLocalMetadata ( const Function F,
const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteInstruction ( const Instruction I,
unsigned  InstID,
ValueEnumerator VE,
BitstreamWriter Stream,
SmallVectorImpl< unsigned > &  Vals 
) [static]

WriteInstruction - Emit an instruction to the specified stream.

Definition at line 1227 of file BitcodeWriter.cpp.

References llvm::Alloca, llvm::Call, llvm::SwitchInst::case_begin(), llvm::SwitchInst::case_end(), llvm::LandingPadInst::Catch, llvm::SmallVectorImpl< T >::clear(), llvm::tgtok::Code, llvm::BitstreamWriter::EmitRecord(), ExtractElement(), llvm::ExtractValue, llvm::FCmp, llvm::LandingPadInst::Filter, llvm::bitc::FUNC_CODE_INST_ALLOCA, llvm::bitc::FUNC_CODE_INST_ATOMICRMW, llvm::bitc::FUNC_CODE_INST_BINOP, llvm::bitc::FUNC_CODE_INST_BR, llvm::bitc::FUNC_CODE_INST_CALL, llvm::bitc::FUNC_CODE_INST_CAST, llvm::bitc::FUNC_CODE_INST_CMP2, llvm::bitc::FUNC_CODE_INST_CMPXCHG, llvm::bitc::FUNC_CODE_INST_EXTRACTELT, llvm::bitc::FUNC_CODE_INST_EXTRACTVAL, llvm::bitc::FUNC_CODE_INST_FENCE, llvm::bitc::FUNC_CODE_INST_GEP, llvm::bitc::FUNC_CODE_INST_INBOUNDS_GEP, llvm::bitc::FUNC_CODE_INST_INDIRECTBR, llvm::bitc::FUNC_CODE_INST_INSERTELT, llvm::bitc::FUNC_CODE_INST_INSERTVAL, llvm::bitc::FUNC_CODE_INST_INVOKE, llvm::bitc::FUNC_CODE_INST_LANDINGPAD, llvm::bitc::FUNC_CODE_INST_LOAD, llvm::bitc::FUNC_CODE_INST_LOADATOMIC, llvm::bitc::FUNC_CODE_INST_PHI, llvm::bitc::FUNC_CODE_INST_RESUME, llvm::bitc::FUNC_CODE_INST_RET, llvm::bitc::FUNC_CODE_INST_SHUFFLEVEC, llvm::bitc::FUNC_CODE_INST_STORE, llvm::bitc::FUNC_CODE_INST_STOREATOMIC, llvm::bitc::FUNC_CODE_INST_SWITCH, llvm::bitc::FUNC_CODE_INST_UNREACHABLE, llvm::bitc::FUNC_CODE_INST_VAARG, llvm::bitc::FUNC_CODE_INST_VSELECT, FUNCTION_INST_BINOP_ABBREV, FUNCTION_INST_BINOP_FLAGS_ABBREV, FUNCTION_INST_CAST_ABBREV, FUNCTION_INST_LOAD_ABBREV, FUNCTION_INST_RET_VAL_ABBREV, FUNCTION_INST_RET_VOID_ABBREV, FUNCTION_INST_UNREACHABLE_ABBREV, llvm::AllocaInst::getAlignment(), llvm::CallInst::getArgOperand(), llvm::ValueEnumerator::getAttributeID(), llvm::CallInst::getAttributes(), llvm::InvokeInst::getAttributes(), llvm::CallInst::getCalledValue(), llvm::InvokeInst::getCalledValue(), llvm::CallInst::getCallingConv(), llvm::InvokeInst::getCallingConv(), llvm::LandingPadInst::getClause(), llvm::BranchInst::getCondition(), llvm::SwitchInst::getCondition(), llvm::SwitchInst::getDefaultDest(), GetEncodedBinaryOpcode(), GetEncodedCastOpcode(), GetEncodedOrdering(), GetEncodedRMWOperation(), GetEncodedSynchScope(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::InvokeInst::getNormalDest(), llvm::CallInst::getNumArgOperands(), llvm::LandingPadInst::getNumClauses(), llvm::PHINode::getNumIncomingValues(), llvm::User::getNumOperands(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), GetOptimizationFlags(), llvm::LandingPadInst::getPersonalityFn(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::ValueEnumerator::getTypeID(), llvm::InvokeInst::getUnwindDest(), llvm::ValueEnumerator::getValueID(), I, llvm::InsertElement, isAtomic(), llvm::Instruction::isCast(), llvm::LandingPadInst::isCatch(), llvm::LandingPadInst::isCleanup(), llvm::BranchInst::isConditional(), llvm::CallInst::isMustTailCall(), llvm::CallInst::isTailCall(), llvm::AllocaInst::isUsedWithInAlloca(), llvm::LandingPad, llvm::SPII::Load, llvm::Log2_32(), llvm::Value::MaximumAlignment, llvm::TargetOpcode::PHI, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), pushValue(), PushValueAndType(), pushValueSigned(), llvm::MipsISD::Ret, llvm::MCID::Select, llvm::ValueEnumerator::setInstructionID(), llvm::SPII::Store, and llvm::VAArg.

Referenced by WriteFunction().

static void WriteInt32ToBuffer ( uint32_t  Value,
SmallVectorImpl< char > &  Buffer,
uint32_t &  Position 
) [static]

Definition at line 1945 of file BitcodeWriter.cpp.

Referenced by EmitDarwinBCHeaderAndTrailer().

static void WriteMDNode ( const MDNode N,
const ValueEnumerator VE,
BitstreamWriter Stream,
SmallVectorImpl< uint64_t > &  Record 
) [static]
static void WriteMetadataAttachment ( const Function F,
const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteModule ( const Module M,
BitstreamWriter Stream 
) [static]
static void WriteModuleConstants ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]

Definition at line 1174 of file BitcodeWriter.cpp.

References llvm::ValueEnumerator::getValues(), and WriteConstants().

Referenced by WriteModule().

static void WriteModuleInfo ( const Module M,
const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteModuleMetadata ( const Module M,
const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteModuleMetadataStore ( const Module M,
BitstreamWriter Stream 
) [static]
static void WriteStringRecord ( unsigned  Code,
StringRef  Str,
unsigned  AbbrevToUse,
BitstreamWriter Stream 
) [static]
static void WriteTypeTable ( const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]

WriteTypeTable - Write out the type table for a module.

Definition at line 319 of file BitcodeWriter.cpp.

References llvm::BitCodeAbbrevOp::Array, llvm::Type::ArrayTyID, llvm::BitCodeAbbrevOp::Char6, llvm::SmallVectorImpl< T >::clear(), llvm::tgtok::Code, llvm::Type::DoubleTyID, llvm::StructType::element_begin(), llvm::StructType::element_end(), llvm::BitstreamWriter::EmitAbbrev(), llvm::BitstreamWriter::EmitRecord(), llvm::StringRef::empty(), llvm::BitstreamWriter::EnterSubblock(), llvm::BitstreamWriter::ExitBlock(), llvm::BitCodeAbbrevOp::Fixed, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::Type::FunctionTyID, llvm::PointerType::getAddressSpace(), getBitWidth(), llvm::SequentialType::getElementType(), llvm::StructType::getName(), llvm::ArrayType::getNumElements(), llvm::VectorType::getNumElements(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), llvm::ValueEnumerator::getTypeID(), llvm::Type::getTypeID(), llvm::ValueEnumerator::getTypes(), llvm::Type::HalfTyID, I, llvm::Type::IntegerTyID, llvm::StructType::isLiteral(), llvm::StructType::isOpaque(), llvm::StructType::isPacked(), llvm::FunctionType::isVarArg(), llvm::Type::LabelTyID, llvm::Log2_32_Ceil(), llvm::Type::MetadataTyID, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::AArch64DB::ST, llvm::Type::StructTyID, T, llvm::bitc::TYPE_BLOCK_ID_NEW, llvm::bitc::TYPE_CODE_ARRAY, llvm::bitc::TYPE_CODE_DOUBLE, llvm::bitc::TYPE_CODE_FLOAT, llvm::bitc::TYPE_CODE_FP128, llvm::bitc::TYPE_CODE_FUNCTION, llvm::bitc::TYPE_CODE_HALF, llvm::bitc::TYPE_CODE_INTEGER, llvm::bitc::TYPE_CODE_LABEL, llvm::bitc::TYPE_CODE_METADATA, llvm::bitc::TYPE_CODE_NUMENTRY, llvm::bitc::TYPE_CODE_OPAQUE, llvm::bitc::TYPE_CODE_POINTER, llvm::bitc::TYPE_CODE_PPC_FP128, llvm::bitc::TYPE_CODE_STRUCT_ANON, llvm::bitc::TYPE_CODE_STRUCT_NAME, llvm::bitc::TYPE_CODE_STRUCT_NAMED, llvm::bitc::TYPE_CODE_VECTOR, llvm::bitc::TYPE_CODE_VOID, llvm::bitc::TYPE_CODE_X86_FP80, llvm::bitc::TYPE_CODE_X86_MMX, llvm::BitCodeAbbrevOp::VBR, llvm::Type::VectorTyID, llvm::Type::VoidTyID, WriteStringRecord(), llvm::Type::X86_FP80TyID, and llvm::Type::X86_MMXTyID.

Referenced by WriteModule().

static void WriteUseList ( ValueEnumerator VE,
UseListOrder &&  Order,
BitstreamWriter Stream 
) [static]
static void WriteUseListBlock ( const Function F,
ValueEnumerator VE,
BitstreamWriter Stream 
) [static]
static void WriteValueSymbolTable ( const ValueSymbolTable VST,
const ValueEnumerator VE,
BitstreamWriter Stream 
) [static]