> Oh, I see, mingw does the opposite.  :(  I was hoping it would be the same,
> but I guess it makes sense because we don't mangle calling conventions under
> Itanium.  We might want actually want to add a mangling, seeing as you can
> overload based on CC in clang.

Well, we have to follow what gcc does on mingw.

> I think John would tell you to sink this logic into the MangleContext
> subclasses.

That would require exposing getStdOrFastCallMangling to the
subclasses. I doesn't look worth it.

> +  // Variadic functions do not receive @0 suffix.
> +  const FunctionDecl *FD = cast<FunctionDecl>(D);
> +  const FunctionType *FT = FD->getType()->castAs<FunctionType>();
> +  const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FT);
> +  if (Proto && Proto->isVariadic())
> +    return;
> +  if (!Proto) {
> +    Out << '0';
> +    return;
> +  }
>
> Can this be tested?  I thought we removed fastcall and cdecl from variadic
> functions, and I have no idea what happens for K&R functions.

True. I started working on the patch while they were still allowed and
forgot to simplify it after that. The new attached patch uses an
assert.

Cheers,
Rafael

Attachment: t.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to