summaryrefslogtreecommitdiffstats
path: root/lld/wasm/SymbolTable.h
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-02-28 00:09:22 +0000
committerRui Ueyama <ruiu@google.com>2018-02-28 00:09:22 +0000
commite3498ec56284009a0909220fedab2b610cf831d0 (patch)
treefe954c9bdb35e54d0c997088de382180ecce1310 /lld/wasm/SymbolTable.h
parentfa2fc906d2708be6e868e80fec4806f24dcd6f2b (diff)
downloadbcm5719-llvm-e3498ec56284009a0909220fedab2b610cf831d0.tar.gz
bcm5719-llvm-e3498ec56284009a0909220fedab2b610cf831d0.zip
[WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.
Previously, one function adds all types of undefined symbols. That doesn't fit to the wasm's undefined symbol semantics well because different types of undefined symbols are very different in wasm. As a result, separate control flows merge in this addUndefined function and then separate again for each type. That wasn't easy to read. This patch separates the function into three functions. Now it is pretty clear what we are doing for each undefined symbol type. Differential Revision: https://reviews.llvm.org/D43697 llvm-svn: 326271
Diffstat (limited to 'lld/wasm/SymbolTable.h')
-rw-r--r--lld/wasm/SymbolTable.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h
index 260c857995c..d5ea6ca3602 100644
--- a/lld/wasm/SymbolTable.h
+++ b/lld/wasm/SymbolTable.h
@@ -48,17 +48,20 @@ public:
Symbol *find(StringRef Name);
ObjFile *findComdat(StringRef Name) const;
- Symbol *addDefinedFunction(StringRef Name, uint32_t Flags, InputFile *F,
+ Symbol *addDefinedFunction(StringRef Name, uint32_t Flags, InputFile *File,
InputFunction *Function = nullptr);
- Symbol *addDefinedData(StringRef Name, uint32_t Flags, InputFile *F,
+ Symbol *addDefinedData(StringRef Name, uint32_t Flags, InputFile *File,
InputSegment *Segment = nullptr, uint32_t Address = 0,
uint32_t Size = 0);
- Symbol *addDefinedGlobal(StringRef Name, uint32_t Flags, InputFile *F,
+ Symbol *addDefinedGlobal(StringRef Name, uint32_t Flags, InputFile *File,
InputGlobal *G);
- Symbol *addUndefinedFunction(StringRef Name, const WasmSignature *Type);
- Symbol *addUndefined(StringRef Name, WasmSymbolType Type, uint32_t Flags,
- InputFile *F, const WasmSignature *Signature = nullptr,
- const WasmGlobalType *GlobalType = nullptr);
+
+ Symbol *addUndefinedFunction(StringRef Name, uint32_t Flags, InputFile *File,
+ const WasmSignature *Signature);
+ Symbol *addUndefinedData(StringRef Name, uint32_t Flags, InputFile *File);
+ Symbol *addUndefinedGlobal(StringRef Name, uint32_t Flags, InputFile *File,
+ const WasmGlobalType *Type);
+
void addLazy(ArchiveFile *F, const Archive::Symbol *Sym);
bool addComdat(StringRef Name, ObjFile *);
OpenPOWER on IntegriCloud