[PATCH] PR13457 (part 1) explicit/implicit calling conventions compatibility in overloads

John McCall rjmccall at apple.com
Wed Jul 10 10:54:47 PDT 2013

On Jul 10, 2013, at 5:52 AM, Reid Kleckner <rnk at google.com> wrote:
> So, after digging into this, I discovered that even though we have enums for the calling conventions in AttributedType, they are dead.  They are only used in case labels.  John added AttributedType with the enum in 2011 here:
> http://llvm.org/viewvc/llvm-project?view=revision&revision=122942
> I think his intention was that we should be using AttributedType for calling conventions.  Today what we do is unwrap and rewrap the FunctionType with a new calling convention.  CC_Default is used everywhere there wasn't an explicit attribute.  There are exceptions like -mrtd which force the CC to stdcall, but it looks pretty buggy with lots of checks to try to infer if the stdcall convention was applied by -mrtd or explicitly with an attribute.
> It looks like in the long run handleFunctionTypeAttr should be doing what it does today, except it should wrap FunctionType in some AttributedType sugar which points to the original function type and the new function type.
> Does that make sense?

Yes, that's the intended direction.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130710/022f4f00/attachment.html>

More information about the cfe-commits mailing list