diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -128,10 +128,7 @@ unsigned : NumStmtBits; - unsigned NumStmts : 32 - NumStmtBits; - - /// The location of the opening "{". - SourceLocation LBraceLoc; + unsigned NumStmts; }; class LabelStmtBitfields { @@ -1406,7 +1403,10 @@ friend class ASTStmtReader; friend TrailingObjects; - /// The location of the closing "}". LBraceLoc is stored in CompoundStmtBits. + /// The location of the opening "{". + SourceLocation LBraceLoc; + + /// The location of the closing "}". SourceLocation RBraceLoc; CompoundStmt(ArrayRef Stmts, SourceLocation LB, SourceLocation RB); @@ -1420,9 +1420,8 @@ // Build an empty compound statement with a location. explicit CompoundStmt(SourceLocation Loc) - : Stmt(CompoundStmtClass), RBraceLoc(Loc) { + : Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) { CompoundStmtBits.NumStmts = 0; - CompoundStmtBits.LBraceLoc = Loc; } // Build an empty compound statement. @@ -1505,10 +1504,10 @@ return const_cast(this)->getStmtExprResult(); } - SourceLocation getBeginLoc() const { return CompoundStmtBits.LBraceLoc; } + SourceLocation getBeginLoc() const { return LBraceLoc; } SourceLocation getEndLoc() const { return RBraceLoc; } - SourceLocation getLBracLoc() const { return CompoundStmtBits.LBraceLoc; } + SourceLocation getLBracLoc() const { return LBraceLoc; } SourceLocation getRBracLoc() const { return RBraceLoc; } static bool classof(const Stmt *T) { diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -363,10 +363,9 @@ CompoundStmt::CompoundStmt(ArrayRef Stmts, SourceLocation LB, SourceLocation RB) - : Stmt(CompoundStmtClass), RBraceLoc(RB) { + : Stmt(CompoundStmtClass), LBraceLoc(LB), RBraceLoc(RB) { CompoundStmtBits.NumStmts = Stmts.size(); setStmts(Stmts); - CompoundStmtBits.LBraceLoc = LB; } void CompoundStmt::setStmts(ArrayRef Stmts) { diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -155,7 +155,7 @@ while (NumStmts--) Stmts.push_back(Record.readSubStmt()); S->setStmts(Stmts); - S->CompoundStmtBits.LBraceLoc = readSourceLocation(); + S->LBraceLoc = readSourceLocation(); S->RBraceLoc = readSourceLocation(); }