llvm-project/clang/lib/Sema
Douglas Gregor 355efbb2e0 Rework the Sema/AST/IRgen dance for the lambda closure type's
conversion to function pointer. Rather than having IRgen synthesize
the body of this function, we instead introduce a static member
function "__invoke" with the same signature as the lambda's
operator() in the AST. Sema then generates a body for the conversion
to function pointer which simply returns the address of __invoke. This
approach makes it easier to evaluate a call to the conversion function
as a constant, makes the linkage of the __invoke function follow the
normal rules for member functions, and may make life easier down the
road if we ever want to constexpr'ify some of lambdas.

Note that IR generation is responsible for filling in the body of
__invoke (Sema just adds a dummy body), because the body can't
generally be expressed in C++.

Eli, please review!

llvm-svn: 150783
2012-02-17 03:02:34 +00:00
..
AnalysisBasedWarnings.cpp When overload resolution picks an implicitly-deleted special member 2012-02-15 19:33:52 +00:00
AttributeList.cpp The following patch adds __attribute__((no_address_safety_analysis)) which will allow to disable 2012-01-24 19:25:38 +00:00
CMakeLists.txt Represent C++ direct initializers as ParenListExprs before semantic analysis 2012-02-11 23:51:47 +00:00
CodeCompleteConsumer.cpp Basic: import SmallString<> into clang namespace 2012-02-05 02:13:05 +00:00
DeclSpec.cpp Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it) 2012-01-17 06:56:22 +00:00
DelayedDiagnostic.cpp remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports 2011-07-23 10:55:15 +00:00
IdentifierResolver.cpp Only mark an IdentifierInfo as having changed since deserialization 2012-01-24 15:24:38 +00:00
JumpDiagnostics.cpp Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD 2011-10-20 21:42:12 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
Scope.cpp Reject continue/break statements within members of local functions nested within 2012-02-17 01:35:32 +00:00
Sema.cpp Generalize -Wempty-body: warn when statement body is empty (closes: PR11329) 2012-02-14 22:14:32 +00:00
SemaAccess.cpp Introduce a new initialization entity for lambda captures, and 2012-02-15 16:57:26 +00:00
SemaAttr.cpp Reject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility pop". 2012-02-01 23:24:59 +00:00
SemaCXXScopeSpec.cpp Added source location for the template keyword in DependentTemplateSpecializationTypeLoc nodes (DTSTLoc). 2012-02-06 22:45:07 +00:00
SemaCast.cpp Split reinterpret_casts of member pointers out from CK_BitCast; this 2012-02-15 01:22:51 +00:00
SemaChecking.cpp Make -Wformat fix-its preserve original conversion specifiers. 2012-02-15 09:59:46 +00:00
SemaCodeComplete.cpp If code completion patterns are not enabled, use simpler else/else if 2012-02-16 17:49:04 +00:00
SemaConsumer.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
SemaDecl.cpp Avoid infinite mutual recursion in DiagnoseInvalidRedeclaration. 2012-02-16 22:40:59 +00:00
SemaDeclAttr.cpp Thread safety analysis: Don't check for lockable on undefined types. 2012-02-16 17:15:51 +00:00
SemaDeclCXX.cpp Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
SemaDeclObjC.cpp objc: If a method is not implemented in the category implementation but 2012-02-09 21:30:24 +00:00
SemaExceptionSpec.cpp Basic: import SmallString<> into clang namespace 2012-02-05 02:13:05 +00:00
SemaExpr.cpp Lambda closure types are always considered to be like "local" classes, 2012-02-16 21:36:18 +00:00
SemaExprCXX.cpp Proper checking of list-initializers for array new expressions. 2012-02-16 12:59:47 +00:00
SemaExprMember.cpp Fixed instantiation of DependentScopeDeclRefExpr. 2012-02-06 14:31:00 +00:00
SemaExprObjC.cpp Add fixits for ARC casting errors for implicit conversions as well. rdar://10289283 2012-02-16 17:31:07 +00:00
SemaFixItUtils.cpp Refactor for clarity. 2012-01-13 19:34:55 +00:00
SemaInit.cpp Support GCC's bug^Wextension allowing class array members to be initalized by a 2012-02-15 22:38:09 +00:00
SemaLambda.cpp Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
SemaLookup.cpp Silence a valgrind warning, and remove an unused var. 2012-02-15 22:59:03 +00:00
SemaObjCProperty.cpp Basic: import SmallString<> into clang namespace 2012-02-05 02:13:05 +00:00
SemaOverload.cpp When overload resolution picks an implicitly-deleted special member 2012-02-15 19:33:52 +00:00
SemaPseudoObject.cpp Add IsImplicit field in ObjCMessageExpr that is true when the message 2012-01-12 02:34:39 +00:00
SemaStmt.cpp Specialize noreturn diagnostics for lambda expressions. 2012-02-15 16:20:15 +00:00
SemaTemplate.cpp Introduce support for template instantiation of lambda 2012-02-13 22:00:16 +00:00
SemaTemplateDeduction.cpp Introduce support for template instantiation of lambda 2012-02-13 22:00:16 +00:00
SemaTemplateInstantiate.cpp Introduce support for template instantiation of lambda 2012-02-13 22:00:16 +00:00
SemaTemplateInstantiateDecl.cpp Lambda closure types are always considered to be like "local" classes, 2012-02-16 21:36:18 +00:00
SemaTemplateVariadic.cpp Make the callback object to Sema::CorrectTypo mandatory. 2012-01-31 23:49:25 +00:00
SemaType.cpp Update constexpr implementation to match CWG's chosen approach for core issues 2012-02-13 03:54:03 +00:00
TargetAttributesSema.cpp Fix compiler warning about && in ||. 2011-09-30 20:32:22 +00:00
TargetAttributesSema.h Remove Sema.h's dependency on DeclCXX.h. 2010-08-25 07:42:41 +00:00
TreeTransform.h Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
TypeLocBuilder.h Remove more unnecessary #include <llvm/ADT/SmallVector.h> 2011-06-20 06:11:46 +00:00