[WebAssemly] Associate symbol with InputChunk in which they are defined. NFC.

Summary:
Rather than explicit Function or InputSegment points store a
pointer to the base class (InputChunk) and use llvm dynamic
casts when we need a subtype.

This change is useful for add the upcoming gc-section support
wants to deal with all input chunks.

Subscribers: aheejin, llvm-commits

Differential Revision: https://reviews.llvm.org/D42625

llvm-svn: 323621
This commit is contained in:
Sam Clegg
2018-01-28 19:57:01 +00:00
parent b5885118f4
commit 24b3dcd4bf
8 changed files with 58 additions and 48 deletions

View File

@@ -648,7 +648,7 @@ void Writer::calculateExports() {
continue;
if (Sym->isGlobal())
continue;
if (Sym->getFunction()->Discarded)
if (Sym->getChunk()->Discarded)
continue;
if ((Sym->isHidden() || Sym->isLocal()) && !ExportHidden)