On Tue, Oct 15, 2013 at 5:57 PM, Rafael Espíndola <
[email protected]> wrote:

> > 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.


True.


> > 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.


I don't feel strongly.


> > +  // 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.
>

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

Reply via email to