From e7bcad327814a78ecb8d5f5545d2e3df84c67a5c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 5 Jul 2015 14:23:59 +0000 Subject: Vendor import of clang trunk r241361: https://llvm.org/svn/llvm-project/cfe/trunk@241361 --- lib/Format/UnwrappedLineParser.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/Format/UnwrappedLineParser.cpp') diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index ea1ca39..c58e6bc 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -656,6 +656,16 @@ void UnwrappedLineParser::parseStructuralElement() { nextToken(); addUnwrappedLine(); return; + case tok::objc_autoreleasepool: + nextToken(); + if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BreakBeforeBraces == FormatStyle::BS_Allman || + Style.BreakBeforeBraces == FormatStyle::BS_GNU) + addUnwrappedLine(); + parseBlock(/*MustBeDeclaration=*/false); + } + addUnwrappedLine(); + return; case tok::objc_try: // This branch isn't strictly necessary (the kw_try case below would // do this too after the tok::at is parsed above). But be explicit. @@ -1101,16 +1111,15 @@ bool UnwrappedLineParser::parseBracedList(bool ContinueOnSemicolons) { FormatTok->BlockKind = BK_BracedInit; parseBracedList(); break; - case tok::r_paren: + case tok::l_paren: + parseParens(); // JavaScript can just have free standing methods and getters/setters in // object literals. Detect them by a "{" following ")". if (Style.Language == FormatStyle::LK_JavaScript) { - nextToken(); if (FormatTok->is(tok::l_brace)) parseChildBlock(); break; } - nextToken(); break; case tok::r_brace: nextToken(); -- cgit v1.1