From 9f049e999308c43360fbe1513a772b818745addb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 31 Aug 2022 11:41:25 -0700 Subject: [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 --- llvm/lib/Object/WasmObjectFile.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Object/WasmObjectFile.cpp') 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; } -- cgit v1.1