diff options
| author | Sam Clegg <sbc@chromium.org> | 2017-12-07 01:51:24 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2017-12-07 01:51:24 +0000 |
| commit | 74fe0ba10577c2d72ff99290f92151e5e062c112 (patch) | |
| tree | cf037b7c30bbbf3c6b5a89e6a4c0112867e8cb3d /lld/wasm/SymbolTable.h | |
| parent | c325d30d2c31c254768058260423128de0da450b (diff) | |
| download | bcm5719-llvm-74fe0ba10577c2d72ff99290f92151e5e062c112.tar.gz bcm5719-llvm-74fe0ba10577c2d72ff99290f92151e5e062c112.zip | |
[WebAssembly] Fix symbol exports under -r/--relocatable
This change cleans up the way wasm exports and globals
are generated, particualrly for -r/--relocatable where
globals need to be created and exported in order for
output relocations which reference them.
Remove the need for a per file GlobalIndexOffset and
instead set the output index for each symbol directly.
This simplifies the code in several places.
Differential Revision: https://reviews.llvm.org/D40859
llvm-svn: 320001
Diffstat (limited to 'lld/wasm/SymbolTable.h')
| -rw-r--r-- | lld/wasm/SymbolTable.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h index 9dfcb39b5f3..e1e7da120b9 100644 --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -47,6 +47,7 @@ public: void reportDuplicate(Symbol *Existing, InputFile *NewFile); void reportRemainingUndefines(); + ArrayRef<Symbol *> getSymbols() const { return SymVector; } Symbol *find(StringRef Name); Symbol *addDefined(InputFile *F, const WasmSymbol *Sym, @@ -60,6 +61,7 @@ private: std::pair<Symbol *, bool> insert(StringRef Name); llvm::DenseMap<llvm::CachedHashStringRef, Symbol *> SymMap; + std::vector<Symbol *> SymVector; }; extern SymbolTable *Symtab; |

