[PATCH] D44206: [WebAssembly] Create SyntheticFunction for __wasm_call_ctors earlier
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 7 10:30:58 PST 2018
ruiu added a comment.
I'm not sure if this is a good change as a refactoring...
================
Comment at: wasm/Driver.cpp:305
WasmSym::CallCtors = Symtab->addSyntheticFunction(
- "__wasm_call_ctors", &NullSignature, WASM_SYMBOL_VISIBILITY_HIDDEN);
+ CallCtors->getName(), WASM_SYMBOL_VISIBILITY_HIDDEN, CallCtors);
WasmSym::StackPointer = Symtab->addSyntheticGlobal(
----------------
I think you should directly pass `make`'s return value instead because you are using it only once.
================
Comment at: wasm/InputChunks.h:159-160
StringRef getComdat() const override { return StringRef(); }
+ void setBody(ArrayRef<uint8_t> Body_) { Body = Body_; }
+
----------------
I don't actually know if this is a good thing. Currently a syntehtic function is immutable, but now with this change it is mutable. It is not a good thing in general.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D44206
More information about the llvm-commits
mailing list