llvm-project/clang/lib/AST
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
..
APValue.cpp Implement DR1454. This allows all intermediate results in constant expressions 2012-02-15 02:18:13 +00:00
ASTConsumer.cpp Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continue 2011-11-18 00:26:59 +00:00
ASTContext.cpp Within the body of a lambda expression, decltype((x)) for an 2012-02-12 18:42:33 +00:00
ASTDiagnostic.cpp Change the checks in the type aka printing. A confusing case where the string 2011-11-14 19:39:25 +00:00
ASTImporter.cpp Within the body of a lambda expression, decltype((x)) for an 2012-02-12 18:42:33 +00:00
AttrImpl.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
CMakeLists.txt Allow getting all source locations of selector identifiers in a ObjCMessageExpr. 2011-10-03 06:36:51 +00:00
CXXABI.h Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen as well. 2010-11-25 01:51:53 +00:00
CXXInheritance.cpp remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports 2011-07-23 10:55:15 +00:00
Decl.cpp Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line. 2012-02-07 22:29:24 +00:00
DeclBase.cpp [PCH] Avoid using Decl::setAttrs() and Decl::setLexicalDeclContext() from the ASTReaderDecl 2012-02-09 02:44:08 +00:00
DeclCXX.cpp Rework the Sema/AST/IRgen dance for the lambda closure type's 2012-02-17 03:02:34 +00:00
DeclFriend.cpp When creating declarations that are deserialized from an module file, 2012-01-05 21:55:30 +00:00
DeclGroup.cpp I lied. Kill off a few more Destroy methods 2010-07-25 18:32:30 +00:00
DeclObjC.cpp objc: If a method is not implemented in the category implementation but 2012-02-09 21:30:24 +00:00
DeclPrinter.cpp Represent C++ direct initializers as ParenListExprs before semantic analysis 2012-02-11 23:51:47 +00:00
DeclTemplate.cpp De-virtualize getPreviousDecl() and getMostRecentDecl() when we know 2012-01-14 16:38:05 +00:00
DeclarationName.cpp Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line. 2012-02-07 22:29:24 +00:00
DumpXML.cpp Represent C++ direct initializers as ParenListExprs before semantic analysis 2012-02-11 23:51:47 +00:00
Expr.cpp Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
ExprCXX.cpp Pacify gcc's -Wreturn-type 2012-02-16 22:15:50 +00:00
ExprClassification.cpp Introduce basic ASTs for lambda expressions. This covers: 2012-02-07 10:09:13 +00:00
ExprConstant.cpp PR12012: Fix a regression in r150419 where we would try (and fail) to 2012-02-17 00:44:16 +00:00
ExternalASTSource.cpp Don't force the complete deserialization of the visible-declarations 2011-08-24 21:56:08 +00:00
InheritViz.cpp remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports 2011-07-23 10:55:15 +00:00
ItaniumCXXABI.cpp Extend the ASTContext constructor to delay the initialization of 2011-09-02 00:18:52 +00:00
ItaniumMangle.cpp Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
Mangle.cpp Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with NamedDecls. 2012-02-07 11:57:45 +00:00
MicrosoftCXXABI.cpp Extend the ASTContext constructor to delay the initialization of 2011-09-02 00:18:52 +00:00
MicrosoftMangle.cpp Add Microsoft mangling of constructors and destructors. Patch by Dmitry! 2011-12-01 09:55:00 +00:00
NestedNameSpecifier.cpp Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line. 2012-02-07 22:29:24 +00:00
ParentMap.cpp [arcmt] More automatic transformations and safety improvements; rdar://9615812 : 2011-07-27 05:28:18 +00:00
RecordLayout.cpp More ASTRecordLayout changes for MS ABI; based on patch by r4start. 2011-10-21 22:49:56 +00:00
RecordLayoutBuilder.cpp If a struct needs to be laid out, and it has not 2012-02-08 00:04:52 +00:00
SelectorLocationsKind.cpp Fix crash when using archaic protocol, rdar://10238337 2011-10-05 21:28:06 +00:00
Stmt.cpp More dead code removal (using -Wunreachable-code) 2012-01-20 21:50:17 +00:00
StmtDumper.cpp Print NamedDecls directly to a raw_ostream where possible. 2012-02-07 11:57:57 +00:00
StmtIterator.cpp Support for C++11 (non-template) alias declarations. 2011-04-15 14:24:37 +00:00
StmtPrinter.cpp Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
StmtProfile.cpp Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" 2012-02-16 12:22:20 +00:00
StmtViz.cpp Adapt to the DOTGraphTraits changes in LLVM. 2009-11-30 14:16:05 +00:00
TemplateBase.cpp Print NamedDecls directly to a raw_ostream where possible. 2012-02-07 11:57:57 +00:00
TemplateName.cpp Print NamedDecls directly to a raw_ostream where possible. 2012-02-07 11:57:57 +00:00
Type.cpp Track whether a function type has a trailing return type as type sugar. Use this 2012-02-10 09:58:53 +00:00
TypeLoc.cpp Added source location for the template keyword in DependentTemplateSpecializationTypeLoc nodes (DTSTLoc). 2012-02-06 22:45:07 +00:00
TypePrinter.cpp When overload resolution picks an implicitly-deleted special member 2012-02-15 19:33:52 +00:00
VTTBuilder.cpp Move VTT builder to AST 2011-09-26 01:56:24 +00:00
VTableBuilder.cpp Make format string 64 bit safe. 2011-11-06 09:34:11 +00:00