[PATCH] D65911: [lld][WebAssembly] Use createGlobalVariable helper function. NFC.
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 16:26:47 PDT 2019
sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 added a reviewer: ruiu.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D65911
Files:
lld/wasm/Driver.cpp
Index: lld/wasm/Driver.cpp
===================================================================
--- lld/wasm/Driver.cpp
+++ lld/wasm/Driver.cpp
@@ -510,19 +510,9 @@
WasmSym::memoryBase->markLive();
WasmSym::tableBase->markLive();
} else {
- llvm::wasm::WasmGlobal global;
- global.Type = {WASM_TYPE_I32, true};
- global.InitExpr.Value.Int32 = 0;
- global.InitExpr.Opcode = WASM_OPCODE_I32_CONST;
- global.SymbolName = "__stack_pointer";
- auto *stackPointer = make<InputGlobal>(global, nullptr);
- stackPointer->live = true;
// For non-PIC code
- // TODO(sbc): Remove WASM_SYMBOL_VISIBILITY_HIDDEN when the mutable global
- // spec proposal is implemented in all major browsers.
- // See: https://github.com/WebAssembly/mutable-global
- WasmSym::stackPointer = symtab->addSyntheticGlobal(
- "__stack_pointer", WASM_SYMBOL_VISIBILITY_HIDDEN, stackPointer);
+ WasmSym::stackPointer = createGlobalVariable("__stack_pointer", true, 0);
+ WasmSym::stackPointer->markLive();
WasmSym::globalBase = symtab->addOptionalDataSymbol("__global_base");
WasmSym::heapBase = symtab->addOptionalDataSymbol("__heap_base");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65911.214031.patch
Type: text/x-patch
Size: 1183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190807/7e8b0424/attachment-0001.bin>
More information about the llvm-commits
mailing list