LLVM  6.0.0svn
Macros | Functions
WasmObjectWriter.cpp File Reference
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSectionWasm.h"
#include "llvm/MC/MCSymbolWasm.h"
#include "llvm/MC/MCValue.h"
#include "llvm/MC/MCWasmObjectWriter.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/StringSaver.h"
#include <vector>
Include dependency graph for WasmObjectWriter.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mc"
 

Functions

static void WritePatchableLEB (raw_pwrite_stream &Stream, uint32_t X, uint64_t Offset)
 
static void WritePatchableSLEB (raw_pwrite_stream &Stream, int32_t X, uint64_t Offset)
 
static void WriteI32 (raw_pwrite_stream &Stream, uint32_t X, uint64_t Offset)
 
static const MCSymbolWasmResolveSymbol (const MCSymbolWasm &Symbol)
 
static void addData (SmallVectorImpl< char > &DataBytes, MCSectionWasm &DataSection)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mc"

Definition at line 39 of file WasmObjectWriter.cpp.

Function Documentation

◆ addData()

static void addData ( SmallVectorImpl< char > &  DataBytes,
MCSectionWasm DataSection 
)
static

Definition at line 504 of file WasmObjectWriter.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::alignTo(), assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::MCSection::begin(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::dbgs(), DEBUG, llvm::decodeSLEB128(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::ArrayRef< T >::empty(), llvm::encodeSLEB128(), llvm::encodeULEB128(), llvm::sys::path::end(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::errs(), llvm::Export, F(), llvm::MCFragment::FT_Data, G, llvm::MCSection::getAlignment(), llvm::MCAssembler::getContext(), llvm::MCSection::getFragmentList(), llvm::MCFragment::getKind(), llvm::MCSymbolWasm::getParams(), llvm::MCSymbolWasm::getReturns(), llvm::MCSectionWasm::getSectionName(), llvm::MCAsmLayout::getSymbolOffset(), llvm::MCContext::getWasmSection(), llvm::MCFragment::hasInstructions(), llvm::wasm::I32, llvm::wasm::I64, llvm::Import, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallVectorImpl< T >::insert(), is64Bit(), llvm::MCSymbolWasm::isFunction(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::report_fatal_error(), llvm::SmallVectorImpl< T >::resize(), ResolveSymbol(), llvm::ARMBuildAttrs::Section, llvm::SmallVectorTemplateCommon< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::ArrayRef< T >::size(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, llvm::ARMBuildAttrs::Symbol, llvm::MCAssembler::symbols(), llvm::wasm::WASM_DATA_SIZE, llvm::wasm::WASM_EXTERNAL_FUNCTION, llvm::wasm::WASM_EXTERNAL_GLOBAL, llvm::wasm::WASM_NAMES_FUNCTION, llvm::wasm::WASM_OPCODE_END, llvm::wasm::WASM_OPCODE_GET_GLOBAL, llvm::wasm::WASM_OPCODE_I32_CONST, llvm::wasm::WASM_SEC_CODE, llvm::wasm::WASM_SEC_CUSTOM, llvm::wasm::WASM_SEC_DATA, llvm::wasm::WASM_SEC_ELEM, llvm::wasm::WASM_SEC_EXPORT, llvm::wasm::WASM_SEC_FUNCTION, llvm::wasm::WASM_SEC_GLOBAL, llvm::wasm::WASM_SEC_IMPORT, llvm::wasm::WASM_SEC_MEMORY, llvm::wasm::WASM_SEC_TABLE, llvm::wasm::WASM_SEC_TYPE, llvm::wasm::WASM_SEGMENT_INFO, llvm::wasm::WASM_STACK_POINTER, llvm::wasm::WASM_SYMBOL_BINDING_LOCAL, llvm::wasm::WASM_SYMBOL_BINDING_WEAK, llvm::wasm::WASM_SYMBOL_INFO, llvm::wasm::WASM_TYPE_ANYFUNC, llvm::wasm::WASM_TYPE_FUNC, llvm::wasm::WasmPageSize, WriteI32(), WritePatchableLEB(), WritePatchableSLEB(), and llvm::MCAssembler::writeSectionData().

◆ ResolveSymbol()

static const MCSymbolWasm* ResolveSymbol ( const MCSymbolWasm Symbol)
static

◆ WriteI32()

static void WriteI32 ( raw_pwrite_stream Stream,
uint32_t  X,
uint64_t  Offset 
)
static

Definition at line 467 of file WasmObjectWriter.cpp.

References llvm::raw_pwrite_stream::pwrite(), and llvm::support::endian::write32le().

Referenced by addData().

◆ WritePatchableLEB()

static void WritePatchableLEB ( raw_pwrite_stream Stream,
uint32_t  X,
uint64_t  Offset 
)
static

Definition at line 449 of file WasmObjectWriter.cpp.

References assert(), llvm::encodeULEB128(), and llvm::raw_pwrite_stream::pwrite().

Referenced by addData().

◆ WritePatchableSLEB()

static void WritePatchableSLEB ( raw_pwrite_stream Stream,
int32_t  X,
uint64_t  Offset 
)
static

Definition at line 459 of file WasmObjectWriter.cpp.

References assert(), llvm::encodeSLEB128(), and llvm::raw_pwrite_stream::pwrite().

Referenced by addData().