diff options
author | Dan Gohman <dan433584@gmail.com> | 2019-02-01 22:27:34 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2019-02-01 22:27:34 +0000 |
commit | f726e4454c55d55d37bd1a05065fc392d89e05c8 (patch) | |
tree | f9b73f3aa270d37fa71e0859fe0d83b040f62b1e /llvm/lib/MC/WasmObjectWriter.cpp | |
parent | cae8459ad2d4cce5806bc8d64ef0020bc20e3252 (diff) | |
download | bcm5719-llvm-f726e4454c55d55d37bd1a05065fc392d89e05c8.tar.gz bcm5719-llvm-f726e4454c55d55d37bd1a05065fc392d89e05c8.zip |
[WebAssembly] Add codegen support for the import_field attribute
This adds the LLVM side of https://reviews.llvm.org/D57602 -- the
import_field attribute. See that patch for details.
Differential Revision: https://reviews.llvm.org/D57603
llvm-svn: 352931
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/WasmObjectWriter.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index 83ac9a44dc4..4747bb5ec8f 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -1167,8 +1167,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, MCSymbolWasm *MemorySym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol("__linear_memory")); wasm::WasmImport MemImport; - MemImport.Module = MemorySym->getModuleName(); - MemImport.Field = MemorySym->getName(); + MemImport.Module = MemorySym->getImportModule(); + MemImport.Field = MemorySym->getImportName(); MemImport.Kind = wasm::WASM_EXTERNAL_MEMORY; Imports.push_back(MemImport); @@ -1178,8 +1178,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, MCSymbolWasm *TableSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol("__indirect_function_table")); wasm::WasmImport TableImport; - TableImport.Module = TableSym->getModuleName(); - TableImport.Field = TableSym->getName(); + TableImport.Module = TableSym->getImportModule(); + TableImport.Field = TableSym->getImportName(); TableImport.Kind = wasm::WASM_EXTERNAL_TABLE; TableImport.Table.ElemType = wasm::WASM_TYPE_FUNCREF; Imports.push_back(TableImport); @@ -1205,8 +1205,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, if (!WS.isDefined() && !WS.isComdat()) { if (WS.isFunction()) { wasm::WasmImport Import; - Import.Module = WS.getModuleName(); - Import.Field = WS.getName(); + Import.Module = WS.getImportModule(); + Import.Field = WS.getImportName(); Import.Kind = wasm::WASM_EXTERNAL_FUNCTION; Import.SigIndex = getFunctionType(WS); Imports.push_back(Import); @@ -1216,8 +1216,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, report_fatal_error("undefined global symbol cannot be weak"); wasm::WasmImport Import; - Import.Module = WS.getModuleName(); - Import.Field = WS.getName(); + Import.Module = WS.getImportModule(); + Import.Field = WS.getImportName(); Import.Kind = wasm::WASM_EXTERNAL_GLOBAL; Import.Global = WS.getGlobalType(); Imports.push_back(Import); @@ -1227,8 +1227,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, report_fatal_error("undefined event symbol cannot be weak"); wasm::WasmImport Import; - Import.Module = WS.getModuleName(); - Import.Field = WS.getName(); + Import.Module = WS.getImportModule(); + Import.Field = WS.getImportName(); Import.Kind = wasm::WASM_EXTERNAL_EVENT; Import.Event.Attribute = wasm::WASM_EVENT_ATTRIBUTE_EXCEPTION; Import.Event.SigIndex = getEventType(WS); |