From 94498c70ae44d51835f4a7110877ed77c48251b2 Mon Sep 17 00:00:00 2001 From: Bruno Ricci Date: Sat, 26 Jan 2019 13:58:15 +0000 Subject: [AST][NFC] Various cleanups to GenericSelectionExpr Various cleanups to GenericSelectionExpr factored out of D57104. In particular: 1. Move the friend declaration to the top. 2. Introduce a constant ResultDependentIndex instead of the magic "-1". 3. clang-format 4. Group the member function together so that they can be removed as one block by D57106. NFC. Differential Revision: https://reviews.llvm.org/D57238 Reviewed By: aaron.ballman llvm-svn: 352275 --- clang/lib/Serialization/ASTWriterStmt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp') diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index cd1aae4cebb..582d9933a0c 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -969,13 +969,13 @@ void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) { void ASTStmtWriter::VisitGenericSelectionExpr(GenericSelectionExpr *E) { VisitExpr(E); Record.push_back(E->getNumAssocs()); + Record.push_back(E->ResultIndex); Record.AddStmt(E->getControllingExpr()); for (unsigned I = 0, N = E->getNumAssocs(); I != N; ++I) { Record.AddTypeSourceInfo(E->getAssocTypeSourceInfo(I)); Record.AddStmt(E->getAssocExpr(I)); } - Record.push_back(E->isResultDependent() ? -1U : E->getResultIndex()); Record.AddSourceLocation(E->getGenericLoc()); Record.AddSourceLocation(E->getDefaultLoc()); -- cgit v1.2.3