diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-05 03:35:19 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-05 03:35:19 +0000 |
commit | ec9ea7200718478e8a976529defbe21942a11c9c (patch) | |
tree | 52de9c7edea7849591dbf5b5438dbc0a46748293 /lib/Sema/Sema.cpp | |
parent | edb9459c43dec5f376020f2b53833dee6549e11d (diff) |
More lambda work. Tweak the Sema interface slightly. Start adding the pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index c8199042b7..6a77d8c673 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -55,6 +55,7 @@ void FunctionScopeInfo::Clear() { } BlockScopeInfo::~BlockScopeInfo() { } +LambdaScopeInfo::~LambdaScopeInfo() { } PrintingPolicy Sema::getPrintingPolicy() const { PrintingPolicy Policy = Context.getPrintingPolicy(); @@ -828,8 +829,12 @@ void Sema::PushBlockScope(Scope *BlockScope, BlockDecl *Block) { BlockScope, Block)); } -void Sema::PopFunctionOrBlockScope(const AnalysisBasedWarnings::Policy *WP, - const Decl *D, const BlockExpr *blkExpr) { +void Sema::PushLambdaScope(CXXRecordDecl *Lambda) { + FunctionScopes.push_back(new LambdaScopeInfo(getDiagnostics(), Lambda)); +} + +void Sema::PopFunctionScopeInfo(const AnalysisBasedWarnings::Policy *WP, + const Decl *D, const BlockExpr *blkExpr) { FunctionScopeInfo *Scope = FunctionScopes.pop_back_val(); assert(!FunctionScopes.empty() && "mismatched push/pop!"); |