llvm-project/clang/lib/Frontend
Bruno Ricci c5885cffc5 [AST] Store the callee and argument expressions of CallExpr in a trailing array.
Since CallExpr::setNumArgs has been removed, it is now possible to store the
callee expression and the argument expressions of CallExpr in a trailing array.
This saves one pointer per CallExpr, CXXOperatorCallExpr, CXXMemberCallExpr,
CUDAKernelCallExpr and UserDefinedLiteral.

Given that CallExpr is used as a base of the above classes we cannot use
llvm::TrailingObjects. Instead we store the offset in bytes from the this pointer
to the start of the trailing objects and manually do the casts + arithmetic.

Some notes:

1.) I did not try to fit the number of arguments in the bit-fields of Stmt.
    This leaves some space for future additions and avoid the discussion about
    whether x bits are sufficient to hold the number of arguments.

2.) It would be perfectly possible to recompute the offset to the trailing
    objects before accessing the trailing objects. However the trailing objects
    are frequently accessed and benchmarks show that it is slightly faster to
    just load the offset from the bit-fields. Additionally, because of 1),
    we have plenty of space in the bit-fields of Stmt.

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

Reviewed By: rjmccall

llvm-svn: 349910
2018-12-21 15:20:32 +00:00
..
Rewrite [AST] Store the callee and argument expressions of CallExpr in a trailing array. 2018-12-21 15:20:32 +00:00
ASTConsumers.cpp [Frontend] Delete -print-decl-contexts 2018-10-03 03:50:44 +00:00
ASTMerge.cpp [ASTImporter] Add importer specific lookup 2018-12-17 13:53:12 +00:00
ASTUnit.cpp Move PCHContainerOperations from Frontend to Serialization 2018-12-12 02:53:59 +00:00
CMakeLists.txt Move PCHContainerOperations from Frontend to Serialization 2018-12-12 02:53:59 +00:00
ChainedDiagnosticConsumer.cpp
ChainedIncludesSource.cpp PTH-- Remove feature entirely- 2018-12-04 14:34:09 +00:00
CompilerInstance.cpp PTH-- Remove feature entirely- 2018-12-04 14:34:09 +00:00
CompilerInvocation.cpp Automatic variable initialization 2018-12-18 05:12:21 +00:00
CreateInvocationFromCommandLine.cpp Revert "Make clang-based tools find libc++ on MacOS" 2018-11-12 16:59:50 +00:00
DependencyFile.cpp Fix up diagnostics. 2018-12-14 03:35:10 +00:00
DependencyGraph.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
DiagnosticRenderer.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-26 22:16:28 +00:00
FrontendAction.cpp Sink BuryPointer from Clang into LLVM for reuse there 2018-11-17 18:04:13 +00:00
FrontendActions.cpp PTH-- Remove feature entirely- 2018-12-04 14:34:09 +00:00
FrontendOptions.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-26 21:45:04 +00:00
FrontendTiming.cpp Use special new Clang flag 'FrontendTimesIsEnabled' instead of 'llvm::TimePassesIsEnabled' inside -ftime-report feature. 2018-04-23 09:22:30 +00:00
HeaderIncludeGen.cpp [clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P 2018-05-04 15:58:31 +00:00
InitHeaderSearch.cpp Move detection of libc++ include dirs to Driver on MacOS 2018-12-05 14:24:14 +00:00
InitPreprocessor.cpp PTH-- Remove feature entirely- 2018-12-04 14:34:09 +00:00
LangStandards.cpp Don't accept -std= values that would switch us to a different source language. 2017-04-26 23:44:33 +00:00
LayoutOverrideSource.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
LogDiagnosticPrinter.cpp
ModuleDependencyCollector.cpp [VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS. 2018-10-24 22:39:38 +00:00
MultiplexConsumer.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
PrecompiledPreamble.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
PrintPreprocessedOutput.cpp Fix combining pragma __debug dump & parser_crash with -E 2018-11-15 03:04:21 +00:00
SerializedDiagnosticPrinter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
SerializedDiagnosticReader.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-26 21:45:04 +00:00
TestModuleFileExtension.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TestModuleFileExtension.h
TextDiagnostic.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TextDiagnosticBuffer.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-22 00:53:26 +00:00
TextDiagnosticPrinter.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
VerifyDiagnosticConsumer.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00