|
15 | 15 | #include "lld/Common/Args.h" |
16 | 16 | #include "lld/Common/CommonLinkerContext.h" |
17 | 17 | #include "lld/Common/Reproduce.h" |
| 18 | +#include "llvm/BinaryFormat/Wasm.h" |
18 | 19 | #include "llvm/Object/Binary.h" |
19 | 20 | #include "llvm/Object/Wasm.h" |
20 | 21 | #include "llvm/Support/Path.h" |
@@ -322,20 +323,19 @@ void ObjFile::addLegacyIndirectFunctionTableIfNeeded( |
322 | 323 | return; |
323 | 324 | } |
324 | 325 |
|
325 | | - auto *info = make<WasmSymbolInfo>(); |
326 | | - info->Name = tableImport->Field; |
327 | | - info->Kind = WASM_SYMBOL_TYPE_TABLE; |
328 | | - info->ImportModule = tableImport->Module; |
329 | | - info->ImportName = tableImport->Field; |
330 | | - info->Flags = WASM_SYMBOL_UNDEFINED; |
331 | | - info->Flags |= WASM_SYMBOL_NO_STRIP; |
332 | | - info->ElementIndex = 0; |
333 | | - LLVM_DEBUG(dbgs() << "Synthesizing symbol for table import: " << info->Name |
| 326 | + WasmSymbolInfo info; |
| 327 | + info.Name = tableImport->Field; |
| 328 | + info.Kind = WASM_SYMBOL_TYPE_TABLE; |
| 329 | + info.ImportModule = tableImport->Module; |
| 330 | + info.ImportName = tableImport->Field; |
| 331 | + info.Flags = WASM_SYMBOL_UNDEFINED | WASM_SYMBOL_NO_STRIP; |
| 332 | + info.ElementIndex = 0; |
| 333 | + LLVM_DEBUG(dbgs() << "Synthesizing symbol for table import: " << info.Name |
334 | 334 | << "\n"); |
335 | 335 | const WasmGlobalType *globalType = nullptr; |
336 | 336 | const WasmSignature *signature = nullptr; |
337 | 337 | auto *wasmSym = |
338 | | - make<WasmSymbol>(*info, globalType, &tableImport->Table, signature); |
| 338 | + make<WasmSymbol>(info, globalType, &tableImport->Table, signature); |
339 | 339 | Symbol *sym = createUndefined(*wasmSym, false); |
340 | 340 | // We're only sure it's a TableSymbol if the createUndefined succeeded. |
341 | 341 | if (errorCount()) |
|
0 commit comments