Lines Matching refs:existing
139 static void reportTypeError(const Symbol *existing, const InputFile *file, in reportTypeError() argument
141 error("symbol type mismatch: " + toString(*existing) + "\n>>> defined as " + in reportTypeError()
142 toString(existing->getWasmType()) + " in " + in reportTypeError()
143 toString(existing->getFile()) + "\n>>> defined as " + toString(type) + in reportTypeError()
150 static bool signatureMatches(FunctionSymbol *existing, in signatureMatches() argument
152 const WasmSignature *oldSig = existing->signature; in signatureMatches()
163 static void checkGlobalType(const Symbol *existing, const InputFile *file, in checkGlobalType() argument
165 if (!isa<GlobalSymbol>(existing)) { in checkGlobalType()
166 reportTypeError(existing, file, WASM_SYMBOL_TYPE_GLOBAL); in checkGlobalType()
170 const WasmGlobalType *oldType = cast<GlobalSymbol>(existing)->getGlobalType(); in checkGlobalType()
172 error("Global type mismatch: " + existing->getName() + "\n>>> defined as " + in checkGlobalType()
173 toString(*oldType) + " in " + toString(existing->getFile()) + in checkGlobalType()
178 static void checkTagType(const Symbol *existing, const InputFile *file, in checkTagType() argument
180 const auto *existingTag = dyn_cast<TagSymbol>(existing); in checkTagType()
181 if (!isa<TagSymbol>(existing)) { in checkTagType()
182 reportTypeError(existing, file, WASM_SYMBOL_TYPE_TAG); in checkTagType()
188 warn("Tag signature mismatch: " + existing->getName() + in checkTagType()
190 toString(existing->getFile()) + "\n>>> defined as " + in checkTagType()
194 static void checkTableType(const Symbol *existing, const InputFile *file, in checkTableType() argument
196 if (!isa<TableSymbol>(existing)) { in checkTableType()
197 reportTypeError(existing, file, WASM_SYMBOL_TYPE_TABLE); in checkTableType()
201 const WasmTableType *oldType = cast<TableSymbol>(existing)->getTableType(); in checkTableType()
203 error("Table type mismatch: " + existing->getName() + "\n>>> defined as " + in checkTableType()
204 toString(*oldType) + " in " + toString(existing->getFile()) + in checkTableType()
210 static void checkDataType(const Symbol *existing, const InputFile *file) { in checkDataType() argument
211 if (!isa<DataSymbol>(existing)) in checkDataType()
212 reportTypeError(existing, file, WASM_SYMBOL_TYPE_DATA); in checkDataType()
284 static bool shouldReplace(const Symbol *existing, InputFile *newFile, in shouldReplace() argument
287 if (!existing->isDefined()) { in shouldReplace()
289 << existing->getName() << "\n"); in shouldReplace()
300 if (existing->isWeak()) { in shouldReplace()
306 error("duplicate symbol: " + toString(*existing) + "\n>>> defined in " + in shouldReplace()
307 toString(existing->getFile()) + "\n>>> defined in " + in shouldReplace()
472 static void setImportAttributes(T *existing, in setImportAttributes() argument
477 if (!existing->importName) in setImportAttributes()
478 existing->importName = importName; in setImportAttributes()
479 if (existing->importName != importName) in setImportAttributes()
480 error("import name mismatch for symbol: " + toString(*existing) + in setImportAttributes()
481 "\n>>> defined as " + *existing->importName + " in " + in setImportAttributes()
482 toString(existing->getFile()) + "\n>>> defined as " + *importName + in setImportAttributes()
487 if (!existing->importModule) in setImportAttributes()
488 existing->importModule = importModule; in setImportAttributes()
489 if (existing->importModule != importModule) in setImportAttributes()
490 error("import module mismatch for symbol: " + toString(*existing) + in setImportAttributes()
491 "\n>>> defined as " + *existing->importModule + " in " + in setImportAttributes()
492 toString(existing->getFile()) + "\n>>> defined as " + in setImportAttributes()
498 if (existing->isWeak() && binding != WASM_SYMBOL_BINDING_WEAK) { in setImportAttributes()
499 existing->flags = (existing->flags & ~WASM_SYMBOL_BINDING_MASK) | binding; in setImportAttributes()
696 Symbol *existing = find(functionTableName); in resolveIndirectFunctionTable() local
697 if (existing) { in resolveIndirectFunctionTable()
698 if (!isa<TableSymbol>(existing)) { in resolveIndirectFunctionTable()
703 if (existing->isDefined()) { in resolveIndirectFunctionTable()
711 if (existing) in resolveIndirectFunctionTable()
712 return cast<TableSymbol>(existing); in resolveIndirectFunctionTable()
715 } else if ((existing && existing->isLive()) || config->exportTable || in resolveIndirectFunctionTable()