llvm-project/clang/lib/Analysis
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
..
AnalysisDeclContext.cpp [analyzer] Generate and use stable identifiers for LocationContext 2018-09-15 02:03:36 +00:00
BodyFarm.cpp [AST] Store the callee and argument expressions of CallExpr in a trailing array. 2018-12-21 15:20:32 +00:00
CFG.cpp Revert "Revert r347417 "Re-Reinstate 347294 with a fix for the failures."" 2018-11-30 23:41:18 +00:00
CFGReachabilityAnalysis.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CFGStmtMap.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CMakeLists.txt Reapply Logging: make os_log buffer size an integer constant expression. 2018-11-02 13:14:11 +00:00
CallGraph.cpp Change CallGraph print to show the fully qualified name 2018-12-12 18:11:36 +00:00
CloneDetection.cpp Misc typos fixes in ./lib folder 2018-12-10 12:37:46 +00:00
CocoaConventions.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CodeInjector.cpp
ConstructionContext.cpp [CFG] [analyzer] NFC: Enumerate construction context layer kinds. 2018-07-31 21:12:42 +00:00
Consumed.cpp Port getLocEnd -> getEndLoc 2018-08-09 21:09:38 +00:00
Dominators.cpp [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-13 21:32:01 +00:00
ExprMutationAnalyzer.cpp [analyzer] Fix nullptr access when processing instantiated function in ExprMutationAnalyzer. 2018-09-19 18:00:55 +00:00
LiveVariables.cpp [analyzer] Fix some expressions staying live too long. Add a debug checker. 2018-12-16 23:44:06 +00:00
ObjCNoReturn.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
PostOrderCFGView.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ProgramPoint.cpp Fix linkage error on ProgramPoint's dump method. 2018-09-30 18:05:39 +00:00
ReachableCode.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
ThreadSafety.cpp [AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr. 2018-12-21 14:10:18 +00:00
ThreadSafetyCommon.cpp [AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr. 2018-12-21 14:10:18 +00:00
ThreadSafetyLogical.cpp
ThreadSafetyTIL.cpp Eliminate some unneeded signed/unsigned conversions 2018-09-22 21:56:16 +00:00
UninitializedValues.cpp Remove trailing space 2018-07-30 19:24:48 +00:00