forked from OSchip/llvm-project
[AST][NFC] Pack CXXNullPtrLiteralExpr
Use the newly available space in the bit-fields of Stmt. This saves one pointer per CXXNullPtrLiteralExpr. llvm-svn: 347063
This commit is contained in:
parent
df9393fbe3
commit
7bc1ff9cdc
|
@ -582,22 +582,21 @@ public:
|
||||||
///
|
///
|
||||||
/// Introduced in C++11, the only literal of type \c nullptr_t is \c nullptr.
|
/// Introduced in C++11, the only literal of type \c nullptr_t is \c nullptr.
|
||||||
class CXXNullPtrLiteralExpr : public Expr {
|
class CXXNullPtrLiteralExpr : public Expr {
|
||||||
SourceLocation Loc;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation l)
|
CXXNullPtrLiteralExpr(QualType Ty, SourceLocation Loc)
|
||||||
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_RValue, OK_Ordinary, false,
|
: Expr(CXXNullPtrLiteralExprClass, Ty, VK_RValue, OK_Ordinary, false,
|
||||||
false, false, false),
|
false, false, false) {
|
||||||
Loc(l) {}
|
CXXNullPtrLiteralExprBits.Loc = Loc;
|
||||||
|
}
|
||||||
|
|
||||||
explicit CXXNullPtrLiteralExpr(EmptyShell Empty)
|
explicit CXXNullPtrLiteralExpr(EmptyShell Empty)
|
||||||
: Expr(CXXNullPtrLiteralExprClass, Empty) {}
|
: Expr(CXXNullPtrLiteralExprClass, Empty) {}
|
||||||
|
|
||||||
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
|
SourceLocation getBeginLoc() const { return getLocation(); }
|
||||||
SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
|
SourceLocation getEndLoc() const { return getLocation(); }
|
||||||
|
|
||||||
SourceLocation getLocation() const { return Loc; }
|
SourceLocation getLocation() const { return CXXNullPtrLiteralExprBits.Loc; }
|
||||||
void setLocation(SourceLocation L) { Loc = L; }
|
void setLocation(SourceLocation L) { CXXNullPtrLiteralExprBits.Loc = L; }
|
||||||
|
|
||||||
static bool classof(const Stmt *T) {
|
static bool classof(const Stmt *T) {
|
||||||
return T->getStmtClass() == CXXNullPtrLiteralExprClass;
|
return T->getStmtClass() == CXXNullPtrLiteralExprClass;
|
||||||
|
|
|
@ -514,6 +514,15 @@ protected:
|
||||||
SourceLocation Loc;
|
SourceLocation Loc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CXXNullPtrLiteralExprBitfields {
|
||||||
|
friend class CXXNullPtrLiteralExpr;
|
||||||
|
|
||||||
|
unsigned : NumExprBits;
|
||||||
|
|
||||||
|
/// The location of the null pointer literal.
|
||||||
|
SourceLocation Loc;
|
||||||
|
};
|
||||||
|
|
||||||
class TypeTraitExprBitfields {
|
class TypeTraitExprBitfields {
|
||||||
friend class ASTStmtReader;
|
friend class ASTStmtReader;
|
||||||
friend class ASTStmtWriter;
|
friend class ASTStmtWriter;
|
||||||
|
@ -613,6 +622,7 @@ protected:
|
||||||
|
|
||||||
// C++ Expressions
|
// C++ Expressions
|
||||||
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits;
|
CXXBoolLiteralExprBitfields CXXBoolLiteralExprBits;
|
||||||
|
CXXNullPtrLiteralExprBitfields CXXNullPtrLiteralExprBits;
|
||||||
TypeTraitExprBitfields TypeTraitExprBits;
|
TypeTraitExprBitfields TypeTraitExprBits;
|
||||||
ExprWithCleanupsBitfields ExprWithCleanupsBits;
|
ExprWithCleanupsBitfields ExprWithCleanupsBits;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue