summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-02-26 18:33:56 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-02-26 18:33:56 +0000
commit7e11d9c4c2901080cc6f255ebc57c3367758713a (patch)
tree78495007c1b7f0f6e644158d821a69918da609e1 /clang
parent14926606a43148aaf50766140b67a504bd2b62ef (diff)
downloadbcm5719-llvm-7e11d9c4c2901080cc6f255ebc57c3367758713a.tar.gz
bcm5719-llvm-7e11d9c4c2901080cc6f255ebc57c3367758713a.zip
CompoundLiteralExpr: Pair a bool with a pointer.
48 -> 40 bytes on x86_64. llvm-svn: 151496
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/AST/Expr.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 5acee7848a4..61f367af610 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -2430,9 +2430,9 @@ class CompoundLiteralExpr : public Expr {
/// The type as written. This can be an incomplete array type, in
/// which case the actual expression type will be different.
- TypeSourceInfo *TInfo;
+ /// The int part of the pair stores whether this expr is file scope.
+ llvm::PointerIntPair<TypeSourceInfo *, 1, bool> TInfoAndScope;
Stmt *Init;
- bool FileScope;
public:
CompoundLiteralExpr(SourceLocation lparenloc, TypeSourceInfo *tinfo,
QualType T, ExprValueKind VK, Expr *init, bool fileScope)
@@ -2442,7 +2442,7 @@ public:
(init->isInstantiationDependent() ||
tinfo->getType()->isInstantiationDependentType()),
init->containsUnexpandedParameterPack()),
- LParenLoc(lparenloc), TInfo(tinfo), Init(init), FileScope(fileScope) {}
+ LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
/// \brief Construct an empty compound literal.
explicit CompoundLiteralExpr(EmptyShell Empty)
@@ -2452,14 +2452,18 @@ public:
Expr *getInitializer() { return cast<Expr>(Init); }
void setInitializer(Expr *E) { Init = E; }
- bool isFileScope() const { return FileScope; }
- void setFileScope(bool FS) { FileScope = FS; }
+ bool isFileScope() const { return TInfoAndScope.getInt(); }
+ void setFileScope(bool FS) { TInfoAndScope.setInt(FS); }
SourceLocation getLParenLoc() const { return LParenLoc; }
void setLParenLoc(SourceLocation L) { LParenLoc = L; }
- TypeSourceInfo *getTypeSourceInfo() const { return TInfo; }
- void setTypeSourceInfo(TypeSourceInfo* tinfo) { TInfo = tinfo; }
+ TypeSourceInfo *getTypeSourceInfo() const {
+ return TInfoAndScope.getPointer();
+ }
+ void setTypeSourceInfo(TypeSourceInfo *tinfo) {
+ TInfoAndScope.setPointer(tinfo);
+ }
SourceRange getSourceRange() const {
// FIXME: Init should never be null.
OpenPOWER on IntegriCloud