Index: lld/trunk/wasm/SymbolTable.cpp =================================================================== --- lld/trunk/wasm/SymbolTable.cpp +++ lld/trunk/wasm/SymbolTable.cpp @@ -86,9 +86,9 @@ // First check the symbol types match (i.e. either both are function // symbols or both are data symbols). - if (Existing.isFunction() != NewIsFunction) { + if (isa(Existing) != NewIsFunction) { error("symbol type mismatch: " + Existing.getName() + "\n>>> defined as " + - (Existing.isFunction() ? "Function" : "Global") + " in " + + (isa(Existing) ? "Function" : "Global") + " in " + toString(Existing.getFile()) + "\n>>> defined as " + (NewIsFunction ? "Function" : "Global") + " in " + F.getName()); return; Index: lld/trunk/wasm/Symbols.h =================================================================== --- lld/trunk/wasm/Symbols.h +++ lld/trunk/wasm/Symbols.h @@ -49,11 +49,6 @@ return SymbolKind == UndefinedGlobalKind || SymbolKind == UndefinedFunctionKind; } - bool isFunction() const { - return SymbolKind == DefinedFunctionKind || - SymbolKind == UndefinedFunctionKind; - } - bool isGlobal() const { return !isFunction(); } bool isLocal() const; bool isWeak() const; bool isHidden() const; Index: lld/trunk/wasm/Symbols.cpp =================================================================== --- lld/trunk/wasm/Symbols.cpp +++ lld/trunk/wasm/Symbols.cpp @@ -100,7 +100,6 @@ } uint32_t DefinedGlobal::getVirtualAddress() const { - assert(isGlobal()); DEBUG(dbgs() << "getVirtualAddress: " << getName() << "\n"); return Chunk ? dyn_cast(Chunk)->translateVA(VirtualAddress) : VirtualAddress; @@ -108,7 +107,6 @@ void DefinedGlobal::setVirtualAddress(uint32_t Value) { DEBUG(dbgs() << "setVirtualAddress " << Name << " -> " << Value << "\n"); - assert(isGlobal()); VirtualAddress = Value; } Index: lld/trunk/wasm/Writer.cpp =================================================================== --- lld/trunk/wasm/Writer.cpp +++ lld/trunk/wasm/Writer.cpp @@ -290,7 +290,7 @@ WasmExport Export; Export.Name = E.FieldName; Export.Index = E.Sym->getOutputIndex(); - if (E.Sym->isFunction()) + if (isa(E.Sym)) Export.Kind = WASM_EXTERNAL_FUNCTION; else Export.Kind = WASM_EXTERNAL_GLOBAL; @@ -660,7 +660,7 @@ for (Symbol *Sym : File->getSymbols()) { if (!Sym->isDefined() || File != Sym->getFile()) continue; - if (Sym->isGlobal()) + if (isa(Sym)) continue; if (!Sym->getChunk()->Live) continue;