[PATCH] D65911: [lld][WebAssembly] Use createGlobalVariable helper function. NFC.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 11:24:44 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL368325: [lld][WebAssembly] Use createGlobalVariable helper function. NFC. (authored by sbc, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65911?vs=214031&id=214198#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65911/new/

https://reviews.llvm.org/D65911

Files:
  lld/trunk/wasm/Driver.cpp


Index: lld/trunk/wasm/Driver.cpp
===================================================================
--- lld/trunk/wasm/Driver.cpp
+++ lld/trunk/wasm/Driver.cpp
@@ -508,19 +508,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();
   }
 
   if (config->sharedMemory && !config->shared) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65911.214198.patch
Type: text/x-patch
Size: 1107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/fb80e456/attachment.bin>


More information about the llvm-commits mailing list