diff options
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index b1da849ae1..db69e0878a 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2104,8 +2104,21 @@ void BlockDecl::setParams(ParmVarDecl **NewParamInfo, } } -unsigned BlockDecl::getNumParams() const { - return NumParams; +void BlockDecl::setCapturedDecls(ASTContext &Context, + VarDecl * const *begin, + VarDecl * const *end, + bool capturesCXXThis) { + CapturesCXXThis = capturesCXXThis; + + if (begin == end) { + NumCapturedDecls = 0; + CapturedDecls = 0; + return; + } + + NumCapturedDecls = end - begin; + CapturedDecls = new (Context) VarDecl*[NumCapturedDecls]; + memcpy(CapturedDecls, begin, NumCapturedDecls * sizeof(VarDecl*)); } SourceRange BlockDecl::getSourceRange() const { |