[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()

Eric Christopher echristo at apple.com
Fri Nov 20 00:28:34 PST 2009


On Nov 19, 2009, at 10:20 PM, Nick Lewycky wrote:

> 
> Sure. You could be passing it in as a function pointer to another 
> function, that's planning to call it with fastcc calling convention.
> 
> Or worse, you might be planning to call it with _stdcall (say, on 
> Windows) and discarding the calling convention would be actively harmful.
> 
> In other words, please don't do this. Produce an llvm::Function to thunk 
> if you must.

I very much agree with Nick here.  There are a multitude of things you may be wanting to do and ways that you might want to call your fastcc function and while this is, unfortunately, irritating and hard to track down the first couple of times you make the mistake - the benefit is well worth it.

-eric



More information about the llvm-dev mailing list