mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 01:31:26 +00:00
[WebAssembly] Remove StackPointerGlobal member variable from the driver.
Since InputGlobal makes a copy of a given object, we can use a temporary object allocated on the stack here. Differential Revision: https://reviews.llvm.org/D43924 llvm-svn: 329337
This commit is contained in:
parent
ac95bb1d52
commit
96ba8befa9
@ -57,7 +57,6 @@ private:
|
||||
void addFile(StringRef Path);
|
||||
void addLibrary(StringRef Name);
|
||||
std::vector<InputFile *> Files;
|
||||
llvm::wasm::WasmGlobal StackPointerGlobal;
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
@ -336,10 +335,11 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
||||
// globals aren't yet supported in the official binary format.
|
||||
// TODO(sbc): Remove WASM_SYMBOL_VISIBILITY_HIDDEN if/when the
|
||||
// "mutable global" proposal is accepted.
|
||||
StackPointerGlobal.Type = {WASM_TYPE_I32, true};
|
||||
StackPointerGlobal.InitExpr.Value.Int32 = 0;
|
||||
StackPointerGlobal.InitExpr.Opcode = WASM_OPCODE_I32_CONST;
|
||||
InputGlobal *StackPointer = make<InputGlobal>(StackPointerGlobal);
|
||||
llvm::wasm::WasmGlobal Global;
|
||||
Global.Type = {WASM_TYPE_I32, true};
|
||||
Global.InitExpr.Value.Int32 = 0;
|
||||
Global.InitExpr.Opcode = WASM_OPCODE_I32_CONST;
|
||||
InputGlobal *StackPointer = make<InputGlobal>(Global);
|
||||
StackPointer->Live = true;
|
||||
|
||||
static WasmSignature NullSignature = {{}, WASM_TYPE_NORESULT};
|
||||
|
Loading…
Reference in New Issue
Block a user