diff options
author | Dan Gohman <dev@sunfishcode.online> | 2022-08-31 11:41:25 -0700 |
---|---|---|
committer | Dan Gohman <dev@sunfishcode.online> | 2022-08-31 15:30:15 -0700 |
commit | 9f049e999308c43360fbe1513a772b818745addb (patch) | |
tree | 8245126c243f9f08919544dd30b2b4ec7ea92793 /llvm/lib/Object/WasmObjectFile.cpp | |
parent | 7e52e0fc723e8b45cfc1eaf2ebbe8f6d89e4e7f2 (diff) | |
download | llvm-9f049e999308c43360fbe1513a772b818745addb.zip llvm-9f049e999308c43360fbe1513a772b818745addb.tar.gz llvm-9f049e999308c43360fbe1513a772b818745addb.tar.bz2 |
[lld][WebAssemby] Allow import module names to be empty strings.
The component-model [canonical ABI] is currently using import names with
empty strings. Remove the special cases for empty strings from
WasmObjectFile.cpp so that they can pass through as-is.
[canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
Differential Revision: https://reviews.llvm.org/D133037
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/WasmObjectFile.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index d00359c..0e24ac9 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -640,9 +640,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) { Info.Name = Import.Field; } Signature = &Signatures[Import.SigIndex]; - if (!Import.Module.empty()) { - Info.ImportModule = Import.Module; - } + Info.ImportModule = Import.Module; } break; @@ -672,9 +670,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) { Info.Name = Import.Field; } GlobalType = &Import.Global; - if (!Import.Module.empty()) { - Info.ImportModule = Import.Module; - } + Info.ImportModule = Import.Module; } break; @@ -704,9 +700,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) { Info.Name = Import.Field; } TableType = &Import.Table; - if (!Import.Module.empty()) { - Info.ImportModule = Import.Module; - } + Info.ImportModule = Import.Module; } break; @@ -769,9 +763,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) { Info.Name = Import.Field; } Signature = &Signatures[Import.SigIndex]; - if (!Import.Module.empty()) { - Info.ImportModule = Import.Module; - } + Info.ImportModule = Import.Module; } break; } |