[PATCH] D41315: [WebAssembly] Output functions individually

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 15:19:59 PST 2018

sbc100 added a comment.

@ruiu  PTAL.     This change is needed before I can land  https://reviews.llvm.org/D41426

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:
> 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.
I have a followup change that unifies these two with single base class

  rLLD LLVM Linker


More information about the llvm-commits mailing list