[lld] r368325 - [lld][WebAssembly] Use createGlobalVariable helper function. NFC.
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 11:22:03 PDT 2019
Author: sbc
Date: Thu Aug 8 11:22:03 2019
New Revision: 368325
URL: http://llvm.org/viewvc/llvm-project?rev=368325&view=rev
Log:
[lld][WebAssembly] Use createGlobalVariable helper function. NFC.
Differential Revision: https://reviews.llvm.org/D65911
Modified:
lld/trunk/wasm/Driver.cpp
Modified: lld/trunk/wasm/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Driver.cpp?rev=368325&r1=368324&r2=368325&view=diff
==============================================================================
--- lld/trunk/wasm/Driver.cpp (original)
+++ lld/trunk/wasm/Driver.cpp Thu Aug 8 11:22:03 2019
@@ -508,19 +508,9 @@ static void createSyntheticSymbols() {
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();
}
if (config->sharedMemory && !config->shared) {
More information about the llvm-commits
mailing list