[cfe-commits] Fwd: Bug 11709 Fix: va_list on ARM is not following AAPCS 7.1.4
Logan Chien
tzuhsiang.chien at gmail.com
Thu Oct 18 08:23:04 PDT 2012
---------- Forwarded message ----------
From: Logan Chien <tzuhsiang.chien at gmail.com>
Date: Thu, Oct 18, 2012 at 11:20 PM
Subject: Re: [cfe-commits] Bug 11709 Fix: va_list on ARM is not following
AAPCS 7.1.4
To: Eli Friedman <eli.friedman at gmail.com>
Thanks for your review.
I have added new test to test/SemaCXX/builtins-arm.cpp to
specify the error message when PerformCopyInitialization fails.
BTW, is the InitializedEntity related code correct? I hope I can
get a modifiable Lvalue reference after initialization (not a copy
of the value in the structure.) I'm not very confident with this.
Thanks.
Sincerely,
Logan
On Thu, Oct 18, 2012 at 6:11 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Thu, Oct 18, 2012 at 1:40 AM, Logan Chien <tzuhsiang.chien at gmail.com>
> wrote:
> > Hi,
> >
> > Here's another attempt to solve __builtin_va_arg issue.
> > In this patch, there is a special check for C++ and va_list as
> > record type:
> >
> > } else if (VaListType->isRecordType() && getLangOpts().CPlusPlus) {
> > // If va_list is a record type and we are compiling under C++ mode,
> > // then we should check the argument by copy assignment operator.
> > InitializedEntity Entity
> > = InitializedEntity::InitializeParameter(Context,
> > Context.getLValueReferenceType(VaListType), false);
> > ExprResult Init = PerformCopyInitialization(Entity, SourceLocation(),
> > E);
> > if (Init.isInvalid())
> > return ExprError();
> > E = Init.takeAs<Expr>();
> >
> > With this patch, I can get the same assembly result. However, I'm not
> > familiar with InitializedEntity. Please have a look.
>
> Please include a testcase where PerformCopyInitialization fails.
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121018/248a7903/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-__builtin_va_arg-assertion-failure-in-ARM-AAPCS.patch
Type: application/octet-stream
Size: 3538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121018/248a7903/attachment.obj>
More information about the cfe-commits
mailing list