[LLVMdev] fastcc and ExecutionEngine::getPointerToFunction()

Hans Wennborg hans at hanshq.net
Fri Nov 20 00:33:00 PST 2009


Eric Christopher wrote:
> 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.
> 

Ok, I get your points. Won't touch this :)

Hans

> -eric



More information about the llvm-dev mailing list