[PATCH] Create calling convention AttributedType sugar nodes

Reid Kleckner rnk at google.com
Fri Jul 19 10:17:43 PDT 2013


On Fri, Jul 19, 2013 at 1:04 PM, John McCall <rjmccall at apple.com> wrote:

> On Jul 12, 2013, at 5:39 AM, Reid Kleckner <rnk at google.com> wrote:
> > Canonical types are unchanged.  The type printer had to be changed to
> > avoid printing any non-default implicit calling convention as well as
> > the calling convention attribute.
>
> +bool AttributedType::isCallingConv() const {
> +  switch (getAttrKind()) {
> +  default:  return false;
> +  case attr_cdecl:
> +  case attr_fastcall:
> +  case attr_stdcall:
> +  case attr_thiscall:
> +  case attr_pascal:
> +  case attr_pnaclcall:
> +  case attr_inteloclbicc:
>
> This seems to be missing the pcs attributes.  If that's intentional, there
> should be a comment.
>

Oops.  I'll make this a fully covered switch.


> -  if (handleFunctionTypeAttr(state, attr, declSpecType)) {
> -    spliceAttrOutOfList(attr, attrList);
> -    return true;
> -  }
> -
> -  return false;
> +  return handleFunctionTypeAttr(state, attr, declSpecType);
>
> This is an unexplained change.  Doesn't this cause the attribute
> to be potentially applied twice?
>

I had to apply this change in order to get one of the TypeLocBuilders to
succeed without asserting in fillAttributedType().  What might happen if
the parsed attribute stays on the declspec?


> Otherwise LGTM.
>
> John.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130719/a3e02f3d/attachment.html>


More information about the cfe-commits mailing list