teak-llvm/clang/lib/Frontend/Rewrite
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
..
CMakeLists.txt Attempt to fix shared library build: RewriteFrontend depends on Serialization after r305116. 2017-06-09 22:02:33 +00:00
FixItRewriter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
FrontendActions.cpp [modules] Support use of -E on modules built from the command line. 2018-09-15 01:21:18 +00:00
HTMLPrint.cpp Clean up use of C allocation functions 2018-02-21 02:02:39 +00:00
InclusionRewriter.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
RewriteMacros.cpp Spelling mistakes in comments. NFCI. (PR27635) 2017-03-30 14:13:19 +00:00
RewriteModernObjC.cpp [AST] Store the callee and argument expressions of CallExpr in a trailing array. 2018-12-21 15:20:32 +00:00
RewriteObjC.cpp [AST] Store the callee and argument expressions of CallExpr in a trailing array. 2018-12-21 15:20:32 +00:00
RewriteTest.cpp