[PATCH] D44638: [clang-format] Fix ObjC selectors with multiple params passed to macro

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: jolesiak, djasper, Wizard. Herald added subscribers: cfe-commits, klimek. Objective-C selectors can with arguments be in the form: foo: foo:bar: foo:bar:baz: These can be passed to a macro, like NS_SWIFT_NAME(): https://developer.a

[PATCH] D44539: [Sema][Objective-C] Add check to warn when property of objc type has assign attribute

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I wonder if this wouldn't be better as a clang-tidy check: https://github.com/llvm-mirror/clang-tools-extra/tree/master/clang-tidy/objc Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing lis

[PATCH] D44634: [clang-format] Detect Objective-C for #import

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: jolesiak, djasper. Herald added subscribers: cfe-commits, klimek. Previously, the Objective-C heuristic failed to detect headers which #imported Objective-C system framework(s) and declared C functions on top them. This extends the h

[PATCH] D44632: [clang-format] Add a few more Core Graphics identifiers to ObjC heuristic

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: jolesiak, djasper. Herald added subscribers: cfe-commits, klimek. We received reports of the Objective-C style guesser getting a false negative on header files like: CGSize SizeOfThing(MyThing thing); This adds more Core Graphics id

[PATCH] D25820: [Sema][Objective-C] Formatting warnings should see through Objective-C message sends

