dschuff wrote:

Or another random idea (for the "semi-transparently call with signature 
mismatches" problem, not the "fix the bugs in my code" problem): What if we 
represented function pointers (in the source) as being in a different address 
space, using the existing `address_space(N)` clang/LLVM attributes? They could 
be freely casted, written into memory and have the same integer values as they 
otherwise would, but when you call through them, we could either use a generic 
catch-all thunk like Binaryen's `fpcast-emu` pass does today, or perhaps 
something more fancy, like a LUT check and a more-specific conversion thunk. 
That could be feasible if e.g. the `FunctionPointer` C type and 
`FUNCTION_POINTER` macro could be suitably redefined. Then we maybe wouldn't 
need any changes to the code at callsites.


https://github.com/llvm/llvm-project/pull/153168
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to