[PATCH] D41315: [WebAssembly] Output functions individually

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 11:09:48 PST 2017


sbc100 added inline comments.


================
Comment at: wasm/InputFiles.h:119-120
   Symbol *createDefined(const WasmSymbol &Sym,
-                        const InputSegment *Segment = nullptr);
-  Symbol *createUndefined(const WasmSymbol &Sym);
+                        const InputSegment *Segment = nullptr,
+                        InputFunction *Function = nullptr);
+  Symbol *createUndefined(const WasmSymbol &Sym,
----------------
sbc100 wrote:
> ncw wrote:
> > ruiu wrote:
> > > What is a relation between Segment and Function? Is Function a type of Segment?
> > A "segment" is a data segment (a section containing data rather than text). When createDefined is used to make a function symbol, Function will not non-null and Segment null; and vice-versa when it's used for making symbols that refer to global variables, which have an associate segment containing the initial value.
> In the wasm format the CODE section is made up of a sequence of functions (essentially blobs of wasm code).  Whereas the DATA section is made up of a sequence of data segments.   We could try to treat these to equally in the abstraction here, but unlike ELF they are represented in the same way.
Sorry, I meant to say: they are *not* represented in the same way.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41315





More information about the llvm-commits mailing list