|
From: Philipp K. K. <pk...@sp...> - 2025-10-23 16:12:47
|
Am 23.10.25 um 17:54 schrieb "Janko Stamenović" via sdcc-devel: > Hopefully such checks are done by external tools and not by a > compiler, as I can imagine a combinatorial explosion of testing > what is similar to what, especially in projects with huge headers? I don't think there'd be an explosion. Any identifier encountered needs to be tested against all previous ones anyway (to check if they are the same). Unless hat is done via a hash map, binary tree or such, this is already a number of string comparions quadratic in the number of strings (SDCC AFAIK does currently use a hash map, but into an array of fixed size, so we still have asymptotically quadratic effort). The change would be replacing the strcmp() comparison with a more complicated one considering homoglyphs, but in the end, most pairs of identifiers would still differ early. So still negligible effort compared to other compiler stages. Philipp |