r212162 - [OPENMP, C++11] Improve code of InitVLACaptures function.
Alexey Bataev
a.bataev at hotmail.com
Tue Jul 1 22:15:00 PDT 2014
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();
+ else
+ QTy = VD->getType();
if (QTy->isVariablyModifiedType()) {
CGF.EmitVariablyModifiedType(QTy);
}
More information about the cfe-commits
mailing list