llvm-project/clang/lib
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
..
ARCMigrate Basic: import SmallString<> into clang namespace 2012-02-05 02:13:05 +00:00
AST Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
Analysis Thread-safety analysis: Disable checking inside constructors, destructors, lock, and unlock functions 2012-02-16 17:13:43 +00:00
Basic Provide common include for all diagnostic headers. 2012-02-15 21:58:34 +00:00
CodeGen Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
Driver Tweak link order on Solaris so that global ctors work. 2012-02-16 16:00:47 +00:00
Frontend Remove the unuseful -fdiagnostics-show-name 2012-02-15 19:45:34 +00:00
FrontendTool Make use of const-correct ParseCommandLineOptions 2012-02-07 19:36:38 +00:00
Headers Remove vperm2f* and vperm2i builtins. Same effect can be achieved with builtin_shufflevector. 2012-02-08 07:33:36 +00:00
Index More dead code removal (using -Wunreachable-code) 2012-01-20 21:50:17 +00:00
Lex Advertize support for constexpr. 2012-02-14 22:56:17 +00:00
Parse Reject continue/break statements within members of local functions nested within 2012-02-17 01:35:32 +00:00
Rewrite objective-c translator. More stuff for modern meta-data. 2012-02-17 00:06:14 +00:00
Sema Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
Serialization Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
StaticAnalyzer [analyzer] Malloc Checker: Clean up bug naming: 2012-02-16 22:26:12 +00:00
CMakeLists.txt The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00
Makefile The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00