[SAOC 2025] Improve importC Weekly Update #5
Emmanuel
emmankoko519 at gmail.com
Mon Oct 20 17:16:00 UTC 2025
Hi everyone,
This week, it was a pretty tough time with duplicate symbol of
global redeclarations.
I took my time to understand how redeclaration were handled in
`dsymbolsem`.
had to come up with a solution that finds an already exisiting
symbol and then removes it
from module's members. it worked for that but broke other tests
which were hard to trace.
later decided to handle it in the backend because I realized LDC
didn't have that problem.
even if you redeclare C symbols globally, LDC merges them into
one in the symbol table.
so I had to fix a identifier check before we emit symbols.
Apparently, it worked.
no symbol duplications but the global symbol access seems to
break initializer reads on x86 targets but works super fine on
x86_64 targets. I'm still investigating, pretty sure the 32 bit
registers couldn't handle some reads with the lookup I introduced.
can follow up in this PR: https://github.com/dlang/dmd/pull/22003
Thanks!
More information about the Digitalmars-d
mailing list