aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
authorWei Pan <wei.pan@intel.com>2013-05-04 03:59:06 +0000
committerWei Pan <wei.pan@intel.com>2013-05-04 03:59:06 +0000
commit9fd6b8f5a73788f288edd01fa99d434d1e6588ad (patch)
tree9e9b626021de2b27472f3275c451c4d7d3e7f091 /lib/AST
parentcd904e8864637e427f5ea3bf35a26e79b3dbbadf (diff)
Implement template support for CapturedStmt
- Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/Stmt.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 0db97d2967..5b29c073f9 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -1049,12 +1049,13 @@ CapturedStmt::Capture *CapturedStmt::getStoredCaptures() const {
+ FirstCaptureOffset);
}
-CapturedStmt::CapturedStmt(Stmt *S, ArrayRef<Capture> Captures,
+CapturedStmt::CapturedStmt(Stmt *S, CapturedRegionKind Kind,
+ ArrayRef<Capture> Captures,
ArrayRef<Expr *> CaptureInits,
CapturedDecl *CD,
RecordDecl *RD)
: Stmt(CapturedStmtClass), NumCaptures(Captures.size()),
- TheCapturedDecl(CD), TheRecordDecl(RD) {
+ CapDeclAndKind(CD, Kind), TheRecordDecl(RD) {
assert( S && "null captured statement");
assert(CD && "null captured declaration for captured statement");
assert(RD && "null record declaration for captured statement");
@@ -1074,11 +1075,12 @@ CapturedStmt::CapturedStmt(Stmt *S, ArrayRef<Capture> Captures,
CapturedStmt::CapturedStmt(EmptyShell Empty, unsigned NumCaptures)
: Stmt(CapturedStmtClass, Empty), NumCaptures(NumCaptures),
- TheCapturedDecl(0), TheRecordDecl(0) {
+ CapDeclAndKind(0, CR_Default), TheRecordDecl(0) {
getStoredStmts()[NumCaptures] = 0;
}
CapturedStmt *CapturedStmt::Create(ASTContext &Context, Stmt *S,
+ CapturedRegionKind Kind,
ArrayRef<Capture> Captures,
ArrayRef<Expr *> CaptureInits,
CapturedDecl *CD,
@@ -1102,7 +1104,7 @@ CapturedStmt *CapturedStmt::Create(ASTContext &Context, Stmt *S,
}
void *Mem = Context.Allocate(Size);
- return new (Mem) CapturedStmt(S, Captures, CaptureInits, CD, RD);
+ return new (Mem) CapturedStmt(S, Kind, Captures, CaptureInits, CD, RD);
}
CapturedStmt *CapturedStmt::CreateDeserialized(ASTContext &Context,