[PATCH] D28166: Properly merge K&R functions that have attributes
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 3 18:02:31 PST 2017
aaron.ballman marked an inline comment as done.
aaron.ballman added inline comments.
================
Comment at: lib/CodeGen/CodeGenFunction.h:3570
for (auto *A : llvm::make_range(Arg, ArgRange.end()))
- ArgTypes.push_back(getVarArgType(A));
+ ArgTypes.push_back(getVarArgType(A, CallArgTypeInfo == nullptr));
----------------
rnk wrote:
> rnk wrote:
> > rnk wrote:
> > > I'm testing this change:
> > > ```
> > > $ git diff
> > > diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
> > > index acf8863..2662ebb 100644
> > > --- a/lib/CodeGen/CodeGenFunction.h
> > > +++ b/lib/CodeGen/CodeGenFunction.h
> > > @@ -3571,7 +3571,8 @@ public:
> > >
> > > // If we still have any arguments, emit them using the type of the argument.
> > > for (auto *A : llvm::make_range(Arg, ArgRange.end()))
> > > - ArgTypes.push_back(getVarArgType(A));
> > > + ArgTypes.push_back(CalleeDecl->isVariadic() ? getVarArgType(A)
> > > + : A->getType());
> > >
> > > EmitCallArgs(Args, ArgTypes, ArgRange, CalleeDecl, ParamsToSkip, Order);
> > > }
> > >
> > > ```
> > >
> > > I'd like to fix this issue in a separate commit.
> > So, that didn't work at all, but the gist of it is that I don't think we should call a function like `getVarArgType` when we aren't lowering a variadic function call. I'll look into doing it.
> rL290906 should fix it.
Thanks! I prefer the way you implemented it and agree about the naming. I thought of that after I sent the patch, but then got pulled away before I could correct it. :-P
https://reviews.llvm.org/D28166
More information about the cfe-commits
mailing list