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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327986: [clang-format] Fix ObjC selectors with multiple params passed to macro (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llv

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139125. benhamilton marked 2 inline comments as done. benhamilton added a comment. clang-format Repository: rC Clang https://reviews.llvm.org/D44632 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a subscriber: krasimir. benhamilton added a comment. @krasimir, can you answer @djasper's question about hash set vs. binary search? Comment at: lib/Format/Format.cpp:1450 // Keep this array sorted, since we are binary searching over it. static const

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139127. benhamilton added a comment. clang-format Repository: rC Clang https://reviews.llvm.org/D44634 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ==

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139136. benhamilton added a comment. Add assert(std::is_sorted(...)). (We can't static_assert on is_sorted until C++2x.) Repository: rC Clang https://reviews.llvm.org/D44632 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: u

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 139137. benhamilton added a comment. Add assert(std::is_sorted(...)). (We can't static_assert on is_sorted until C++2x.) Repository: rC Clang https://reviews.llvm.org/D44634 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp Index: un

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked 4 inline comments as done. benhamilton added inline comments. Comment at: lib/Format/Format.cpp:1450 // Keep this array sorted, since we are binary searching over it. static constexpr llvm::StringLiteral FoundationIdentifiers[] = { "CGFloat",

[PATCH] D47095: [clang-format/ObjC] Correctly parse Objective-C methods with 'class' in name

2018-05-30 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC333553: [clang-format/ObjC] Correctly parse Objective-C methods with 'class' in name (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D47095?vs=148231&id=14912

[PATCH] D46922: [checks/property-decls] Fix comment in clang-tidy/objc/PropertyDeclarationCheck.cpp โœ๏ธ

2018-06-07 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334238: [checks/property-decls] Fix comment in clang-tidy/objc/PropertyDeclarationCheck. (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: http

[PATCH] D46922: [checks/property-decls] Fix comment in clang-tidy/objc/PropertyDeclarationCheck.cpp โœ๏ธ

2018-06-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Is it possible to get someone to land this for me? I don't believe I have > access to land it myself. Done. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46922 ___ cfe-commits mailing list cfe-commi

[PATCH] D47393: [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objective-C ๐Ÿ“œ

2018-06-14 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I'll just land it for you. Repository: rC Clang https://reviews.llvm.org/D47393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47393: [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objective-C ๐Ÿ“œ

2018-06-14 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334739: [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style forโ€ฆ (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https:/

[PATCH] D53197: [clang-format] Fix BraceWrapping AfterFunction for ObjC methods

2018-10-12 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. Thanks! Repository: rC Clang https://reviews.llvm.org/D53197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D53197: [clang-format] Fix BraceWrapping AfterFunction for ObjC methods

2018-10-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC344406: [clang-format] Fix BraceWrapping AfterFunction for ObjC methods (authored by benhamilton, committed by ). Repository: rC Clang https://reviews.llvm.org/D53197 Files: lib/Format/UnwrappedLine

[PATCH] D53197: [clang-format] Fix BraceWrapping AfterFunction for ObjC methods

2018-10-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > @benhamilton Could you land this patch? Done. Thanks for your contribution! Repository: rC Clang https://reviews.llvm.org/D53197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

[PATCH] D56909: [clang-format] Fix line parsing for noexcept lambdas

2019-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Herald added a subscriber: llvm-commits. So sorry for the delay. I've landed this diff as rC352622 . Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56909/new/ https://reviews.llvm.org/D56909 __

[PATCH] D56909: [clang-format] Fix line parsing for noexcept lambdas

2019-01-30 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352622: [clang-format] Fix line parsing for noexcept lambdas (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D56909?vs=182514&id=184281#toc Repository: rL

[PATCH] D57513: [please ignore] Clang test revision for new Herald rules for Github monorepo

2019-01-31 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 184499. benhamilton added a comment. Herald added a subscriber: cfe-commits. Herald added a project: clang. - Another update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57513/new/ https://reviews.llvm.org

[PATCH] D54110: [Format] Add debugging to ObjC language guesser

2018-11-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added a reviewer: krasimir. Herald added a subscriber: cfe-commits. To handle diagnosing bugs where ObjCHeaderStyleGuesser guesses wrong, this diff adds a bit more debug logging to the Objective-C language guesser. Repository: rC Clang https://re

[PATCH] D54110: [Format] Add debugging to ObjC language guesser

2018-11-05 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC346144: [Format] Add debugging to ObjC language guesser (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D54110?vs=172599&id=172600#toc Repository: rC Clang

[PATCH] D54111: [clang-format] Do not threat the asm clobber [ as ObjCExpr

2018-11-05 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. In the diff description, please fix the typo: `Do not threat the asm clobber` -> `Do not treat the asm clobber` Comment at: unittests/Format/FormatTest.cpp:12756-1

[PATCH] D51575: [clang-tidy/checks] Implement a clang-tidy check to verify Google Objective-C function naming conventions ๐Ÿ“œ

2018-11-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: docs/clang-tidy/checks/google-objc-function-naming.rst:20 + static bool is_positive(int i) { return i > 0; } + bool IsNegative(int i) { return i < 0; } + This is not actually handled by the check, right? (You even

[PATCH] D55101: [clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-naming check ๐Ÿ™ˆ

2018-11-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. IMHO we should just disable this check entirely for C++ files (including Objective-C++). Since Objective-C++ files will have a mix of the Google Objective-C and Google C++ styles, I think there will be too many places where we'll hit conflicts like this (there are

[PATCH] D55101: [clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-naming check ๐Ÿ™ˆ

2018-11-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Would you be okay with landing this fix and if we get any further reports for > Objective-C++ sources then we can suppress it in all C++/Objective-C++ > sources? I think there is enough value to enforcing the naming conventions on > non-namespaced C functions in O

[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics ๐Ÿ“™

2018-12-10 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. Thanks, just minor suggestions. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:114-118 diag(MatchedDecl->getLocation(), - "function name %0 not usin

[PATCH] D60920: [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod`

2019-04-19 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. LGTM! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60920/new/ https://reviews.llvm.org/D60920 ___ cfe

[PATCH] D60920: [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod`

2019-04-22 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC358904: [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`โ€ฆ (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D60920?vs=195905&id=19

[PATCH] D57623: [please ignore, v2] Clang test revision for new Herald rules for Github monorepo

2019-02-01 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is another test for the new Herald rules to subscribe cfe-commits to revisions sent out from the Github monorepo under the "clang/" subdirectory. Repository: rG LLVM Github Monorepo

[PATCH] D57923: [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow

2019-02-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, djasper. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently, `UnwrappedLineParser` thinks an arrow token after an ObjC method expression is a C++ lambda arrow, so it formats: [foo bar]->baz

[PATCH] D57923: [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow

2019-02-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 185859. benhamilton added a comment. Tidy up code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57923/new/ https://reviews.llvm.org/D57923 Files: clang/lib/Format/TokenAnnotator.cpp clang/lib/Format/U

[PATCH] D57923: [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow

2019-02-08 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC353531: [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D57923?vs=185859&id=185975#toc Repository

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Thanks for the fix. One question: how does the real Clang parser deal with this case? Is it something that's actually ambiguous in the ObjC++ grammar, I wonder? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64632/new/

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:400-413 while (AttrTok && !AttrTok->startsSequence(tok::r_square, tok::r_square)) { // ObjC message send. We assume nobody will use : in a C++11 attribute // specifier parameter,

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-12 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. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64632/new/ https://reviews.llvm.org/D64632 __

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:7030-7032 + // Make sure that we do not mistake a call to the Objective-C method named + // "class" inside an array literal as attributes. + verifyFormat("@[ [NSArray class] ];");

[PATCH] D64775: [Format/ObjC] Avoid breaking between unary operators and ObjC method invocations

2019-07-15 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: krasimir, djasper, sammccall. Herald added a project: clang. Herald added a subscriber: cfe-commits. Test Plan: New tests added. Ran tests with: % ninja FormatTests && ./tools/clang/unittests/Format/FormatTests Confirmed tests

[PATCH] D64775: [Format/ObjC] Avoid breaking between unary operators and ObjC method invocations

2019-07-16 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 210095. benhamilton marked an inline comment as done. benhamilton added a comment. - Rebase. - Change to just avoid breaking when the left-hand side is a unary operator Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D64775: [Format/ObjC] Avoid breaking between unary operators and ObjC method invocations

2019-07-16 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2427-2428 return 50; + if (Left.is(TT_UnaryOperator) && Right.is(TT_ObjCMethodExpr)) +return 60; sammccall wrote: > This l

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-16 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366267: [clang-format] Don't detect call to ObjC class method as C++11 attributeโ€ฆ (authored by benhamilton, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed p

[PATCH] D64632: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

2019-07-16 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Submitted as r366267. Thanks! Comment at: clang/lib/Format/TokenAnnotator.cpp:389 bool isCpp11AttributeSpecifier(const FormatToken &Tok) { if (!Style.isCpp() || !Tok.startsSequence(tok::l_square, tok::l_square)) return false;

[PATCH] D64775: [Format/ObjC] Avoid breaking between unary operators and ObjC method invocations

2019-07-17 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added a comment. Any more thoughts on this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64775/new/ https://reviews.llvm.org/D64775 ___ cfe-co

[PATCH] D64775: [Format/ObjC] Avoid breaking between unary operators and operands

2019-07-19 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366592: [Format/ObjC] Avoid breaking between unary operators and operands (authored by benhamilton, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D65012: Adds support for formatting NS_CLOSED_ENUM alongside NS_ENUM.

2019-07-19 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! Don't forget the CF version. Comment at: clang/lib/Format/FormatToken.h:793 IdentifierInfo *kw_CF_OPTIONS; + IdentifierInfo *kw_NS_CLOSED_ENUM

[PATCH] D65012: Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

2019-07-22 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. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65012/new/ https://reviews.llvm.org/D65012

[PATCH] D65012: Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

2019-07-22 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Oh, I forgot there's one more place you should touch โ€” the Objective-C style guesser for headers will need to be updated to understand that `NS_CLOSED_ENUM` indicates Objective-C: https://reviews.llvm.org/source/llvm-github/browse/master/clang/lib/Format/Format.cpp$

[PATCH] D65012: Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

2019-07-22 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366719: Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUMโ€ฆ (authored by benhamilton, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Ch

[PATCH] D62045: Modified global variable declaration to fit updated objc guide.

2019-05-17 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-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp:51-52 + + auto NewName = "g" + llvm::StringRef(std::string(1, FC)

[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics ๐Ÿ“™

2018-12-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:115 diag(MatchedDecl->getLocation(), - "function name %0 not using function naming conventions described by " - "Google Objective-C style guide") - << MatchedDecl << gener

[PATCH] D55545: Allow IncludeSorter to use #import for Objective-C files

2018-12-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/utils/IncludeSorter.cpp:116 bool IsAngled) { + std::string IncludeDirective = LangOpts->ObjC ? "#import " : "#include "; std::string IncludeStmt =

[PATCH] D56226: [clang-format] square parens that are followed by '=' are not Objective-C message sends

2019-01-07 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:501 +CurrentToken->Next->is(tok::equal))) || + (CurrentToken->Previous->Previous == Left)) && Left->is(TT_ObjCMethodExpr)) { I thin

[PATCH] D67567: New ClangTidy check to warn when storing dispatch_once_t in non-static, non-global storage

2019-09-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. It definitely shouldn't be in an `osx` directory since it's available on iOS and other Darwin-like operating systems. Probably `darwin` would be OK. Adding a new subdirectory isn't trivial, there's a lot of places to update last I looked. Should we tackle moving th

[PATCH] D45526: [clang-format] Do not break after ObjC category open paren

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 142182. benhamilton marked an inline comment as done. benhamilton added a comment. - Update comment. Repository: rC Clang https://reviews.llvm.org/D45526 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/

[PATCH] D45526: [clang-format] Do not break after ObjC category open paren

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:2276 + // In Objective-C type declarations, prefer breaking after the category's + // close paren instead of after the open paren. + if (Line.Type == LT_ObjCDecl && Left.is(tok::l_paren) && Left.Previ

[PATCH] D45004: [clang-format] Always indent wrapped Objective-C selector names

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 142183. benhamilton marked an inline comment as done. benhamilton added a comment. Update comment. Repository: rC Clang https://reviews.llvm.org/D45004 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp unittests/Format/

[PATCH] D45004: [clang-format] Always indent wrapped Objective-C selector names

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: unittests/Format/FormatTest.cpp:7666 FormatStyle Style = getLLVMStyle(); + // ObjC ignores IndentWrappedFunctionNames when wrapping methods. Style.IndentWrappedFunctionNames = false; djasper wrote: > maybe: ..

[PATCH] D45498: [clang-format] Don't insert space between ObjC class and lightweight generic

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 142186. benhamilton marked an inline comment as done. benhamilton added a comment. Avoid else after return. Clean up logic so it doesn't need a comment. Repository: rC Clang https://reviews.llvm.org/D45498 Files: lib/Format/TokenAnnotator.cpp uni

[PATCH] D45521: [clang-format] Improve ObjC guessing heuristic by supporting all @keywords

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329918: [clang-format] Improve ObjC guessing heuristic by supporting all @keywords (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews

[PATCH] D45498: [clang-format] Don't insert space between ObjC class and lightweight generic

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329917: [clang-format] Don't insert space between ObjC class and lightweight generic (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://revie

[PATCH] D45004: [clang-format] Always indent wrapped Objective-C selector names

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC329916: [clang-format] Always indent wrapped Objective-C selector names (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D45004?vs=142183&id=142187#toc Reposi

[PATCH] D45526: [clang-format] Do not break after ObjC category open paren

2018-04-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329919: [clang-format] Do not break after ObjC category open paren (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D45526

[PATCH] D45750: add extra acronyms for objc property names

2018-04-18 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:42 constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = { +"[2-9]G", "ACL", -

[PATCH] D46143: [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier

2018-04-26 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: djasper, jolesiak. Herald added subscribers: cfe-commits, klimek. Previously, we checked tokens for `tok::identifier` to see if they were identifiers inside an Objective-C selector. However, this missed C++ keywords like `new` and `d

[PATCH] D46143: [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier

2018-04-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 144357. benhamilton added a comment. Add helper canBeObjCSelectorComponent() with comments. Repository: rC Clang https://reviews.llvm.org/D46143 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/Fo

[PATCH] D46143: [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier

2018-04-27 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331067: [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D46143?vs=144357&id=144377#toc

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length

[PATCH] D46206: [clang-tidy] Add Apple prefix acronyms to objc-property-declaration

2018-04-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: Wizard, hokein. Herald added subscribers: cfe-commits, xazax.hun, klimek. This adds a few common Apple first-party API prefixes as acronyms to `objc-property-declaration`. Here's a list showing where these come from: http://nshipste

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: alexfh, bkramer. Herald added subscribers: cfe-commits, klimek. The `google-runtime-int` check currently fires on calls like: printf("%lu", (unsigned long)foo); However, the style guide says: > Where possible, avoid passing argum

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-05-01 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked 2 inline comments as done. benhamilton added a comment. Thanks for the review. Added another test. Comment at: test/clang-tidy/google-runtime-int.cpp:77 +__attribute__((__format__ (__printf__, 1, 2))) +void myprintf(const char* s, ...); + ale

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-05-01 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 144717. benhamilton added a comment. Add another test for printf without attribute Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46293 Files: clang-tidy/google/IntegerTypesCheck.cpp test/clang-tidy/google-runtime-int.cpp Index: t

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-05-01 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 rL331268: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()โ€ฆ (authored by benhamilton, committed by ). Herald added a subscriber: llvm

[PATCH] D46206: [clang-tidy] Add Apple prefix acronyms to objc-property-declaration

2018-05-01 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331267: [clang-tidy] Add Apple prefix acronyms to objc-property-declaration (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.o

[PATCH] D46374: Add support for ObjC property name to be a single acronym.

2018-05-03 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:222 + [MatchedDecl](std::string const &s) { +return s ==

[PATCH] D46374: Add support for ObjC property name to be a single acronym.

2018-05-04 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:222 + [MatchedDecl](std::string const &s) { +auto Acronym = llvm:

[PATCH] D48652: [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declaration

2018-06-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added a reviewer: Wizard. Herald added a subscriber: cfe-commits. This PR adds a few acronyms related to hashing algorithms to the standard list in `objc-property-declaration`. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48652 F

[PATCH] D48352: [clang-format] Improve ObjC method expressions formatting

2018-06-27 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. It's really hard to understand reviews which change 4 different things. I hate to ask, but can you split this up into the 4 fixes? Repository: rC Clang https://reviews.

[PATCH] D48652: [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declaration

2018-06-27 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335770: [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declaration (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://revi

[PATCH] D48679: [clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl

2018-06-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: djasper, krasimir. Herald added a subscriber: cfe-commits. In https://reviews.llvm.org/D44638, I partially fixed `NS_SWIFT_NAME(foo(bar:baz:))`-style annotations on C functions, but didn't add a test for Objective-C method declaratio

[PATCH] D48716: [clang-format] Fix counting parameters/arguments for ObjC

2018-06-28 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. > Count selector parts also for method declarations. What bug does this fix? Can you add a test which breaks before this change and is fixed by this change?

[PATCH] D48718: [clang-format] Prohibit breaking after a bracket opening ObjC method expression

2018-06-28 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 a test, please? Repository: rC Clang https://reviews.llvm.org/D48718 ___ cfe-commits mailing list cfe-commits@

[PATCH] D48679: [clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl

2018-06-29 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335983: [clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl (authored by benhamilton, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://review

[PATCH] D48719: [clang-format] Fix split priorities for ObjC methods

2018-06-29 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. Nice improvement! Repository: rC Clang https://reviews.llvm.org/D48719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D48720: [clang-format] Put ObjC method arguments into one line when they fit

2018-06-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: lib/Format/ContinuationIndenter.cpp:1411 + // line). + if (Current.MatchingParen && Current.MatchingParen->Previous) { +const FormatToken &Cur

[PATCH] D48716: [clang-format] Fix counting parameters/arguments for ObjC

2018-07-02 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. In https://reviews.llvm.org/D48716#1149293, @jolesiak wrote: > General comment to changes https://reviews.llvm.org/D48716, > https://reviews.llvm.org/D48718, https://reviews.llvm.org

[PATCH] D48718: [clang-format] Prohibit breaking after a bracket opening ObjC method expression

2018-07-02 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. > Sorry for the confusion. If you prefer me to add this test and modify in > later commit I'll do it. I see. Just mentioning what you did in the diff description is probably OK. Re

[PATCH] D49190: [clang-tidy/ObjC] Add SQL to list of acronyms

2018-07-11 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: Wizard, hokein. Herald added a subscriber: cfe-commits. SQL is a common acronym. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49190 Files: clang-tidy/objc/PropertyDeclarationCheck.cpp Index: clang-tidy/objc/P

[PATCH] D49190: [clang-tidy/ObjC] Add SQL to list of acronyms

2018-07-12 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE336919: [clang-tidy/ObjC] Add SQL to list of acronyms (authored by benhamilton, committed by ). Changed prior to commit: https://reviews.llvm.org/D49190?vs=155004&id=155216#toc Repository: rCTE Cla

[PATCH] D77571: Add ClangTidy check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

2020-04-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-tools-extra/clang-tidy/objc/NsinvocationArgumentLifetimeCheck.cpp:71-73 + // Currently there is no way to directly get the source range for

[PATCH] D40494: [clang] Set up .arcconfig to point to new Diffusion C repository

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. We want to automatically copy cfe-commits@ on review requests to the clang repository. Similar to https://reviews.llvm.org/D40179, I set up a new Diffusion repository with callsign "C" for clang: https://reviews.llvm.org/source/clang/ This explicitly updates

[PATCH] D40500: [libcxx] Set up .arcconfig to point to new Diffusion CXX repository

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. Herald added a subscriber: cfe-commits. We want to automatically copy the appropriate mailing list for review requests to the libc++ repository. For context, see the proposal and discussion here: http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

[PATCH] D40501: [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. Herald added a subscriber: cfe-commits. We want to automatically copy the appropriate mailing list for review requests to the libc++abi repository. For context, see the proposal and discussion here: http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.h

[PATCH] D40325: add new check to find OSSpinlock usage

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/objc/AvoidSpinlockCheck.cpp:22-24 + if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { +return; + } Why? `OSSpinLock()` calls should also be avoided in C++. I think you should remove this. =

[PATCH] D40325: add new check to find OSSpinlock usage

2017-11-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/AvoidSpinlockCheck.cpp:31-32 + diag(MatchedExpr->getLocStart(), + "deprecated usage of OSSpinlock; Please use other locks or

[PATCH] D40325: add new check to find OSSpinlock usage

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Thanks, looks good. Just one question about the test. Comment at: test/clang-tidy/objc-avoid-spinlock.m:4 +typedef int OSSpinLock; +void OSSpinlockTry(OSSpinLock *__lock) {} + Not sure why you declared (and defined?) this one but no

[PATCH] D40325: add new check to find OSSpinlock usage

2017-11-27 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: test/clang-tidy/objc-avoid-spinlock.m:4 +typedef int OSSpinLock; +void OSSpinlockTry(OSSpinLock *__lock) {} + Wizard wrote: > benhamilton wrote: > > Not sure why you declared (and defined?) this one but not the other

[PATCH] D40500: [libcxx] Set up .arcconfig to point to new Diffusion CXX repository

2017-12-04 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL319666: [libcxx] Set up .arcconfig to point to new Diffusion CXX repository (authored by benhamilton). Repository: rL LLVM https://reviews.llvm.org/D40500 Files: libcxx/trunk/.arcconfig Index: lib

[PATCH] D40501: [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository

2017-12-04 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL319713: [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository (authored by benhamilton). Repository: rL LLVM https://reviews.llvm.org/D40501 Files: libcxxabi/trunk/.arcconfig Ind

[PATCH] D41074: [ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style

2017-12-11 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. Herald added a subscriber: cfe-commits. The Google style guide is neutral on whether there should be a space before the protocol list in an Objective-C @interface or @implementation. The majority of Objective-C code in both Apple's public header files and Google

[PATCH] D41074: [ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style

2017-12-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 126806. benhamilton added a comment. Herald added a subscriber: klimek. Rebase Repository: rC Clang https://reviews.llvm.org/D41074 Files: lib/Format/Format.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/FormatTestObjC.cpp

<    1   2   3   4   >