Skip to content

Commit

Permalink
Re-arrange and bitfieldify data members of CXXConstructExpr to save a
Browse files Browse the repository at this point in the history
little storage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140529 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
DougGregor committed Sep 26, 2011
1 parent 480b53c commit a48e676
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions include/clang/AST/ExprCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,11 @@ class CXXConstructExpr : public Expr {

SourceLocation Loc;
SourceRange ParenRange;
unsigned NumArgs : 16;
bool Elidable : 1;
bool ZeroInitialization : 1;
unsigned ConstructKind : 2;
Stmt **Args;
unsigned NumArgs;

protected:
CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T,
Expand All @@ -824,15 +824,15 @@ class CXXConstructExpr : public Expr {

/// \brief Construct an empty C++ construction expression.
CXXConstructExpr(StmtClass SC, EmptyShell Empty)
: Expr(SC, Empty), Constructor(0), Elidable(0), ZeroInitialization(0),
ConstructKind(0), Args(0), NumArgs(0) { }
: Expr(SC, Empty), Constructor(0), NumArgs(0), Elidable(0),
ZeroInitialization(0), ConstructKind(0), Args(0) { }

public:
/// \brief Construct an empty C++ construction expression.
explicit CXXConstructExpr(EmptyShell Empty)
: Expr(CXXConstructExprClass, Empty), Constructor(0),
Elidable(0), ZeroInitialization(0),
ConstructKind(0), Args(0), NumArgs(0) { }
NumArgs(0), Elidable(0), ZeroInitialization(0),
ConstructKind(0), Args(0) { }

static CXXConstructExpr *Create(ASTContext &C, QualType T,
SourceLocation Loc,
Expand Down
6 changes: 3 additions & 3 deletions lib/AST/ExprCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ CXXConstructExpr::CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T,
T->isDependentType(), T->isDependentType(),
T->isInstantiationDependentType(),
T->containsUnexpandedParameterPack()),
Constructor(D), Loc(Loc), ParenRange(ParenRange), Elidable(elidable),
ZeroInitialization(ZeroInitialization), ConstructKind(ConstructKind),
Args(0), NumArgs(numargs)
Constructor(D), Loc(Loc), ParenRange(ParenRange), NumArgs(numargs),
Elidable(elidable), ZeroInitialization(ZeroInitialization),
ConstructKind(ConstructKind), Args(0)
{
if (NumArgs) {
Args = new (C) Stmt*[NumArgs];
Expand Down

0 comments on commit a48e676

Please sign in to comment.