2018-03-14 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. >@benhamilton We're planning to use the new attribute in >https://reviews.llvm.org/D27165 to address this issue. I'll get back to that >patch in the near future. Great, thanks for the update. Repository: rL LLVM https://reviews.llvm.org/D25820 __

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. benhamilton marked an inline comment as done. Closed by commit rC327285: [clang-format] Improve detection of Objective-C block types (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rC327284: [clang-format] Don't detect C++11 attribute specifiers as ObjC (authored by benhamilton, committed by ). Changed

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 138024. benhamilton added a comment. - Restore short functionn type variable names and add clarifying comment. Repository: rC Clang https://reviews.llvm.org/D43906 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp unittests/F

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:210 -bool MightBeFunctionType = !Contexts[Contexts.size() - 2].IsExpression; -bool ProbablyFunctionType = CurrentToken->isOneOf(tok::star, tok::amp

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-08 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Great, I refactored it to avoid parsing the matching parens, so there's no more danger of O(N^2) parsing behavior. I had to add a new `InCpp11AttributeSpecifier` boolean to `Context` so when parsing the inner `[]` we didn't treat it as an ObjC message send or an arr

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-08 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137696. benhamilton marked 9 inline comments as done. benhamilton added a comment. Refactor to avoid matching open and close parens. Fix @djasper comments. Repository: rC Clang https://reviews.llvm.org/D43902 Files: lib/Format/ContinuationIndenter.

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-08 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I made it longer so the two lines (__attribute__((foo)) vs. [[foo]]) had the same length. If I shorten it much more, everything goes on one line. Repository: rC Clang https://reviews.llvm.org/D43902 ___ cfe-commits m

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:152 + const FormatToken *Next = CurrentToken->getNextNonComment(); + int ParenDepth = 1; + // Handle nested parens in case we have an array of blocks with djasper wrote: >

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137394. benhamilton added a comment. - Greatly clean up ObjC block type logic by re-using `TT_FunctionTypeLParen` type logic. Repository: rC Clang https://reviews.llvm.org/D43906 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.c

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137320. benhamilton added a comment. Fix comment. Repository: rC Clang https://reviews.llvm.org/D43906 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/FormatTest

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Right. So the difference is that for blocks, there is always a "(" after the > "(^.)". That should be easy to parse, no? Yep, I've updated this diff to implement that as you recommended. I just had to handle nested parens (I couldn't find an existing way to de

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137319. benhamilton added a comment. - Simplify logic and assume we have an ObjC block whenever we see rparen at the end of `(^...)(`. Repository: rC Clang https://reviews.llvm.org/D43906 Files: lib/Format/TokenAnnotator.cpp unittests/Format/For

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:155 + Next->startsSequence(tok::identifier, tok::l_square, +tok::numeric_constant, tok::r_square, +tok::r_paren, tok::l_paren)))

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326815: [clang-format] Improve detection of ObjC for-in statements (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D4

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:155 + Next->startsSequence(tok::identifier, tok::l_square, +tok::numeric_constant, tok::r_square, +tok::r_paren, tok::l_paren)))

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: unittests/Format/FormatTest.cpp:778 +TEST_F(FormatTest, ObjCForInLoop) { + verifyFormat("for (Foo *x = 0; x != in; x++) {\n}"); krasimir wrote: > Please move the ObjC-specific instances to `FormatTestObjC.cpp`. Do

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137199. benhamilton marked an inline comment as done. benhamilton added a comment. - Move ObjC-specific tests to `FormatTestObjC.cpp`. Repository: rC Clang https://reviews.llvm.org/D43904 Files: lib/Format/TokenAnnotator.cpp unittests/Format/Form

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:155 + Next->startsSequence(tok::identifier, tok::l_square, +tok::numeric_constant, tok::r_square, +tok::r_paren, tok::l_paren)))

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Would it be enough to only add the block type case? With the macro false > positive, there won't be an open paren after the closing paren, right? Are you asking to remove the block variable cases? I was concerned those would no longer be handled correctly if we do

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137095. benhamilton marked 2 inline comments as done. benhamilton added a comment. - Fix comments from @djasper and @krasimir. Repository: rC Clang https://reviews.llvm.org/D43906 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.c

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:288 +if (MightBeObjCForRangeLoop) { + FormatToken *ForInToken = Left; djasper wrote: > There can be only one ObjCForIn token in any for loop, right? If that's the > c

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137093. benhamilton added a comment. One more cleanup Repository: rC Clang https://reviews.llvm.org/D43904 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp =

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137092. benhamilton marked an inline comment as done. benhamilton added a comment. - Fix comments from @djasper and @krasimir. Repository: rC Clang https://reviews.llvm.org/D43904 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.c

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:323 + const FormatToken *parseCpp11Attribute(const FormatToken &Tok, + bool NamespaceAllowed) { krasimir wrote: > Please inline this into the o

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137089. benhamilton marked 5 inline comments as done. benhamilton added a comment. - Fix comments from @krasimir and @djasper. Repository: rC Clang https://reviews.llvm.org/D43902 Files: lib/Format/ContinuationIndenter.cpp lib/Format/FormatToken.

[PATCH] D25820: [Sema][Objective-C] Formatting warnings should see through Objective-C message sends

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I filed rdar://38143508 to track this. The fix won't be easy; I think `__attribute__((format_arg(X)))` isn't enough to capture how `-[NSBundle localizedStringForKey:value:table:]` works: 1. `__attribute__((format_arg(X)))` doesn't support multiple format arguments,

[PATCH] D25820: [Sema][Objective-C] Formatting warnings should see through Objective-C message sends

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > That does look like a bug in the SDK, to me. OK. I'll file a Radar bug upstream; in the meantime, this means since this diff landed in 2016, clang has been raising `-Wformat-extra-args` when compiling any code which passes the result of `-[NSBundle localizedStri

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Thanks very much for the code review. I fixed those issues. Comment at: lib/Format/TokenAnnotator.cpp:323 + const FormatToken *parseCpp11Attribute(const FormatToken *Tok, + bool NamespaceAllowed) {

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 137015. benhamilton marked 7 inline comments as done. benhamilton added a comment. Fixes from @jolesiak Repository: rC Clang https://reviews.llvm.org/D43902 Files: lib/Format/FormatToken.h lib/Format/TokenAnnotator.cpp unittests/Format/FormatTe

[PATCH] D25820: [Sema][Objective-C] Formatting warnings should see through Objective-C message sends

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Actually, looking more deeply, it's possible this is a bug in the Apple SDK: @interface NSBundle - (NSString *)localizedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName __attribute__((format_arg(1))); @end Sinc

[PATCH] D25820: [Sema][Objective-C] Formatting warnings should see through Objective-C message sends

2018-03-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Herald added subscribers: llvm-commits, jkorous-apple. This caused a regression where `__attribute__((format_arg(X))` no longer works with ObjC message sends. I filed https://bugs.llvm.org/show_bug.cgi?id=36599 and will write a fix. Repository: rL LLVM https://r

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:346 + bool parseCpp11AttributeSpecifier(FormatToken *Tok) { +if (!Style.isCpp()) return false; +if (!Tok || !Tok->startsSequence(tok::l_square, tok::l_square)) aaron.ballman wro

[PATCH] D43905: [clang-format] Improve detection of ObjC for-in statements

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak. Previously, clang-format would detect the following as an Objective-C for-in statement: for (int x = in.value(); ...) {} because the logic only decided a for-loop was definitely *not* an Objective-C for-in loop

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak. Herald added a subscriber: cfe-commits. Previously, clang-format would detect the following as an Objective-C block type: FOO(^); when it actually must be a C or C++ macro dealing with an XOR statement or an XO

[PATCH] D43905: [clang-format] Improve detection of ObjC for-in statements

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton abandoned this revision. benhamilton added a comment. Whoops, sent out twice. Repository: rC Clang https://reviews.llvm.org/D43905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak. Herald added a subscriber: cfe-commits. Previously, clang-format would detect the following as an Objective-C for-in statement: for (int x = in.value(); ...) {} because the logic only decided a for-loop was def

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-02-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak. Herald added a subscriber: cfe-commits. Previously, clang-format would detect C++11 and C++17 attribute specifiers like the following as Objective-C method invocations: [[noreturn]]; [[clang::fallthrough]];

[PATCH] D43775: add UUID to the acronyms list of objc property name checks

2018-02-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. LGTM. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43598: [clang-format] Tidy up new API guessLanguage()

2018-02-27 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326205: [clang-format] Tidy up new API guessLanguage() (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D43598?vs=1353

[PATCH] D43732: Resolve build bot problems in unittests/Format/FormatTest.cpp

2018-02-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Actually, looks like all the other tests explicitly want a non-empty in-memory FS, so there's no good cleanup I can do. Repository: rC Clang https://reviews.llvm.org/D43732 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D43732: Resolve build bot problems in unittests/Format/FormatTest.cpp

2018-02-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Thanks for fixing this. (Sorry for not getting to it, I was away traveling until today.) I'll add a tidy-up in https://reviews.llvm.org/D43598 to ensure all tests which call `getStyle()` pass in an in-memory filesystem. Repository: rC Clang https://reviews.llvm

[PATCH] D43775: add UUID to the acronyms list of objc property name checks

2018-02-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added inline comments. This revision is now accepted and ready to land. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:52 "GIF", "GPS", "HD", Might as well also add GUID. Repository: rC

[PATCH] D43598: [clang-format] Tidy up new API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added a reviewer: djasper. Herald added subscribers: cfe-commits, klimek. This fixes a few issues djasper@ brought up in his review of https://reviews.llvm.org/D43522. Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Follow-ups (aside from the case, which I already fixed) in https://reviews.llvm.org/D43598. Repository: rL LLVM https://reviews.llvm.org/D43522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: cfe/trunk/lib/Format/Format.cpp:2308 + Guesser.process(); + if (Guesser.isObjC()) { +result = FormatStyle::LK_ObjC; djasper wrote: > benhamilton wrote: > > djasper wrote: > > > In LLVM, we generally

[PATCH] D43590: [clang-format] Fix regression when getStyle() called with empty filename

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325722: [clang-format] Fix regression when getStyle() called with empty filename (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D43590?vs=135314&id=135321#to

[PATCH] D43590: [clang-format] Fix regression when getStyle() called with empty filename

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: vsapsai, jolesiak, krasimir. Herald added subscribers: cfe-commits, klimek. https://reviews.llvm.org/D43522 caused an assertion failure when getStyle() was called with an empty filename: https://reviews.llvm.org/P8065 This adds a t

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: cfe/trunk/lib/Format/Format.cpp:2298 +FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code) { + FormatStyle::LanguageKind result = getLanguageByFileName(FileName); + if (result == FormatStyle::LK_Cpp) { --

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325691: [clang-format] New API guessLanguage() (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D43522?vs=135121&id=135261#toc Repository: rC Clang https:/

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325691: [clang-format] New API guessLanguage() (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D43522 Files: cfe/trunk

[PATCH] D43522: [clang-format] New API guessLanguage()

2018-02-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added a reviewer: jolesiak. Herald added subscribers: cfe-commits, klimek. benhamilton added a reviewer: krasimir. For clients which don't have a filesystem, calling getStyle() doesn't make much sense (there's no .clang-format files to search for). I

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-15 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added a comment. This revision is now accepted and ready to land. Just a question on the test. Comment at: unittests/Format/FormatTestObjC.cpp:193-198 + verifyFormat("@synchronized(self) {\n" + " f();\n" +

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-15 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > This used to happen before as well, and would require fixing > UnwrappedLineFormatter.cpp to understand that these blocks are linked to the > previous ObjC keyword. Good find! Looks like we should fix that and add some more tests with AfterControlStatement set to

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-14 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton requested changes to this revision. benhamilton added a comment. This revision now requires changes to proceed. Thanks! Can you add a test for this, please? Repository: rC Clang https://reviews.llvm.org/D43232 ___ cfe-commits mailing

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1130 +if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BraceWrapping.AfterObjCDeclaration) +addUnwrappedLine(); Typz wrote: > benhamilton wrote: > > T

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-09 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1130 +if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BraceWrapping.AfterObjCDeclaration) +addUnwrappedLine(); Typz wrote: > Wondering if formatting

[PATCH] D43124: [clang-format] Improve ObjC headers detection

2018-02-09 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added a comment. This revision is now accepted and ready to land. testcase Repository: rC Clang https://reviews.llvm.org/D43124 __

[PATCH] D42704: [clang-format] Do not break Objective-C string literals inside array literals

2018-02-08 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324618: [clang-format] Do not break Objective-C string literals inside array literals (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D42704?vs=132031&id=1334

[PATCH] D42708: [clang-format] Set ObjCBinPackProtocolList to Never for google style

2018-02-07 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324553: [clang-format] Set ObjCBinPackProtocolList to Never for google style (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D42708?vs=132189&id=133349#toc R

[PATCH] D42947: Support special acronyms inside property names and allow plural forms

2018-02-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added inline comments. This revision is now accepted and ready to land. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:144 + "[A-Z]?)?[a-z]+[a-z0-9]*(" + + AcronymsGroupRegex(EscapedAcronyms, true) + "|([A-

[PATCH] D42864: [clang-format] Add more tests for Objective-C 2.0 generic alignment

2018-02-06 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324364: [clang-format] Add more tests for Objective-C 2.0 generic alignment (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D42864?vs=132654&id=133036#toc Re

[PATCH] D42864: [clang-format] Add more tests for Objective-C 2.0 generic alignment

2018-02-06 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL324364: [clang-format] Add more tests for Objective-C 2.0 generic alignment (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.o

[PATCH] D42947: Support special acronyms inside property names and allow plural forms

2018-02-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton requested changes to this revision. benhamilton added a comment. This revision now requires changes to proceed. Can you add test cases for non-plural acronyms in the middle of the string and plural acronyms at the start/end of the string, please? Comment at: clang-

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-02-06 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added a comment. > I don't understand why do we introduce an enum option if we are keeping the > default behavior for Google style. IMO we should have a single behavior for > any style and enforce it. https://reviews.llvm.org/D42708 chan

[PATCH] D42704: [clang-format] Do not break Objective-C string literals inside array literals

2018-02-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. @stephanemoore: It appears all warnings are enabled by default unless they are in class `DefaultIgnore`: https://github.com/llvm-mirror/clang/blob/6de2efd1953adaa9a190b2cdfbe7b5c15f6d6efe/include/clang/Basic/Diagnostic.td#L105 This diagnostic is not in `DefaultIgnor

[PATCH] D42704: [clang-format] Do not break Objective-C string literals inside array literals

2018-02-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Ping ping! Repository: rC Clang https://reviews.llvm.org/D42704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42864: [clang-format] Add more tests for Objective-C 2.0 generic alignment

2018-02-02 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: stephanemoore, jolesiak, djasper. Herald added subscribers: cfe-commits, klimek. benhamilton edited the summary of this revision. benhamilton edited the summary of this revision. In r236412, @djasper added a comment: // FIXME: We l

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-02-02 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked 2 inline comments as done. benhamilton added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1214 // FIXME: We likely want to do this for more combinations of brackets. // Verify that it is wanted for ObjC, too. if (Current.is(to

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-02-02 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324131: [clang-format] New format param ObjCBinPackProtocolList (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D42650?vs=132187&id=132650#toc Repository:

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-02-02 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1214 // FIXME: We likely want to do this for more combinations of brackets. // Verify that it is wanted for ObjC, too. if (Current.is(tok::less) && Current.ParentBracket == tok::l_pa

[PATCH] D42812: [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value-param

2018-02-02 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL324097: [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value… (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://re

[PATCH] D42812: [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value-param

2018-02-01 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun, klimek. The following Objective-C code currently incorrectly triggers clang-tidy's performance-unnecessary-value-param check: % cat /tmp/performance-unnecessary-valu

[PATCH] D42704: [clang-format] Do not break Objective-C string literals inside array literals

2018-02-01 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Ping! Any comments? Repository: rC Clang https://reviews.llvm.org/D42704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Thanks! @jolesiak is not available for the rest of the week, so should I just submit this as-is, or wait until next week? Repository: rC Clang https://reviews.llvm.org/D42650 ___ cfe-commits mailing list cfe-commits@

[PATCH] D42708: [clang-format] Set ObjCBinPackProtocolList to Never for google style

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 132189. benhamilton added a comment. Fix comment. Repository: rC Clang https://reviews.llvm.org/D42708 Files: lib/Format/Format.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/FormatTestObjC.cpp =

[PATCH] D42708: [clang-format] Set ObjCBinPackProtocolList to Never for google style

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/Format.cpp:765 GoogleStyle.ColumnLimit = 100; +GoogleStyle.BinPackObjCProtocolList = FormatStyle::BPS_Never; } benhamilton wrote: > jolesiak wrote: > > If I understand correctly this is meant t

[PATCH] D42708: [clang-format] Set ObjCBinPackProtocolList to Never for google style

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 132188. benhamilton marked an inline comment as done. benhamilton added a comment. - BinPackObjCProtocolList -> ObjCBinPackProtocolList Repository: rC Clang https://reviews.llvm.org/D42708 Files: lib/Format/Format.cpp unittests/Format/FormatTestO

[PATCH] D42650: [clang-format] New format param ObjCBinPackProtocolList

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 132187. benhamilton marked 2 inline comments as done. benhamilton added a comment. - BinPackObjCProtocolList -> ObjCBinPackProtocolList Repository: rC Clang https://reviews.llvm.org/D42650 Files: include/clang/Format/Format.h lib/Format/Continuat

[PATCH] D42708: [clang-format] Set BinPackObjCProtocolList to Never for google style

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 132185. benhamilton added a comment. Move to general property section Repository: rC Clang https://reviews.llvm.org/D42708 Files: lib/Format/Format.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/FormatTestObjC.cpp =

[PATCH] D42708: [clang-format] Set BinPackObjCProtocolList to Never for google style

2018-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added inline comments. Comment at: lib/Format/Format.cpp:765 GoogleStyle.ColumnLimit = 100; +GoogleStyle.BinPackObjCProtocolList = FormatStyle::BPS_Never; } jolesiak wrote: > If I understand co

[PATCH] D42650: [clang-format] New format param BinPackObjCProtocolList

2018-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked 3 inline comments as done. benhamilton added a comment. Thanks for the review! Comment at: lib/Format/Format.cpp:765 GoogleStyle.ColumnLimit = 100; +GoogleStyle.BinPackObjCProtocolList = FormatStyle::BPS_Never; } stephanemoore wro

[PATCH] D42708: [clang-format] Set BinPackObjCProtocolList to Never for google style

2018-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak, stephanemoore. This is split off from https://reviews.llvm.org/D42650, and sets BinPackObjCProtocolList to Never for the google style. Depends On https://reviews.llvm.org/D42650 Test Plan: New tests added. make

[PATCH] D42650: [clang-format] New format param BinPackObjCProtocolList

2018-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 132046. benhamilton added a comment. Move Google style changes out. Use clearer name for local variable. Repository: rC Clang https://reviews.llvm.org/D42650 Files: include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Fo

[PATCH] D42704: [clang-format] Do not break Objective-C string literals inside array literals

2018-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: jolesiak, stephanemoore, djasper. Herald added subscribers: cfe-commits, klimek. Concatenating Objective-C string literals inside an array literal raises the warning -Wobjc-string-concatenation (which is enabled by default). clang-fo

[PATCH] D42464: add prefix with '_' support for property name. Corresponding apple dev doc: https://developer.apple.com/library/content/qa/qa1908/_index.html

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added a comment. Thanks! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D42464 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[PATCH] D42464: add prefix with '_' support for property name. Corresponding apple dev doc: https://developer.apple.com/library/content/qa/qa1908/_index.html

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added inline comments. This revision is now accepted and ready to land. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:123 + size_t Start = PropertyName.find_first_of('_'); + assert(Start != llvm::StringRef::npos); + au

[PATCH] D42650: [clang-format] New format param BinPackObjCProtocolList

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 131841. benhamilton added a comment. Rebase Repository: rC Clang https://reviews.llvm.org/D42650 Files: include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp unittests/Format/FormatTestObjC.cpp Index: unitte

[PATCH] D42649: [clang-format] Add more tests for ObjC protocol list formatting behavior

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC323684: [clang-format] Add more tests for ObjC protocol list formatting behavior (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D42649?vs=131821&id=131840#to

[PATCH] D42649: [clang-format] Add more tests for ObjC protocol list formatting behavior

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL323684: [clang-format] Add more tests for ObjC protocol list formatting behavior (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.l

[PATCH] D42493: [clang-format] Fix ObjC message arguments formatting.

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton accepted this revision. benhamilton added a comment. shipit Repository: rC Clang https://reviews.llvm.org/D42493 ___ cfe-commits mailing

[PATCH] D42014: Disable BinPackArguments and BinPackParameters in Google Objective-C style ⚙️

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Check out https://reviews.llvm.org/D42650 for an alternative approach. https://reviews.llvm.org/D42014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42650: [clang-format] New format param BinPackObjCProtocolList

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak, stephanemoore. This is an alternative approach to https://reviews.llvm.org/D42014 after some investigation by stephanemoore@ and myself. Previously, the format parameter `BinPackParameters` controlled both C funct

[PATCH] D42649: [clang-format] Add more tests for ObjC protocol list formatting behavior

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, jolesiak. Herald added subscribers: cfe-commits, klimek. The existing unit tests in FormatTestObjC.cpp didn't fully cover all the cases for protocol confirmance list formatting. This extends the unit tests to more cases of

[PATCH] D42464: add prefix with '_' support for property name. Corresponding apple dev doc: https://developer.apple.com/library/content/qa/qa1908/_index.html

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton requested changes to this revision. benhamilton added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:115 + +bool prefixedPropertyNameMatches(const llvm::StringRef &PropertyName, +

[PATCH] D42395: [clang-format] Fix bug where -dump-config failed on ObjC header

2018-01-29 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. benhamilton marked an inline comment as done. Closed by commit rC323668: [clang-format] Fix bug where -dump-config failed on ObjC header (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.l

<    1   2   3   4   >