[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-06 Thread Ben Hamilton via cfe-commits
@@ -1,5 +1,8 @@ +// RUN: clang-format -assume-filename=foo.m -dump-config | FileCheck %s bhamiltoncx wrote: It looks like you reverted the lit test which just runs `clang-format -dump-config` without any other arguments. Is that what you wanted to do?

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx edited https://github.com/llvm/llvm-project/pull/80628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
@@ -0,0 +1,3 @@ +// RUN: clang-format -dump-config 2>&1 | FileCheck %s bhamiltoncx wrote: Can you also add a test with `clang-format --assume-filename=foo.m -dump-config 2>&1 | FileCheck %s`? It should result in `Language: ObjC`.

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx approved this pull request. Looks good. Can you add one more test, please? https://github.com/llvm/llvm-project/pull/80628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-04 Thread Ben Hamilton via cfe-commits
bhamiltoncx wrote: Interesting! Might be because you changed the logic to always read from stdin if no args are specified? I wasn't quite sure what that part of your change was about. On Sun, Feb 4, 2024, 16:04 Owen Pan ***@***.***> wrote: > @bhamiltoncx Thanks

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-23 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx closed https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -547,18 +547,20 @@ static void PrintVersion(raw_ostream ) { // Dump the configuration. static int dumpConfig(bool IsSTDIN) { std::unique_ptr Code; - // We can't read the code to detect the language if there's no file name. - if (!IsSTDIN) { -// Read in the code in

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx updated https://github.com/llvm/llvm-project/pull/79051 >From 893c295ea7ff5fda9953420068fae2af7457c5c1 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 22 Jan 2024 11:33:18 -0700 Subject: [PATCH] [Format] Fix detection of languages when reading from stdin

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: clang-format -dump-config - < %s | FileCheck %s bhamiltoncx wrote: In this case, we do want two tests (at least, we do need the integration test in `clang/test/Format/dump-config-objc-stdin.m` to reproduce the issue). The reason is,

[clang] [clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (PR #74794)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -544,28 +544,23 @@ static void PrintVersion(raw_ostream ) { } // Dump the configuration. -static int dumpConfig() { - StringRef FileName; +static int dumpConfig(bool IsSTDIN) { std::unique_ptr Code; - if (FileNames.empty()) { -// We can't read the code to detect

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-01-22 Thread Ben Hamilton via cfe-commits
https://github.com/bhamiltoncx created https://github.com/llvm/llvm-project/pull/79051 The code cleanup in #74794 accidentally broke detection of languages by reading file content from stdin, e.g. via `clang-format -dump-config - < /path/to/filename`. This PR adds unit and integration tests

[clang] [clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (PR #74794)

2024-01-22 Thread Ben Hamilton via cfe-commits
@@ -544,28 +544,23 @@ static void PrintVersion(raw_ostream ) { } // Dump the configuration. -static int dumpConfig() { - StringRef FileName; +static int dumpConfig(bool IsSTDIN) { std::unique_ptr Code; - if (FileNames.empty()) { -// We can't read the code to detect

[clang] [clang-format][NFC] Clean up the driver and getStyle() in Format.cpp (PR #74794)

2024-01-22 Thread Ben Hamilton via cfe-commits
bhamiltoncx wrote: Seems like this regressed `clang-format - -dump_config < path/to/objc_file.m`. I filed https://github.com/llvm/llvm-project/issues/79023. https://github.com/llvm/llvm-project/pull/74794 ___ cfe-commits mailing list

[clang] 85670ac - [Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser

2023-05-30 Thread Ben Hamilton via cfe-commits
Author: Ben Hamilton Date: 2023-05-30T11:12:03-06:00 New Revision: 85670ac86813b170c9301aa477421c56a71a7e1e URL: https://github.com/llvm/llvm-project/commit/85670ac86813b170c9301aa477421c56a71a7e1e DIFF: https://github.com/llvm/llvm-project/commit/85670ac86813b170c9301aa477421c56a71a7e1e.diff

[clang] 00ea679 - [Format/ObjC] Support NS_ERROR_ENUM in ObjC language guesser

2023-04-07 Thread Ben Hamilton via cfe-commits
Author: Ben Hamilton Date: 2023-04-07T16:10:52-06:00 New Revision: 00ea6798959d358aff9d7ef0907bbe241be7f7a4 URL: https://github.com/llvm/llvm-project/commit/00ea6798959d358aff9d7ef0907bbe241be7f7a4 DIFF: https://github.com/llvm/llvm-project/commit/00ea6798959d358aff9d7ef0907bbe241be7f7a4.diff

[clang] 24b5266 - [Format/ObjC] Correctly handle base class with lightweight generics and protocol

2020-10-16 Thread Ben Hamilton via cfe-commits
Author: Ben Hamilton Date: 2020-10-16T15:12:25-06:00 New Revision: 24b5266892c30e2c9cb6ea28c2631e988a5754b6 URL: https://github.com/llvm/llvm-project/commit/24b5266892c30e2c9cb6ea28c2631e988a5754b6 DIFF: https://github.com/llvm/llvm-project/commit/24b5266892c30e2c9cb6ea28c2631e988a5754b6.diff

[clang] e7b4fee - [Format/ObjC] Add NS_SWIFT_NAME() and CF_SWIFT_NAME() to WhitespaceSensitiveMacros

2020-10-14 Thread Ben Hamilton via cfe-commits
Author: Ben Hamilton Date: 2020-10-14T15:42:51-06:00 New Revision: e7b4feea8e1bf520b34ad8c116abab6677344b74 URL: https://github.com/llvm/llvm-project/commit/e7b4feea8e1bf520b34ad8c116abab6677344b74 DIFF: https://github.com/llvm/llvm-project/commit/e7b4feea8e1bf520b34ad8c116abab6677344b74.diff

[clang-tools-extra] 0151ddc - Create a clang-tidy check to warn when -dealloc is implemented inside an ObjC class category.

2020-02-10 Thread Ben Hamilton via cfe-commits
Author: Michael Wyman Date: 2020-02-10T08:56:28-07:00 New Revision: 0151ddc2e834ab4949789cbed4e03a958284cd54 URL: https://github.com/llvm/llvm-project/commit/0151ddc2e834ab4949789cbed4e03a958284cd54 DIFF: https://github.com/llvm/llvm-project/commit/0151ddc2e834ab4949789cbed4e03a958284cd54.diff

r366719 - Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

2019-07-22 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Jul 22 11:20:01 2019 New Revision: 366719 URL: http://llvm.org/viewvc/llvm-project?rev=366719=rev Log: Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM. Summary: Addresses the formatting of NS_CLOSED_ENUM and

r366592 - [Format/ObjC] Avoid breaking between unary operators and operands

2019-07-19 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Jul 19 09:50:24 2019 New Revision: 366592 URL: http://llvm.org/viewvc/llvm-project?rev=366592=rev Log: [Format/ObjC] Avoid breaking between unary operators and operands Summary: Test Plan: New tests added. Ran tests with: % ninja FormatTests &&

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

2019-07-16 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Jul 16 14:29:40 2019 New Revision: 366267 URL: http://llvm.org/viewvc/llvm-project?rev=366267=rev Log: [clang-format] Don't detect call to ObjC class method as C++11 attribute specifier Summary: Previously, clang-format detected something like the following as a

r358904 - [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod`

2019-04-22 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Apr 22 10:54:11 2019 New Revision: 358904 URL: http://llvm.org/viewvc/llvm-project?rev=358904=rev Log: [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, `isClassMethod`, and `isInstanceMethod` Summary: isClassMessage is an equivalent to

r353531 - [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow

2019-02-08 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Feb 8 07:55:18 2019 New Revision: 353531 URL: http://llvm.org/viewvc/llvm-project?rev=353531=rev Log: [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow Summary: Currently, `UnwrappedLineParser` thinks an arrow token after an ObjC method expression is a

r352622 - [clang-format] Fix line parsing for noexcept lambdas

2019-01-30 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Jan 30 05:54:32 2019 New Revision: 352622 URL: http://llvm.org/viewvc/llvm-project?rev=352622=rev Log: [clang-format] Fix line parsing for noexcept lambdas Summary: > $ echo "int c = [b]() mutable noexcept { return [] { return b++; }(); }();" > |clang-format ```

r346144 - [Format] Add debugging to ObjC language guesser

2018-11-05 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Nov 5 08:59:33 2018 New Revision: 346144 URL: http://llvm.org/viewvc/llvm-project?rev=346144=rev Log: [Format] Add debugging to ObjC language guesser Summary: To handle diagnosing bugs where ObjCHeaderStyleGuesser guesses wrong, this diff adds a bit more debug

r344406 - [clang-format] Fix BraceWrapping AfterFunction for ObjC methods

2018-10-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Oct 12 12:43:01 2018 New Revision: 344406 URL: http://llvm.org/viewvc/llvm-project?rev=344406=rev Log: [clang-format] Fix BraceWrapping AfterFunction for ObjC methods Summary: > clang-format --version > clang-format version 7.0.0 (tags/RELEASE_700/final) > echo

[clang-tools-extra] r341721 - [clang-tidy/ObjC] Update list of acronyms in PropertyDeclarationCheck

2018-09-07 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Sep 7 15:03:48 2018 New Revision: 341721 URL: http://llvm.org/viewvc/llvm-project?rev=341721=rev Log: [clang-tidy/ObjC] Update list of acronyms in PropertyDeclarationCheck Summary: This adds a few common acronyms we found were missing from

[clang-tools-extra] r341720 - [clang-tidy/ObjC] Update list of acronyms in PropertyDeclarationCheck

2018-09-07 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Sep 7 15:02:38 2018 New Revision: 341720 URL: http://llvm.org/viewvc/llvm-project?rev=341720=rev Log: [clang-tidy/ObjC] Update list of acronyms in PropertyDeclarationCheck Summary: This adds a few common acronyms we found were missing from

[clang-tools-extra] r336919 - [clang-tidy/ObjC] Add SQL to list of acronyms

2018-07-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Jul 12 10:32:55 2018 New Revision: 336919 URL: http://llvm.org/viewvc/llvm-project?rev=336919=rev Log: [clang-tidy/ObjC] Add SQL to list of acronyms Summary: SQL is a common acronym. Reviewers: Wizard, hokein Reviewed By: Wizard, hokein Subscribers: cfe-commits

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

2018-06-29 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Jun 29 08:26:37 2018 New Revision: 335983 URL: http://llvm.org/viewvc/llvm-project?rev=335983=rev Log: [clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl Summary: In D44638, I partially fixed `NS_SWIFT_NAME(foo(bar:baz:))`-style annotations

[clang-tools-extra] r335770 - [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declaration

2018-06-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Jun 27 12:13:09 2018 New Revision: 335770 URL: http://llvm.org/viewvc/llvm-project?rev=335770=rev Log: [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declaration Summary: This PR adds a few acronyms related to hashing algorithms to the standard

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

2018-05-30 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed May 30 08:21:38 2018 New Revision: 333553 URL: http://llvm.org/viewvc/llvm-project?rev=333553=rev Log: [clang-format/ObjC] Correctly parse Objective-C methods with 'class' in name Summary: Please take a close look at this CL. I haven't touched much of

r332727 - [clang-format/ObjC] Correctly annotate single-component ObjC method invocations

2018-05-18 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri May 18 08:27:02 2018 New Revision: 332727 URL: http://llvm.org/viewvc/llvm-project?rev=332727=rev Log: [clang-format/ObjC] Correctly annotate single-component ObjC method invocations Summary: Previously, clang-format's parser would fail to annotate the selector in a

[clang-tools-extra] r332516 - [clang-tidy/google-readability-casting] Disable check for Objective-C++

2018-05-16 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed May 16 13:07:19 2018 New Revision: 332516 URL: http://llvm.org/viewvc/llvm-project?rev=332516=rev Log: [clang-tidy/google-readability-casting] Disable check for Objective-C++ Summary: Previously, `google-readability-casting` was disabled for Objective-C. The Google

[clang-tools-extra] r331267 - [clang-tidy] Add Apple prefix acronyms to objc-property-declaration

2018-05-01 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue May 1 07:48:51 2018 New Revision: 331267 URL: http://llvm.org/viewvc/llvm-project?rev=331267=rev Log: [clang-tidy] Add Apple prefix acronyms to objc-property-declaration Summary: This adds a few common Apple first-party API prefixes as acronyms to

[clang-tools-extra] r331268 - [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-05-01 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue May 1 07:48:54 2018 New Revision: 331268 URL: http://llvm.org/viewvc/llvm-project?rev=331268=rev Log: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs Summary: The `google-runtime-int` check currently fires on calls like:

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

2018-04-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Apr 27 11:51:12 2018 New Revision: 331067 URL: http://llvm.org/viewvc/llvm-project?rev=331067=rev Log: [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier Summary: Previously, we checked tokens for `tok::identifier` to see if they were identifiers

r329921 - [Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m

2018-04-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 12 09:00:05 2018 New Revision: 329921 URL: http://llvm.org/viewvc/llvm-project?rev=329921=rev Log: [Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m I broke this test in D45498 when I changed the formatter to remove spaces before Objective-C

r329918 - [clang-format] Improve ObjC guessing heuristic by supporting all @keywords

2018-04-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 12 08:11:53 2018 New Revision: 329918 URL: http://llvm.org/viewvc/llvm-project?rev=329918=rev Log: [clang-format] Improve ObjC guessing heuristic by supporting all @keywords Summary: This diff improves the Objective-C guessing heuristic by replacing the

r329919 - [clang-format] Do not break after ObjC category open paren

2018-04-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 12 08:11:55 2018 New Revision: 329919 URL: http://llvm.org/viewvc/llvm-project?rev=329919=rev Log: [clang-format] Do not break after ObjC category open paren Summary: Previously, `clang-format` would break Objective-C category extensions after the opening

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

2018-04-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 12 08:11:51 2018 New Revision: 329917 URL: http://llvm.org/viewvc/llvm-project?rev=329917=rev Log: [clang-format] Don't insert space between ObjC class and lightweight generic Summary: In D45185, I added clang-format parser support for Objective-C generics.

r329916 - [clang-format] Always indent wrapped Objective-C selector names

2018-04-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 12 08:11:48 2018 New Revision: 329916 URL: http://llvm.org/viewvc/llvm-project?rev=329916=rev Log: [clang-format] Always indent wrapped Objective-C selector names Summary: Currently, indentation of Objective-C method names which are wrapped onto the next line

Re: [PATCH] D45526: [clang-format] Prefer breaking after ObjC category close paren

2018-04-12 Thread Ben Hamilton via cfe-commits
True. I will reword the description to clarify. On Thu, Apr 12, 2018, 07:58 Daniel Jasper via Phabricator < revi...@reviews.llvm.org> wrote: > djasper added a comment. > > I understand that, but the test example does not break after the closing > paren. It breaks after the subsequent "<". > > >

Re: [PATCH] D45526: [clang-format] Prefer breaking after ObjC category close paren

2018-04-12 Thread Ben Hamilton via cfe-commits
Fair point. I'll update the diff description. The net effect of the patch is to break after the closing paren; the way I implemented that was to raise the penalty for breaking after the opening paren. On Thu, Apr 12, 2018, 06:37 Daniel Jasper via Phabricator < revi...@reviews.llvm.org> wrote: >

r329298 - [clang-format] Support lightweight Objective-C generics

2018-04-05 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 5 08:26:25 2018 New Revision: 329298 URL: http://llvm.org/viewvc/llvm-project?rev=329298=rev Log: [clang-format] Support lightweight Objective-C generics Summary: Previously, `clang-format` didn't understand lightweight Objective-C generics, which have the

r329297 - [clang-format] Ensure ObjC selectors with 0 args are annotated correctly

2018-04-05 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Apr 5 08:26:23 2018 New Revision: 329297 URL: http://llvm.org/viewvc/llvm-project?rev=329297=rev Log: [clang-format] Ensure ObjC selectors with 0 args are annotated correctly Summary: Previously, clang-format would incorrectly annotate 0-argument Objective-C

r329070 - [clang-format/ObjC] Do not detect "[]" as ObjC method expression

2018-04-03 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Apr 3 07:07:11 2018 New Revision: 329070 URL: http://llvm.org/viewvc/llvm-project?rev=329070=rev Log: [clang-format/ObjC] Do not detect "[]" as ObjC method expression Summary: The following C++ code was being detected by `guessLanguage()` as Objective-C: #define

r329069 - [clang-format/ObjC] Do not insert space after opening brace of ObjC dict literal

2018-04-03 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Apr 3 07:07:09 2018 New Revision: 329069 URL: http://llvm.org/viewvc/llvm-project?rev=329069=rev Log: [clang-format/ObjC] Do not insert space after opening brace of ObjC dict literal Summary: D44816 attempted to fix a few cases where `clang-format` incorrectly

r328871 - [clang-format] Ensure wrapped ObjC selectors with 1 arg obey IndentWrappedFunctionNames

2018-03-30 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Mar 30 08:38:45 2018 New Revision: 328871 URL: http://llvm.org/viewvc/llvm-project?rev=328871=rev Log: [clang-format] Ensure wrapped ObjC selectors with 1 arg obey IndentWrappedFunctionNames Summary: In D43121, @Typz introduced logic to avoid indenting 2-or-more

r328627 - [clang-format] Do not insert space before closing brace in ObjC dict literal

2018-03-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Mar 27 08:01:17 2018 New Revision: 328627 URL: http://llvm.org/viewvc/llvm-project?rev=328627=rev Log: [clang-format] Do not insert space before closing brace in ObjC dict literal Summary: Previously, `clang-format` would sometimes insert a space before the closing

r328628 - [clang-format] Refine ObjC guesser to handle child lines of child lines

2018-03-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Mar 27 08:01:21 2018 New Revision: 328628 URL: http://llvm.org/viewvc/llvm-project?rev=328628=rev Log: [clang-format] Refine ObjC guesser to handle child lines of child lines Summary: This fixes an issue brought up by djasper@ in his review of D44790. We handled

r328220 - [clang-format] Fix ObjC style guesser to also iterate over child lines

2018-03-22 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Mar 22 10:37:19 2018 New Revision: 328220 URL: http://llvm.org/viewvc/llvm-project?rev=328220=rev Log: [clang-format] Fix ObjC style guesser to also iterate over child lines Summary: When I wrote `ObjCHeaderStyleGuesser`, I incorrectly assumed the correct way to

r328175 - [clang-format] Add a few more Core Graphics identifiers to ObjC heuristic

2018-03-21 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Mar 21 20:25:22 2018 New Revision: 328175 URL: http://llvm.org/viewvc/llvm-project?rev=328175=rev Log: [clang-format] Add a few more Core Graphics identifiers to ObjC heuristic Summary: We received reports of the Objective-C style guesser getting a false negative on

r328174 - [clang-format] Don't insert space between r_paren and 'new' in ObjC decl

2018-03-21 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Mar 21 20:23:53 2018 New Revision: 328174 URL: http://llvm.org/viewvc/llvm-project?rev=328174=rev Log: [clang-format] Don't insert space between r_paren and 'new' in ObjC decl Summary: Previously, clang-format would insert a space between the closing parenthesis and

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

2018-03-21 Thread Ben Hamilton via cfe-commits
#import is perfectly legal in C and C++, it's just not commonly used. On Wed, Mar 21, 2018, 14:27 Yan Zhang via Phabricator < revi...@reviews.llvm.org> wrote: > Wizard added a comment. > > Why do we only detect system framework? I think any #import could indicate > ObjC header. > > > Repository:

r327986 - [clang-format] Fix ObjC selectors with multiple params passed to macro

2018-03-20 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Mar 20 07:53:25 2018 New Revision: 327986 URL: http://llvm.org/viewvc/llvm-project?rev=327986=rev Log: [clang-format] Fix ObjC selectors with multiple params passed to macro Summary: Objective-C selectors with arguments take the form of: foo: foo:bar: foo:bar:baz:

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

2018-03-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Mar 12 08:42:38 2018 New Revision: 327284 URL: http://llvm.org/viewvc/llvm-project?rev=327284=rev Log: [clang-format] Don't detect C++11 attribute specifiers as ObjC Summary: Previously, clang-format would detect C++11 and C++17 attribute specifiers like the

r327285 - [clang-format] Improve detection of Objective-C block types

2018-03-12 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Mar 12 08:42:40 2018 New Revision: 327285 URL: http://llvm.org/viewvc/llvm-project?rev=327285=rev Log: [clang-format] Improve detection of Objective-C block types Summary: Previously, clang-format would detect the following as an Objective-C block type: FOO(^);

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

2018-03-07 Thread Ben Hamilton via cfe-commits
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. On Wed, Mar 7, 2018, 03:42 Krasimir Georgiev via Phabricator < revi...@reviews.llvm.org> wrote: > krasimir added inline comments. > > >

r326815 - [clang-format] Improve detection of ObjC for-in statements

2018-03-06 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Mar 6 09:21:42 2018 New Revision: 326815 URL: http://llvm.org/viewvc/llvm-project?rev=326815=rev Log: [clang-format] Improve detection of ObjC for-in statements Summary: Previously, clang-format would detect the following as an Objective-C for-in statement: for

r326205 - [clang-format] Tidy up new API guessLanguage()

2018-02-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Feb 27 07:56:40 2018 New Revision: 326205 URL: http://llvm.org/viewvc/llvm-project?rev=326205=rev Log: [clang-format] Tidy up new API guessLanguage() Summary: This fixes a few issues djasper@ brought up in his review of D43522. Test Plan: make -j12 FormatTests &&

Re: r325691 - [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via cfe-commits
scei-ps4-ubuntu-fast/llvm.obj/tools/clang/tools/extra/test/clang-apply-replacements/Output/format.cpp.script: >> line 8: 49680 Aborted (core dumped) >> clang-apply-replacements -format >> /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast

r325722 - [clang-format] Fix regression when getStyle() called with empty filename

2018-02-21 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Feb 21 13:27:27 2018 New Revision: 325722 URL: http://llvm.org/viewvc/llvm-project?rev=325722=rev Log: [clang-format] Fix regression when getStyle() called with empty filename Summary: D43522 caused an assertion failure when getStyle() was called with an empty

Re: r325691 - [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via cfe-commits
/test/clang-apply-replacements/Output/format.cpp.script: > line 8: 49680 Aborted (core dumped) > clang-apply-replacements -format > /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/tools/clang/tools/extra/test/clang-apply-replacemen

r325691 - [clang-format] New API guessLanguage()

2018-02-21 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Feb 21 07:54:31 2018 New Revision: 325691 URL: http://llvm.org/viewvc/llvm-project?rev=325691=rev Log: [clang-format] New API guessLanguage() Summary: For clients which don't have a filesystem, calling getStyle() doesn't make much sense (there's no .clang-format

r324618 - [clang-format] Do not break Objective-C string literals inside array literals

2018-02-08 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Feb 8 08:07:25 2018 New Revision: 324618 URL: http://llvm.org/viewvc/llvm-project?rev=324618=rev Log: [clang-format] Do not break Objective-C string literals inside array literals Summary: Concatenating Objective-C string literals inside an array literal raises the

r324553 - [clang-format] Set ObjCBinPackProtocolList to Never for google style

2018-02-07 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Feb 7 17:49:10 2018 New Revision: 324553 URL: http://llvm.org/viewvc/llvm-project?rev=324553=rev Log: [clang-format] Set ObjCBinPackProtocolList to Never for google style Summary: This is split off from D42650, and sets ObjCBinPackProtocolList to Never for the

r324364 - [clang-format] Add more tests for Objective-C 2.0 generic alignment

2018-02-06 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Tue Feb 6 10:01:47 2018 New Revision: 324364 URL: http://llvm.org/viewvc/llvm-project?rev=324364=rev Log: [clang-format] Add more tests for Objective-C 2.0 generic alignment Summary: In r236412, @djasper added a comment: // FIXME: We likely want to do this for

r324131 - [clang-format] New format param ObjCBinPackProtocolList

2018-02-02 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Feb 2 12:15:14 2018 New Revision: 324131 URL: http://llvm.org/viewvc/llvm-project?rev=324131=rev Log: [clang-format] New format param ObjCBinPackProtocolList Summary: This is an alternative approach to D42014 after some investigation by stephanemoore@ and myself.

[clang-tools-extra] r324097 - [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value-param

2018-02-02 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Feb 2 07:34:33 2018 New Revision: 324097 URL: http://llvm.org/viewvc/llvm-project?rev=324097=rev Log: [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value-param Summary: The following Objective-C code currently incorrectly triggers

[clang-tools-extra] r323919 - [clang-tidy] New argument --language to add_new_check.py

2018-01-31 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Jan 31 13:52:39 2018 New Revision: 323919 URL: http://llvm.org/viewvc/llvm-project?rev=323919=rev Log: [clang-tidy] New argument --language to add_new_check.py Summary: Currently, add_new_check.py assumes all checks are for C++ code. This adds a new argument

r323684 - [clang-format] Add more tests for ObjC protocol list formatting behavior

2018-01-29 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Jan 29 12:01:49 2018 New Revision: 323684 URL: http://llvm.org/viewvc/llvm-project?rev=323684=rev Log: [clang-format] Add more tests for ObjC protocol list formatting behavior Summary: The existing unit tests in FormatTestObjC.cpp didn't fully cover all the cases

r323668 - [clang-format] Fix bug where -dump-config failed on ObjC header

2018-01-29 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Jan 29 09:36:43 2018 New Revision: 323668 URL: http://llvm.org/viewvc/llvm-project?rev=323668=rev Log: [clang-format] Fix bug where -dump-config failed on ObjC header Summary: `clang-format -dump-config path/to/file.h` never passed anything for the Code parameter to

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

2018-01-26 Thread Ben Hamilton via cfe-commits
It's needed because otherwise lit ignores the .h file, which is the configuration specified in the lit config in the parent directory. On Fri, Jan 26, 2018, 01:55 Krasimir Georgiev via Phabricator < revi...@reviews.llvm.org> wrote: > krasimir requested changes to this revision. > krasimir added

Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Ben Hamilton via cfe-commits
Yes, that's currently a submit time feature built in to Phabricator which i believe we'll have to fix upstream. Because both the top level LLVM SVN report and the sub repos see the same files, Phabricator automatically subscribes both lists to the commits. I wasn't able to find an easy way to

Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Ben Hamilton via cfe-commits
Ah, I see from http://bcain-llvm.readthedocs.io/projects/libunwind/en/latest/ that libunwind review discussion does take place on cfe-commits. Added. Sorry about not doing that earlier! Ben On Thu, Jan 25, 2018 at 8:37 AM Ben Hamilton wrote: > Great question. Is there

Re: Please subscribe "rUNW libunwind" to cfe-commits.

2018-01-25 Thread Ben Hamilton via cfe-commits
Great question. Is there an existing separate list for libunwind? If libunwind discussion already happens on cfe-commits, then I'll make reviews for libunwind subscribe that list. On Tue, Jan 23, 2018, 21:40 Don Hinton wrote: > Currently, herald doesn't subscribe libunwind

[clang-tools-extra] r323130 - [clang-tidy objc-property-declaration] New option IncludeDefaultAcronyms

2018-01-22 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Jan 22 07:45:25 2018 New Revision: 323130 URL: http://llvm.org/viewvc/llvm-project?rev=323130=rev Log: [clang-tidy objc-property-declaration] New option IncludeDefaultAcronyms Summary: The existing option objc-property-declaration.Acronyms replaces the built-in set

[clang-tools-extra] r322886 - [clang-tidy objc-property-declaration] Expand list of ObjC acronyms

2018-01-18 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Jan 18 12:51:24 2018 New Revision: 322886 URL: http://llvm.org/viewvc/llvm-project?rev=322886=rev Log: [clang-tidy objc-property-declaration] Expand list of ObjC acronyms Summary: We were missing some pretty common acronyms in the camelCase property name check

r322873 - [ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style

2018-01-18 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Jan 18 10:37:16 2018 New Revision: 322873 URL: http://llvm.org/viewvc/llvm-project?rev=322873=rev Log: [ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style Summary: The Google style guide is neutral on whether there should be a space before

r322690 - [Format] Improve ObjC header guessing heuristic

2018-01-17 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Wed Jan 17 09:33:08 2018 New Revision: 322690 URL: http://llvm.org/viewvc/llvm-project?rev=322690=rev Log: [Format] Improve ObjC header guessing heuristic Summary: This improves upon the previous Objective-C header guessing heuristic from rC320479. Now, we run the

[clang-tools-extra] r321914 - [clang-tidy] Function-scoped static variables should not trigger google-objc-global-variable-declaration

2018-01-05 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Fri Jan 5 15:26:06 2018 New Revision: 321914 URL: http://llvm.org/viewvc/llvm-project?rev=321914=rev Log: [clang-tidy] Function-scoped static variables should not trigger google-objc-global-variable-declaration Summary: google-objc-global-variable-declaration

r320747 - Revert "[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style"

2017-12-14 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Dec 14 13:44:11 2017 New Revision: 320747 URL: http://llvm.org/viewvc/llvm-project?rev=320747=rev Log: Revert "[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style" This reverts commit 37e69667f748e1458b46483b7c1b8f9ba33eec44. We're

r320714 - [ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style

2017-12-14 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Dec 14 08:17:38 2017 New Revision: 320714 URL: http://llvm.org/viewvc/llvm-project?rev=320714=rev Log: [ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style Summary: If we write the following code, it goes over 100 columns, so we need to

[libcxx] r319666 - [libcxx] Set up .arcconfig to point to new Diffusion CXX repository

2017-12-04 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Dec 4 09:55:28 2017 New Revision: 319666 URL: http://llvm.org/viewvc/llvm-project?rev=319666=rev Log: [libcxx] Set up .arcconfig to point to new Diffusion CXX repository Summary: We want to automatically copy the appropriate mailing list for review requests to the

r319052 - [clang] Set up .arcconfig to point to new Diffusion C repository

2017-11-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Nov 27 09:21:24 2017 New Revision: 319052 URL: http://llvm.org/viewvc/llvm-project?rev=319052=rev Log: [clang] Set up .arcconfig to point to new Diffusion C repository Summary: We want to automatically copy cfe-commits@ on review requests to the clang repository.

[clang-tools-extra] r319039 - [clang-tools-extra] Set up .arcconfig to point to new Diffusion CTE repository

2017-11-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Nov 27 07:58:25 2017 New Revision: 319039 URL: http://llvm.org/viewvc/llvm-project?rev=319039=rev Log: [clang-tools-extra] Set up .arcconfig to point to new Diffusion CTE repository Summary: I'm testing out a new Diffusion repository `CTE`:

[clang-tools-extra] r319040 - [clang-tools-extra] Fix small typo in docs/ReleaseNotes.rst

2017-11-27 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Nov 27 07:58:26 2017 New Revision: 319040 URL: http://llvm.org/viewvc/llvm-project?rev=319040=rev Log: [clang-tools-extra] Fix small typo in docs/ReleaseNotes.rst Summary: This is mainly a test diff to check the new Herald rule I added in LLVM Phabricator to

r318445 - [VirtualFileSystem] Support creating directories then adding files inside

2017-11-16 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Nov 16 11:34:08 2017 New Revision: 318445 URL: http://llvm.org/viewvc/llvm-project?rev=318445=rev Log: [VirtualFileSystem] Support creating directories then adding files inside Summary: In https://reviews.llvm.org/D39572 , I added support for specifying `Type` when

[clang-tools-extra] r318117 - add new check for property declaration

2017-11-13 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Mon Nov 13 15:54:31 2017 New Revision: 318117 URL: http://llvm.org/viewvc/llvm-project?rev=318117=rev Log: add new check for property declaration Summary: This check finds property declarations in Objective-C files that do not follow the pattern of property names in

r317800 - [VirtualFileSystem] InMemoryFileSystem::addFile(): Type and Perms

2017-11-09 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Nov 9 08:01:16 2017 New Revision: 317800 URL: http://llvm.org/viewvc/llvm-project?rev=317800=rev Log: [VirtualFileSystem] InMemoryFileSystem::addFile(): Type and Perms Summary: This implements a FIXME in InMemoryFileSystem::addFile(), allowing clients to specify

[clang-tools-extra] r317261 - Update release notes (check SVN commit-after-approval access)

2017-11-02 Thread Ben Hamilton via cfe-commits
Author: benhamilton Date: Thu Nov 2 13:00:17 2017 New Revision: 317261 URL: http://llvm.org/viewvc/llvm-project?rev=317261=rev Log: Update release notes (check SVN commit-after-approval access) Summary: I was just granted commit-after-approval access to SVN, and @clattner recommended I try a