Lines Matching refs:existing
133 static void reportTypeError(const Symbol *existing, const InputFile *file, in reportTypeError() argument
135 error("symbol type mismatch: " + toString(*existing) + "\n>>> defined as " + in reportTypeError()
136 toString(existing->getWasmType()) + " in " + in reportTypeError()
137 toString(existing->getFile()) + "\n>>> defined as " + toString(type) + in reportTypeError()
144 static bool signatureMatches(FunctionSymbol *existing, in signatureMatches() argument
146 const WasmSignature *oldSig = existing->signature; in signatureMatches()
157 static void checkGlobalType(const Symbol *existing, const InputFile *file, in checkGlobalType() argument
159 if (!isa<GlobalSymbol>(existing)) { in checkGlobalType()
160 reportTypeError(existing, file, WASM_SYMBOL_TYPE_GLOBAL); in checkGlobalType()
164 const WasmGlobalType *oldType = cast<GlobalSymbol>(existing)->getGlobalType(); in checkGlobalType()
166 error("Global type mismatch: " + existing->getName() + "\n>>> defined as " + in checkGlobalType()
167 toString(*oldType) + " in " + toString(existing->getFile()) + in checkGlobalType()
172 static void checkEventType(const Symbol *existing, const InputFile *file, in checkEventType() argument
175 auto existingEvent = dyn_cast<EventSymbol>(existing); in checkEventType()
176 if (!isa<EventSymbol>(existing)) { in checkEventType()
177 reportTypeError(existing, file, WASM_SYMBOL_TYPE_EVENT); in checkEventType()
181 const WasmEventType *oldType = cast<EventSymbol>(existing)->getEventType(); in checkEventType()
184 error("Event type mismatch: " + existing->getName() + "\n>>> defined as " + in checkEventType()
185 toString(*oldType) + " in " + toString(existing->getFile()) + in checkEventType()
188 warn("Event signature mismatch: " + existing->getName() + in checkEventType()
190 toString(existing->getFile()) + "\n>>> defined as " + in checkEventType()
194 static void checkDataType(const Symbol *existing, const InputFile *file) { in checkDataType() argument
195 if (!isa<DataSymbol>(existing)) in checkDataType()
196 reportTypeError(existing, file, WASM_SYMBOL_TYPE_DATA); in checkDataType()
256 static bool shouldReplace(const Symbol *existing, InputFile *newFile, in shouldReplace() argument
259 if (!existing->isDefined()) { in shouldReplace()
261 << existing->getName() << "\n"); in shouldReplace()
272 if (existing->isWeak()) { in shouldReplace()
278 error("duplicate symbol: " + toString(*existing) + "\n>>> defined in " + in shouldReplace()
279 toString(existing->getFile()) + "\n>>> defined in " + in shouldReplace()
420 static void setImportAttributes(T *existing, Optional<StringRef> importName, in setImportAttributes() argument
424 if (!existing->importName) in setImportAttributes()
425 existing->importName = importName; in setImportAttributes()
426 if (existing->importName != importName) in setImportAttributes()
427 error("import name mismatch for symbol: " + toString(*existing) + in setImportAttributes()
428 "\n>>> defined as " + *existing->importName + " in " + in setImportAttributes()
429 toString(existing->getFile()) + "\n>>> defined as " + *importName + in setImportAttributes()
434 if (!existing->importModule) in setImportAttributes()
435 existing->importModule = importModule; in setImportAttributes()
436 if (existing->importModule != importModule) in setImportAttributes()
437 error("import module mismatch for symbol: " + toString(*existing) + in setImportAttributes()
438 "\n>>> defined as " + *existing->importModule + " in " + in setImportAttributes()
439 toString(existing->getFile()) + "\n>>> defined as " + in setImportAttributes()
445 if (existing->isWeak() && binding != WASM_SYMBOL_BINDING_WEAK) { in setImportAttributes()
446 existing->flags = (existing->flags & ~WASM_SYMBOL_BINDING_MASK) | binding; in setImportAttributes()