r212162 - [OPENMP, C++11] Improve code of InitVLACaptures function.

Bataev, Alexey a.bataev at hotmail.com
Tue Jul 1 23:27:42 PDT 2014


Ok, I'll add it

Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team

02.07.2014 10:01, Richard Smith пишет:
>
>
> On 1 Jul 2014 22:26, "Alexey Bataev" <a.bataev at hotmail.com 
> <mailto:a.bataev at hotmail.com>> wrote:
> >
> > Author: abataev
> > Date: Wed Jul  2 00:15:00 2014
> > New Revision: 212162
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=212162&view=rev
> > Log:
> > [OPENMP, C++11] Improve code of InitVLACaptures function.
> >
> > Modified:
> >     cfe/trunk/lib/CodeGen/CGStmt.cpp
> >
> > Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
> > URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=212162&r1=212161&r2=212162&view=diff
> > 
> ==============================================================================
> > --- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
> > +++ cfe/trunk/lib/CodeGen/CGStmt.cpp Wed Jul  2 00:15:00 2014
> > @@ -2055,11 +2055,14 @@ static LValue InitCapturedStruct(CodeGen
> >  }
> >
> >  static void InitVLACaptures(CodeGenFunction &CGF, const 
> CapturedStmt &S) {
> > -  for (CapturedStmt::const_capture_iterator I = S.capture_begin(),
> > -                                            E = S.capture_end();
> > -       I != E; ++I) {
> > -    if (I->capturesVariable()) {
> > -      QualType QTy = I->getCapturedVar()->getType();
> > +  for (auto &C : S.captures()) {
> > +    if (C.capturesVariable()) {
> > +      QualType QTy;
> > +      auto VD = C.getCapturedVar();
> > +      if (const ParmVarDecl *PVD = dyn_cast<ParmVarDecl>(VD))
> > +        QTy = PVD->getOriginalType();
>
> Testcase for this change?
>
> > +      else
> > +        QTy = VD->getType();
> >        if (QTy->isVariablyModifiedType()) {
> >          CGF.EmitVariablyModifiedType(QTy);
> >        }
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140702/12c3ca2b/attachment.html>


More information about the cfe-commits mailing list