Simplify the code so that we can use in InputChunk pointer
rather than an InputFunction + InputSegment depending
on the symbol type.
Use llvm dynamic casts when we need a particular subtype.
This change is useful for the upcoming gc-section support
which wants to deal with all input chunks in the same way.
nit: WasmSignature* Sig -> WasmSignature *Sig