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 {