Lines Matching refs:existing
131 static void reportTypeError(const Symbol *existing, const InputFile *file, in reportTypeError() argument
133 error("symbol type mismatch: " + toString(*existing) + "\n>>> defined as " + in reportTypeError()
134 toString(existing->getWasmType()) + " in " + in reportTypeError()
135 toString(existing->getFile()) + "\n>>> defined as " + toString(type) + in reportTypeError()
142 static bool signatureMatches(FunctionSymbol *existing, in signatureMatches() argument
144 const WasmSignature *oldSig = existing->signature; in signatureMatches()
155 static void checkGlobalType(const Symbol *existing, const InputFile *file, in checkGlobalType() argument
157 if (!isa<GlobalSymbol>(existing)) { in checkGlobalType()
158 reportTypeError(existing, file, WASM_SYMBOL_TYPE_GLOBAL); in checkGlobalType()
162 const WasmGlobalType *oldType = cast<GlobalSymbol>(existing)->getGlobalType(); in checkGlobalType()
164 error("Global type mismatch: " + existing->getName() + "\n>>> defined as " + in checkGlobalType()
165 toString(*oldType) + " in " + toString(existing->getFile()) + in checkGlobalType()
170 static void checkTagType(const Symbol *existing, const InputFile *file, in checkTagType() argument
172 const auto *existingTag = dyn_cast<TagSymbol>(existing); in checkTagType()
173 if (!isa<TagSymbol>(existing)) { in checkTagType()
174 reportTypeError(existing, file, WASM_SYMBOL_TYPE_TAG); in checkTagType()
180 warn("Tag signature mismatch: " + existing->getName() + in checkTagType()
182 toString(existing->getFile()) + "\n>>> defined as " + in checkTagType()
186 static void checkTableType(const Symbol *existing, const InputFile *file, in checkTableType() argument
188 if (!isa<TableSymbol>(existing)) { in checkTableType()
189 reportTypeError(existing, file, WASM_SYMBOL_TYPE_TABLE); in checkTableType()
193 const WasmTableType *oldType = cast<TableSymbol>(existing)->getTableType(); in checkTableType()
195 error("Table type mismatch: " + existing->getName() + "\n>>> defined as " + in checkTableType()
196 toString(*oldType) + " in " + toString(existing->getFile()) + in checkTableType()
202 static void checkDataType(const Symbol *existing, const InputFile *file) { in checkDataType() argument
203 if (!isa<DataSymbol>(existing)) in checkDataType()
204 reportTypeError(existing, file, WASM_SYMBOL_TYPE_DATA); in checkDataType()
276 static bool shouldReplace(const Symbol *existing, InputFile *newFile, in shouldReplace() argument
279 if (!existing->isDefined()) { in shouldReplace()
281 << existing->getName() << "\n"); in shouldReplace()
292 if (existing->isWeak()) { in shouldReplace()
298 error("duplicate symbol: " + toString(*existing) + "\n>>> defined in " + in shouldReplace()
299 toString(existing->getFile()) + "\n>>> defined in " + in shouldReplace()
464 static void setImportAttributes(T *existing, Optional<StringRef> importName, in setImportAttributes() argument
468 if (!existing->importName) in setImportAttributes()
469 existing->importName = importName; in setImportAttributes()
470 if (existing->importName != importName) in setImportAttributes()
471 error("import name mismatch for symbol: " + toString(*existing) + in setImportAttributes()
472 "\n>>> defined as " + *existing->importName + " in " + in setImportAttributes()
473 toString(existing->getFile()) + "\n>>> defined as " + *importName + in setImportAttributes()
478 if (!existing->importModule) in setImportAttributes()
479 existing->importModule = importModule; in setImportAttributes()
480 if (existing->importModule != importModule) in setImportAttributes()
481 error("import module mismatch for symbol: " + toString(*existing) + in setImportAttributes()
482 "\n>>> defined as " + *existing->importModule + " in " + in setImportAttributes()
483 toString(existing->getFile()) + "\n>>> defined as " + in setImportAttributes()
489 if (existing->isWeak() && binding != WASM_SYMBOL_BINDING_WEAK) { in setImportAttributes()
490 existing->flags = (existing->flags & ~WASM_SYMBOL_BINDING_MASK) | binding; in setImportAttributes()
684 Symbol *existing = find(functionTableName); in resolveIndirectFunctionTable() local
685 if (existing) { in resolveIndirectFunctionTable()
686 if (!isa<TableSymbol>(existing)) { in resolveIndirectFunctionTable()
691 if (existing->isDefined()) { in resolveIndirectFunctionTable()
699 if (existing) in resolveIndirectFunctionTable()
700 return cast<TableSymbol>(existing); in resolveIndirectFunctionTable()
703 } else if ((existing && existing->isLive()) || config->exportTable || in resolveIndirectFunctionTable()