[cfe-commits] [PATCH] Properly emit calls through function pointers with calling conventions

Chris Lattner clattner at apple.com
Thu Feb 4 13:51:56 PST 2010


On Feb 4, 2010, at 10:27 AM, Charles Davis wrote:

> This is the last in my series of calling-convention-related patches.  
> Now
> that we have the calling convention properly stored in the type, we  
> can
> use it instead of asking the target llvm::Function (if there even is
> one, which there isn't in the case of a function pointer) what its
> calling convention is.
>
> This is the simplest by far of the three patches. In fact, I wonder  
> if I
> should have folded this into patch 2...
>
> Doug, you were right about this. After the type-system work was done,
> fixing the codegen was a simple matter of calling
> FunctionType::getCallConv() and converting it to an LLVM calling  
> convention.
>
> Included is a small test for calls through function pointers that were
> declared with calling conventions.

Looks great to me, please commit.  It would be nice to change the  
testcase to be more specific though (use filecheck instead of grep).

-Chris



More information about the cfe-commits mailing list