Skip to content

Commit a270a02

Browse files
committed
Get rid of the Range in CXXOperatorCallExpr.
1 parent d5c1df6 commit a270a02

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,19 +2905,19 @@ class CallExpr : public Expr {
29052905
//
29062906
// * An optional of type FPOptionsOverride.
29072907
//
2908-
// CallExpr subclasses are asssumed to be 40 bytes or less, and CallExpr
2908+
// CallExpr subclasses are asssumed to be 32 bytes or less, and CallExpr
29092909
// itself is 24 bytes. To avoid having to recompute or store the offset of the
2910-
// trailing objects, we put it at 40 bytes (such that it is suitable for all
2910+
// trailing objects, we put it at 32 bytes (such that it is suitable for all
29112911
// subclasses) We use the 8 bytes gap left for instances of CallExpr to store
29122912
// the begin source location, which has a significant impact on perf as
29132913
// getBeginLoc is assumed to be cheap.
29142914
// The layourt is as follow:
2915-
// CallExpr | Begin | 8 bytes left | Trailing Objects
2915+
// CallExpr | Begin | Trailing Objects
29162916
// CXXMemberCallExpr | Trailing Objects
29172917
// A bit in CallExprBitfields indicates if source locations are present.
29182918

29192919
protected:
2920-
static constexpr unsigned OffsetToTrailingObjects = 40;
2920+
static constexpr unsigned OffsetToTrailingObjects = 32;
29212921
template <typename T>
29222922
static constexpr unsigned
29232923
sizeToAllocateForCallExprSubclass(unsigned SizeOfTrailingObjects) {

clang/lib/AST/Expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,8 @@ static unsigned SizeOfCallExprInstance(Expr::StmtClass SC) {
14661466

14671467
// changing the size of SourceLocation, CallExpr, and
14681468
// subclasses requires careful considerations
1469-
static_assert(sizeof(SourceLocation) == 8 && sizeof(CXXOperatorCallExpr) <= 40,
1470-
"we assume CXXOperatorCallExpr is at most 40 bytes");
1469+
static_assert(sizeof(SourceLocation) == 8 && sizeof(CXXOperatorCallExpr) <= 32,
1470+
"we assume CXXOperatorCallExpr is at most 32 bytes");
14711471

14721472
CallExpr::CallExpr(StmtClass SC, Expr *Fn, ArrayRef<Expr *> PreArgs,
14731473
ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK,

0 commit comments

Comments
 (0)