diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-07-02 05:15:00 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-07-02 05:15:00 +0000 |
commit | a15539498a3fa0edabfc80d693201ef8513ffae2 (patch) | |
tree | ff27fa8dab2423b25092f3d6017dbe02d6a54011 /clang/lib | |
parent | 2e09c514c07518a018c36456029908573a08468a (diff) | |
download | bcm5719-llvm-a15539498a3fa0edabfc80d693201ef8513ffae2.tar.gz bcm5719-llvm-a15539498a3fa0edabfc80d693201ef8513ffae2.zip |
[OPENMP, C++11] Improve code of InitVLACaptures function.
llvm-svn: 212162
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 529cca117b4..9cc23e2632a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -2055,11 +2055,14 @@ static LValue InitCapturedStruct(CodeGenFunction &CGF, const CapturedStmt &S) { } 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(); + else + QTy = VD->getType(); if (QTy->isVariablyModifiedType()) { CGF.EmitVariablyModifiedType(QTy); } |