I'm having an issue with the clang importer on my platform when importing this function signature from a C header...
void set_runtime_handler_callback(_Bool (* __nonnull handler)());
...the compiler traps when lowering a constant cast. The root cause is the way the above function signature's formal parameter is lowered to llvm types (sorry if I'm using incorrect terminology). Breaking at the assert, in the stack below
visitApplyInst, the issue is the above parameter is imported as type
However the target datalayout for AVR in llvm is
e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8 which has the program address space as 1.
So the above function parameter type should be
i1 () addrspace(1)* instead.
This should be a fairly easy fix, I've done a few like this, but I'm not very familiar with the clang importer code.
Can anyone point me at the place where this lowering code is, so I can attempt to make a patch for my platform?
Any help greatly appreciated!