You'll have to forgive me if this is a bit of a dumb question. I'm trying to debug issues with Builtin functions not being recognised, or extending the functions available via Builtin, or at least just understanding how it works.
I've grepped through the source for truncOrBitCast or the associated macros BUILTIN_CAST_OR_BITCAST_OPERATION, BUILTIN_CAST_OPERATION, BUILTIN.
Apart from in the .def file (
Builtins.def), almost all of the references to the above seem to be during the SIL stages, including loads of optimisations. But if you use a builtin that's not recognised, it's (correctly) rejected with error during AST/Sema.
I guess I'm asking how does AST/Sema know about the builtins, where is the code?