hanchenye-llvm-project/clang/lib/AST
Bruno Ricci b619883c76 [AST] Remove unnecessary indirections in DeclarationNameTable
DeclarationNameTable currently hold 3 "void *" to
FoldingSet<CXXSpecialName>, FoldingSet<CXXLiteralOperatorIdName>
and FoldingSet<CXXDeductionGuideNameExtra>.

CXXSpecialName, CXXLiteralOperatorIdName and
CXXDeductionGuideNameExtra are private classes holding extra
information about a "special" declaration name and are in
AST/DeclarationName.cpp. The original intent seems to have
been to keep these classes private and only expose
DeclarationNameExtra and DeclarationName (the code dates from
2008 and has not been significantly changed since).

However this make the code less straightforward than necessary
because of the need to have "void *" in DeclarationNameTable
(with 1 of 3 comments wrong) and to manually allocate/deallocate
the FoldingSets.

Moreover removing the extra indirections reduce the run-time of
an fsyntax-only on all of Boost by 2.3% which is not totally
unexpected given how frequently this data structure is used
(especially for C++).

A concern raised by erichkeane during the review was that
including Type.h would increase the compile time unreasonably.
However test builds (both clean and incremental) showed that
this patch did not result in any compile time increase.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D50261

llvm-svn: 339030
2018-08-06 16:47:31 +00:00
..
APValue.cpp [ExprConstant] Use an AST node and a version number as a key to create 2018-04-10 05:15:01 +00:00
ASTConsumer.cpp
ASTContext.cpp [Fixed Point Arithmetic] Fixed Point Constant 2018-08-06 16:42:37 +00:00
ASTDiagnostic.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ASTDumper.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ASTImporter.cpp [ASTmporter] SourceRange-free function parameter checking for declarations 2018-08-06 14:38:37 +00:00
ASTStructuralEquivalence.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ASTTypeTraits.cpp
AttrImpl.cpp
CMakeLists.txt [C++2a] Implement operator<=> CodeGen and ExprConstant 2018-05-07 21:07:10 +00:00
CXXABI.h
CXXInheritance.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
Comment.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CommentBriefParser.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
CommentCommandTraits.cpp
CommentLexer.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CommentParser.cpp
CommentSema.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
ComparisonCategories.cpp [C++2a] Implement operator<=>: Address bugs and post-commit review comments after r331677. 2018-05-08 00:52:19 +00:00
DataCollection.cpp
Decl.cpp [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext 2018-08-01 21:16:54 +00:00
DeclBase.cpp Test commit 2018-08-03 13:13:05 +00:00
DeclCXX.cpp Fix assertion failure when emitting code for a merged lambda. 2018-08-02 20:30:52 +00:00
DeclFriend.cpp [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC). 2018-04-03 00:11:50 +00:00
DeclGroup.cpp
DeclObjC.cpp [AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl 2018-08-01 22:41:03 +00:00
DeclOpenMP.cpp [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext 2018-08-01 21:16:54 +00:00
DeclPrinter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
DeclTemplate.cpp [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext 2018-08-01 20:48:16 +00:00
DeclarationName.cpp [AST] Remove unnecessary indirections in DeclarationNameTable 2018-08-06 16:47:31 +00:00
Expr.cpp [Fixed Point Arithmetic] Fix for FixedPointValueToString 2018-08-06 16:05:08 +00:00
ExprCXX.cpp [AST] CastExpr: BasePathSize is not large enough. 2018-08-01 06:06:16 +00:00
ExprClassification.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ExprConstant.cpp [Fixed Point Arithmetic] Fix for FixedPointValueToString 2018-08-06 16:05:08 +00:00
ExprObjC.cpp
ExternalASTMerger.cpp [ASTImporter] Refactor Decl creation 2018-07-12 09:42:05 +00:00
ExternalASTSource.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
InheritViz.cpp
ItaniumCXXABI.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ItaniumMangle.cpp Append new attributes to the end of an AttributeList. 2018-08-03 01:21:16 +00:00
Linkage.h
Mangle.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
MicrosoftCXXABI.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
MicrosoftMangle.cpp wrap to 80 cols, no behavior change 2018-08-01 11:56:20 +00:00
NSAPI.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
NestedNameSpecifier.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ODRHash.cpp [ODRHash] Support hashing enums. 2018-07-25 22:52:05 +00:00
OpenMPClause.cpp [OPENMP] Code cleanup and code improvements. 2018-04-18 15:57:46 +00:00
ParentMap.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
QualTypeNames.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
RawCommentList.cpp [AST] Added a helper to extract a user-friendly text of a comment. 2018-05-16 12:30:09 +00:00
RecordLayout.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
RecordLayoutBuilder.cpp Improve support of PDB as an external layout source 2018-07-31 08:27:06 +00:00
SelectorLocationsKind.cpp
Stmt.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
StmtCXX.cpp [AST] Use llvm::TrailingObjects in CXXTryStmt 2018-07-23 12:45:24 +00:00
StmtIterator.cpp
StmtObjC.cpp
StmtOpenMP.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
StmtPrinter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
StmtProfile.cpp [coroutines] Fix handling of dependent co_await in StmtProfiler. 2018-07-31 00:47:41 +00:00
StmtViz.cpp
TemplateBase.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TemplateName.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
Type.cpp [Fixed Point Arithmetic] Fix for FixedPointValueToString 2018-08-06 16:05:08 +00:00
TypeLoc.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TypePrinter.cpp [P0936R0] add [[clang::lifetimebound]] attribute 2018-08-01 00:33:25 +00:00
VTTBuilder.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
VTableBuilder.cpp Remove trailing space 2018-07-30 19:24:48 +00:00