[PATCH] D43717: [WebAssembly] Make getWasmType a non-member function.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 17:09:48 PST 2018
ruiu updated this revision to Diff 136201.
ruiu added a comment.
- revert everything except getWasmType
https://reviews.llvm.org/D43717
Files:
lld/wasm/Symbols.cpp
Index: lld/wasm/Symbols.cpp
===================================================================
--- lld/wasm/Symbols.cpp
+++ lld/wasm/Symbols.cpp
@@ -30,19 +30,13 @@
DefinedGlobal *WasmSym::StackPointer;
WasmSymbolType Symbol::getWasmType() const {
- switch (SymbolKind) {
- case Symbol::DefinedFunctionKind:
- case Symbol::UndefinedFunctionKind:
+ if (isa<FunctionSymbol>(this))
return llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION;
- case Symbol::DefinedDataKind:
- case Symbol::UndefinedDataKind:
+ if (isa<DataSymbol>(this))
return llvm::wasm::WASM_SYMBOL_TYPE_DATA;
- case Symbol::DefinedGlobalKind:
- case Symbol::UndefinedGlobalKind:
+ if (isa<GlobalSymbol>(this))
return llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL;
- default:
- llvm_unreachable("invalid symbol kind");
- }
+ llvm_unreachable("invalid symbol kind");
}
bool Symbol::hasOutputIndex() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43717.136201.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/8c258d1b/attachment.bin>
More information about the llvm-commits
mailing list