From a2484b251bb821561b626d55702c435b33267df1 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Tue, 27 Feb 2018 13:48:27 +0000 Subject: clang-format: use AfterControlStatement to format ObjC control blocks ObjC defines `@autoreleasepool` and `@synchronized` control blocks. These used to be formatted according to the `AfterObjCDeclaration` brace- wrapping flag, which is not very consistent. This patch changes the behavior to use the `AfterControlStatement` flag instead. This should not affect the behavior unless a custom brace wrapping mode is used. Reviewers: krasimir, djasper, klimek, benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43232 llvm-svn: 326192 --- clang/lib/Format/UnwrappedLineParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Format/UnwrappedLineParser.cpp') diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 8ab61f900c9..5ab5cc46cdc 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1129,7 +1129,7 @@ void UnwrappedLineParser::parseStructuralElement() { case tok::objc_autoreleasepool: nextToken(); if (FormatTok->Tok.is(tok::l_brace)) { - if (Style.BraceWrapping.AfterObjCDeclaration) + if (Style.BraceWrapping.AfterControlStatement) addUnwrappedLine(); parseBlock(/*MustBeDeclaration=*/false); } @@ -1141,7 +1141,7 @@ void UnwrappedLineParser::parseStructuralElement() { // Skip synchronization object parseParens(); if (FormatTok->Tok.is(tok::l_brace)) { - if (Style.BraceWrapping.AfterObjCDeclaration) + if (Style.BraceWrapping.AfterControlStatement) addUnwrappedLine(); parseBlock(/*MustBeDeclaration=*/false); } -- cgit v1.2.3