LLVM  9.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/Config/llvm-config.h"
#include "llvm/MC/MCAsmBackend.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/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 const MCSymbolWasmresolveSymbol (const MCSymbolWasm &Symbol)
 
static void addData (SmallVectorImpl< char > &DataBytes, MCSectionWasm &DataSection)
 
static bool isInSymtab (const MCSymbolWasm &Sym)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mc"

Definition at line 37 of file WasmObjectWriter.cpp.

Function Documentation

◆ addData()

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

Definition at line 618 of file WasmObjectWriter.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::alignTo(), assert(), B, llvm::SmallVectorTemplateCommon< T, typename >::begin(), C, llvm::dbgs(), llvm::ArrayRef< T >::empty(), llvm::encodeSLEB128(), llvm::encodeULEB128(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::errs(), llvm::Export, llvm::MCSection::getAlignment(), llvm::MCSectionWasm::getSectionName(), llvm::MCSymbolWasm::getSignature(), llvm::Import, llvm::SmallVectorImpl< T >::insert(), llvm::MCSymbolWasm::isEvent(), llvm::MCSymbolWasm::isFunction(), LLVM_DEBUG, llvm_unreachable, llvm::report_fatal_error(), llvm::SmallVectorImpl< T >::resize(), resolveSymbol(), llvm::ARMBuildAttrs::Section, Size, llvm::SmallVectorBase::size(), llvm::ArrayRef< T >::size(), llvm::StringRef::str(), llvm::ARMBuildAttrs::Symbol, llvm::RISCVFenceField::W, llvm::wasm::WASM_COMDAT_INFO, llvm::wasm::WASM_EXTERNAL_EVENT, llvm::wasm::WASM_EXTERNAL_FUNCTION, llvm::wasm::WASM_EXTERNAL_GLOBAL, llvm::wasm::WASM_EXTERNAL_MEMORY, llvm::wasm::WASM_EXTERNAL_TABLE, llvm::wasm::WASM_INIT_FUNCS, llvm::wasm::WASM_OPCODE_END, llvm::wasm::WASM_OPCODE_I32_CONST, llvm::wasm::WASM_SEC_CODE, llvm::wasm::WASM_SEC_DATA, llvm::wasm::WASM_SEC_ELEM, llvm::wasm::WASM_SEC_EVENT, llvm::wasm::WASM_SEC_EXPORT, llvm::wasm::WASM_SEC_FUNCTION, llvm::wasm::WASM_SEC_GLOBAL, llvm::wasm::WASM_SEC_IMPORT, llvm::wasm::WASM_SEC_TYPE, llvm::wasm::WASM_SEGMENT_HAS_MEMINDEX, llvm::wasm::WASM_SEGMENT_INFO, llvm::wasm::WASM_SEGMENT_IS_PASSIVE, llvm::wasm::WASM_SYMBOL_EXPLICIT_NAME, llvm::wasm::WASM_SYMBOL_TABLE, llvm::wasm::WASM_SYMBOL_TYPE_DATA, llvm::wasm::WASM_SYMBOL_TYPE_EVENT, llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION, llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL, llvm::wasm::WASM_SYMBOL_TYPE_SECTION, llvm::wasm::WASM_SYMBOL_UNDEFINED, llvm::wasm::WASM_TYPE_FUNC, llvm::wasm::WasmMetadataVersion, llvm::wasm::WasmPageSize, and llvm::MCAssembler::writeSectionData().

Referenced by isInSymtab().

◆ isInSymtab()

static bool isInSymtab ( const MCSymbolWasm Sym)
static

Definition at line 1127 of file WasmObjectWriter.cpp.

References addData(), llvm::alignTo(), assert(), llvm::wasm::WasmEventType::Attribute, C, llvm::wasm::WasmSymbolInfo::DataRef, llvm::dbgs(), llvm::wasm::WasmSymbolInfo::ElementIndex, llvm::SmallVectorImpl< T >::emplace_back(), llvm::StringRef::empty(), llvm::wasm::WasmImport::Event, llvm::wasm::WasmImport::Field, llvm::wasm::WasmSymbolInfo::Flags, llvm::MCFragment::FT_Align, llvm::MCFragment::FT_Data, llvm::MCAssembler::getContext(), llvm::MCFragment::getKind(), llvm::MCSymbol::getName(), llvm::Value::getName(), llvm::MCContext::getOrCreateSymbol(), llvm::MCSymbolWasm::getSize(), llvm::MCAsmLayout::getSymbolOffset(), llvm::wasm::WasmImport::Global, llvm::MCFragment::hasInstructions(), llvm::Import, Info, is64Bit(), llvm::MCSymbolWasm::isComdat(), llvm::MCSymbolWasm::isData(), llvm::MCSymbol::isDefined(), llvm::MCSymbolWasm::isSection(), llvm::MCSymbol::isTemporary(), llvm::MCSymbol::isUsedInReloc(), IT, llvm::wasm::WasmImport::Kind, llvm::wasm::WasmSymbolInfo::Kind, LLVM_DEBUG, llvm::Log2_32(), llvm::wasm::WasmImport::Module, llvm::wasm::WasmSymbolInfo::Name, Name, P, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Ref, llvm::report_fatal_error(), resolveSymbol(), llvm::ARMBuildAttrs::Section, AMDGPU::ElfNote::SectionName, llvm::MCSymbol::setIndex(), llvm::wasm::WasmEventType::SigIndex, llvm::wasm::WasmImport::SigIndex, Size, llvm::SmallVectorBase::size(), llvm::StringRef::startswith(), llvm::MCAssembler::symbols(), llvm::toString(), llvm::RISCVFenceField::W, llvm::wasm::WASM_COMDAT_DATA, llvm::wasm::WASM_COMDAT_FUNCTION, llvm::wasm::WASM_EVENT_ATTRIBUTE_EXCEPTION, llvm::wasm::WASM_EXTERNAL_EVENT, llvm::wasm::WASM_EXTERNAL_FUNCTION, llvm::wasm::WASM_EXTERNAL_GLOBAL, llvm::wasm::WASM_EXTERNAL_MEMORY, llvm::wasm::WASM_EXTERNAL_TABLE, llvm::wasm::WASM_SEGMENT_IS_PASSIVE, llvm::wasm::WASM_SYMBOL_BINDING_LOCAL, llvm::wasm::WASM_SYMBOL_BINDING_WEAK, llvm::wasm::WASM_SYMBOL_EXPLICIT_NAME, llvm::wasm::WASM_SYMBOL_EXPORTED, llvm::wasm::WASM_SYMBOL_UNDEFINED, llvm::wasm::WASM_SYMBOL_VISIBILITY_HIDDEN, and llvm::wasm::WASM_TYPE_FUNCREF.

Referenced by isWeak().

◆ resolveSymbol()

static const MCSymbolWasm* resolveSymbol ( const MCSymbolWasm Symbol)
static