llvm-project/clang/include/clang
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
..
ARCMigrate Remove trailing space 2018-07-30 19:24:48 +00:00
AST [AST] Remove unnecessary indirections in DeclarationNameTable 2018-08-06 16:47:31 +00:00
ASTMatchers Remove trailing space 2018-07-30 19:24:48 +00:00
Analysis Fix "not all control paths return a value" MSVC warning. 2018-08-01 09:45:21 +00:00
Basic [Fixed Point Arithmetic] Fixed Point Constant 2018-08-06 16:42:37 +00:00
CodeGen [COFF, ARM64] Decide when to mark struct returns as SRet 2018-07-26 18:07:59 +00:00
Config CMake option to allow enabling experimental new pass manager by default 2018-04-06 00:53:00 +00:00
CrossTU Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
Driver clang-cl: Parse the new /JMC flag 2018-08-06 11:34:46 +00:00
Edit Remove trailing space 2018-07-30 19:24:48 +00:00
Format [clang-format ]Extend IncludeCategories regex documentation 2018-07-25 10:21:47 +00:00
Frontend Remove trailing space 2018-07-30 19:24:48 +00:00
FrontendTool [Templight] Template Instantiation Observer 2018-02-10 14:04:45 +00:00
Index NFC: Add the emacs c++ mode hint "-*- C++ -*-" to the headers that don't have it 2018-07-24 00:07:49 +00:00
Lex Remove trailing space 2018-07-30 19:24:48 +00:00
Parse [UnrollAndJam] Add unroll_and_jam pragma handling 2018-08-01 14:36:12 +00:00
Rewrite Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
Sema Append new attributes to the end of an AttributeList. 2018-08-03 01:21:16 +00:00
Serialization [modules] Defer merging deduced return types. 2018-08-03 01:00:01 +00:00
StaticAnalyzer [analyzer] Forward arguments in registerChecker to avoid accidental copies 2018-08-02 18:17:01 +00:00
Tooling [clang-format ]Extend IncludeCategories regex documentation 2018-07-25 10:21:47 +00:00
CMakeLists.txt Fixed bug 2016-05-31 15:56:26 +00:00
module.modulemap Reland "Move #include manipulation code to new lib/Tooling/Inclusions." 2018-06-04 09:04:12 +00:00