This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Split addDefined into two different methods. NFC.
ClosedPublic

Authored by sbc100 on Feb 19 2018, 5:22 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Feb 19 2018, 5:22 PM
sbc100 updated this revision to Diff 134998.Feb 19 2018, 5:24 PM
  • make static
sbc100 added a reviewer: ruiu.Feb 19 2018, 5:24 PM
ruiu added inline comments.Feb 19 2018, 8:21 PM
wasm/SymbolTable.cpp
150 ↗(On Diff #134998)

We can just pass File, Flags, Chunk and IsFunction to this class, then we don't need NewSymbol class, no?

sbc100 added inline comments.Feb 20 2018, 9:55 AM
wasm/SymbolTable.cpp
150 ↗(On Diff #134998)

(I assume you mean "..to this function).

Thats how it was before but I found it easier to read this way, since all the properties of the new symbol are under New this way, and i makes the call site a little more readable (to me). I can revert if you prefer.

Also, the symbol table change is going to add another field (or anther param) here for input global (that don't use chunks).

ruiu added inline comments.Feb 20 2018, 10:00 AM
wasm/SymbolTable.cpp
150 ↗(On Diff #134998)

It feels a bit odd to me to define a struct to pack four arguments into one argument, so let's avoid doing that. If you prefer, you could name these parameters NewFile, NewFlags, NewChunk and NewIsFunction so that you could use them instead of New.File, New.Flags, New.Chunk and New.IsFunction.

sbc100 updated this revision to Diff 135102.Feb 20 2018, 10:50 AM
  • feedback
ruiu accepted this revision.Feb 20 2018, 10:53 AM

LGTM

This revision is now accepted and ready to land.Feb 20 2018, 10:53 AM
This revision was automatically updated to reflect the committed changes.