Remove the circular reference to LambdaExpr in CXXRecordDecl.
authorFaisal Vali <faisalv@yahoo.com>
Wed, 23 Oct 2013 02:59:27 +0000 (02:59 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Wed, 23 Oct 2013 02:59:27 +0000 (02:59 +0000)
commit632fba3cb2ce4c7a75a226edc28084d26e4875c7
treef0e637501872ada10ea06ed7b6b56d08cbb7d18d
parent54774e568140fbc2d06da93f53161e103e3c41c5
Remove the circular reference to LambdaExpr in CXXRecordDecl.

Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

No change in functionality.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

llvm-svn: 193223
clang/include/clang/AST/DeclCXX.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/DeclCXX.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaLambda.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/PCH/cxx1y-lambdas.mm [new file with mode: 0644]