[clang] [clang-format][NFC] Enable RemoveSemicolon for clang-format style (PR #82735)

2024-02-22 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/82735 Also insert separators for decimal integers longer than 4 digits. >From e0a9d61283276bddda8231b599697cf4d497ff0a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 22 Feb 2024 20:56:47 -0800 Subject: [PATCH] [cla

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-22 Thread Owen Pan via cfe-commits
owenca wrote: > > If we add a `bool GuessObjC` parameter to `guessLanguage()`, would that > > solve the problem? > > I assume you mean making it so that when clangd calls into `guessLanguage()`, > the ObjC guessing algorithm is skipped entirely. I'm not familiar with clangd use cases, but I t

[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

2024-02-23 Thread Owen Pan via cfe-commits
@@ -420,6 +420,8 @@ struct UnwrappedLineNode { SmallVector Children; }; +std::ostream &operator<<(std::ostream &Stream, const UnwrappedLine &Line); + owenca wrote: Delete. https://github.com/llvm/llvm-project/pull/82523

[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

2024-02-23 Thread Owen Pan via cfe-commits
@@ -19,6 +19,7 @@ #include "clang/Basic/TokenKinds.h" #include "llvm/ADT/DenseSet.h" #include "llvm/Support/Debug.h" +#include owenca wrote: Not needed explicitly. https://github.com/llvm/llvm-project/pull/82523 __

[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

2024-02-23 Thread Owen Pan via cfe-commits
@@ -287,6 +287,21 @@ TEST_F(FormatTestMacroExpansion, Style); } +TEST_F(FormatTestMacroExpansion, IndentChildrenWithinMacroCall) { + FormatStyle Style = getGoogleStyleWithColumns(22); + Style.Macros.push_back("MACRO(a, b)=a=(b)"); + verifyFormat("void f() {\n

[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

2024-02-23 Thread Owen Pan via cfe-commits
@@ -90,6 +90,12 @@ class ScopedDeclarationState { } // end anonymous namespace +std::ostream &operator<<(std::ostream &Stream, const UnwrappedLine &Line) { + llvm::raw_os_ostream OS(Stream); + printLine(OS, Line); + return Stream; +} + owenca wrote: Delet

[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

2024-02-23 Thread Owen Pan via cfe-commits
@@ -420,6 +420,8 @@ struct UnwrappedLineNode { SmallVector Children; }; +std::ostream &operator<<(std::ostream &Stream, const UnwrappedLine &Line); + owenca wrote: Ah, thanks for the explanation. https://github.com/llvm/llvm-project/pull/82523

[clang] [clang-format][NFC] Enable RemoveSemicolon for clang-format style (PR #82735)

2024-02-23 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/82735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add a parameter to getStyle() and guessLanguage() (PR #82911)

2024-02-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/82911 Add a boolean parameter GuessObjC that defaults to true. This allows e.g. clangd to bypass ObjCHeaderStyleGuesser.process() by passing false for the parameter. >From bd85fd1dff5ac7b72913ed175daec3809896e6c0 Mon Se

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-25 Thread Owen Pan via cfe-commits
owenca wrote: @HighCommander4 see #82911 https://github.com/llvm/llvm-project/pull/78925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 085f9b0 - [clang-format][doc] Update documentation for RemoveSemicolon

2024-02-25 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-25T16:08:37-08:00 New Revision: 085f9b0d146fc99bbb0e193593aad696fc50a056 URL: https://github.com/llvm/llvm-project/commit/085f9b0d146fc99bbb0e193593aad696fc50a056 DIFF: https://github.com/llvm/llvm-project/commit/085f9b0d146fc99bbb0e193593aad696fc50a056.diff LOG:

[clang] [clang-format][NFC] Skip ObjCHeaderStyleGuesser for empty code (PR #82957)

2024-02-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/82957 None >From 9334d008b4c7ae13fdeb674a6bb9b4dc62c6a1dd Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 25 Feb 2024 20:58:25 -0800 Subject: [PATCH] [clang-format][NFC] Skip ObjCHeaderStyleGuesser for empty code

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-25 Thread Owen Pan via cfe-commits
owenca wrote: @HighCommander4 I got a better idea. It seems that we don't need to add the parameter! See #82957. I think all you need to do is to call `getStyle()` with the default `""` for the `StringRef Code` argument to skip the Objective-C guesser. https://github.com/llvm/llvm-project/pul

[clang] [clang-format] Add a parameter to getStyle() and guessLanguage() (PR #82911)

2024-02-25 Thread Owen Pan via cfe-commits
https://github.com/owenca converted_to_draft https://github.com/llvm/llvm-project/pull/82911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add a parameter to getStyle() and guessLanguage() (PR #82911)

2024-02-25 Thread Owen Pan via cfe-commits
owenca wrote: I will abandon this pull request if #82957 gets approved. https://github.com/llvm/llvm-project/pull/82911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Skip ObjCHeaderStyleGuesser for empty code (PR #82957)

2024-02-26 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/82957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add a parameter to getStyle() and guessLanguage() (PR #82911)

2024-02-26 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/82911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-26 Thread Owen Pan via cfe-commits
owenca wrote: > > @HighCommander4 I got a better idea. It seems that we don't need to add the > > parameter! See #82957. I think all you need to do is to call `getStyle()` > > with the default `""` for the `StringRef Code` argument to skip the > > Objective-C guesser. > > Thanks. That does se

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16671,9 +16667,8 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { SpaceFuncDecl); verifyFormat("int f () throw(Deprecated);", SpaceFuncDecl); verifyFormat("typedef void (*cb)(int);", SpaceFuncDecl); - // FIXME these tests regressed behaviour. - //

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16797,7 +16792,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int f() throw (Deprecated);", SomeSpace2); verifyFormat("typedef void (*cb) (int);", SomeSpace2); verifyFormat("T A::operator()();", SomeSpace2); - // verifyFormat("X A::operator++

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16710,7 +16705,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("typedef void (*cb)(int);", SpaceFuncDef); verifyFormat("T A::operator()();", SpaceFuncDef); verifyFormat("X A::operator++(T);", SpaceFuncDef); - // verifyFormat("T A::operator() ()

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16797,7 +16792,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int f() throw (Deprecated);", SomeSpace2); verifyFormat("typedef void (*cb) (int);", SomeSpace2); verifyFormat("T A::operator()();", SomeSpace2); - // verifyFormat("X A::operator++

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16671,9 +16667,8 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { SpaceFuncDecl); verifyFormat("int f () throw(Deprecated);", SpaceFuncDecl); verifyFormat("typedef void (*cb)(int);", SpaceFuncDecl); - // FIXME these tests regressed behaviour. - //

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/83380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
@@ -16710,7 +16705,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("typedef void (*cb)(int);", SpaceFuncDef); verifyFormat("T A::operator()();", SpaceFuncDef); verifyFormat("X A::operator++(T);", SpaceFuncDef); - // verifyFormat("T A::operator() ()

[clang] [clang-format] Enable again some operator tests (PR #83380)

2024-02-29 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/83380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Replace Style.isCpp() with IsCpp (PR #83533)

2024-02-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/83533 None >From a643963e818a9c6c4abea93c15f8c48f7291a837 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 29 Feb 2024 23:07:58 -0800 Subject: [PATCH] [clang-format][NFC] Replace Style.isCpp() with IsCpp --- clang/

[clang] [clang][Documentation] fix documentation for clang-format (PR #83415)

2024-02-29 Thread Owen Pan via cfe-commits
owenca wrote: Hi, you need to edit `clang/include/clang/Format/Format.h` and then run `clang/docs/tools/dump_format_style.py` to regenerate `clang/docs/ClangFormatStyleOptions.rst`. https://github.com/llvm/llvm-project/pull/83415 ___ cfe-commits mail

[clang] [clang-format][doc] fix documentation for clang-format (PR #83415)

2024-02-29 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/83415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Replace Style.isCpp() with IsCpp (PR #83533)

2024-03-01 Thread Owen Pan via cfe-commits
owenca wrote: > The question is: why? And why handle c++ different than all other languages? This is the preparation for fixing/extending `FormatToken::isSimpleTypeSpecifier()`, which I'll add a couple of parameters to, e.g. `isSimpleTypeSpecifier(bool IsCpp, const LangOptions &LangOpts)`. Al

[clang] [clang-format][NFC] Replace Style.isCpp() with IsCpp (PR #83533)

2024-03-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/83533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/83709 Fixes #83400. >From 91d6e4c6e0ae2e1d79edf496df22978a4e1f3e1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 2 Mar 2024 22:08:29 -0800 Subject: [PATCH] [clang-format] Handle common C++ non-keyword types as suc

[clang] [clang-format][doc] fix documentation for clang-format (PR #83415)

2024-03-02 Thread Owen Pan via cfe-commits
owenca wrote: > So I did added a simple search and replace to the generating script so now > every time [[[NAME]]] is reference it will use the members name. Nice! Though why `[[[NAME]]]` in particular? Can we use `` instead? https://github.com/llvm/llvm-project/pull/83415

[clang] [clang-format][doc] fix documentation for clang-format (PR #83415)

2024-03-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/83415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/83709 >From 91d6e4c6e0ae2e1d79edf496df22978a4e1f3e1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 2 Mar 2024 22:08:29 -0800 Subject: [PATCH 1/2] [clang-format] Handle common C++ non-keyword types as such Fixes #

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -66,13 +72,17 @@ bool FormatToken::isSimpleTypeSpecifier() const { case tok::kw_decltype: case tok::kw__Atomic: return true; + case tok::identifier: +return IsCpp && std::binary_search(CppNonKeywordTypes.begin(), + CppNonKey

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/83709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
owenca wrote: > Another possibility to consider for the original bug: `(single_identifier)` > is almost certainly a cast, not redundant parentheses, unless > `single_identifier` names a macro argument. So I wonder if that would be a > better heuristic to use to fix the regression. I don’t thi

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
owenca wrote: > > > Another possibility to consider for the original bug: > > > `(single_identifier)` is almost certainly a cast, not redundant > > > parentheses, unless `single_identifier` names a macro argument. So I > > > wonder if that would be a better heuristic to use to fix the regressi

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", owenca wrote: Good point abo

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
owenca wrote: > > This patch does not only fix formatting of C-casting to a C++ standard > > type. It correctly identifies (most of) such types and might have fixed > > other kinds of bugs. > > Sure, this patch seems like a good change. But it does not fix #83400. It does fix the example give

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
owenca wrote: > But looking for a parenthesized single identifier addresses all of the > examples in the issue. I don't think it would work, but you are welcome to submit a patch to prove me wrong. 🙂 https://github.com/llvm/llvm-project/pull/83709

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/83709 >From 91d6e4c6e0ae2e1d79edf496df22978a4e1f3e1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 2 Mar 2024 22:08:29 -0800 Subject: [PATCH 1/3] [clang-format] Handle common C++ non-keyword types as such Fixes #

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/83709 >From 91d6e4c6e0ae2e1d79edf496df22978a4e1f3e1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 2 Mar 2024 22:08:29 -0800 Subject: [PATCH 1/4] [clang-format] Handle common C++ non-keyword types as such Fixes #

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/83709 >From 91d6e4c6e0ae2e1d79edf496df22978a4e1f3e1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 2 Mar 2024 22:08:29 -0800 Subject: [PATCH 1/5] [clang-format] Handle common C++ non-keyword types as such Fixes #

[clang] [clang-forma] Support `PointerAlignment: Left` for pointer to member (PR #86253)

2024-03-22 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/86253 Fixes #85761. >From d1a3b743b808a64f022897dfd832ce9a25c8f2c0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 21 Mar 2024 23:43:23 -0700 Subject: [PATCH] [clang-forma] Support `PointerAlignment: Left` for point

[clang] [clang-forma] Support `PointerAlignment: Left` for pointer to member (PR #86253)

2024-03-22 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/86253 >From d1a3b743b808a64f022897dfd832ce9a25c8f2c0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 21 Mar 2024 23:43:23 -0700 Subject: [PATCH 1/2] [clang-forma] Support `PointerAlignment: Left` for pointer to memb

[clang] [clang-forma] Support `PointerAlignment` for pointers to members (PR #86253)

2024-03-23 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/86253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-forma] Support `PointerAlignment` for pointers to members (PR #86253)

2024-03-23 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/86253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 47423e9 - [clang-format][NFC] Clean up IsQualifiedPointerOrReference in TokenAnnotator

2024-03-23 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-23T02:24:56-07:00 New Revision: 47423e9827abfdcc6b10ce41618965861b0e69a4 URL: https://github.com/llvm/llvm-project/commit/47423e9827abfdcc6b10ce41618965861b0e69a4 DIFF: https://github.com/llvm/llvm-project/commit/47423e9827abfdcc6b10ce41618965861b0e69a4.diff LOG:

[clang] [clang-format] Fix a crash with AlignArrayOfStructures option (PR #86420)

2024-03-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/86420 Fixes #86109. >From 682323acb1007308f55bf023e4d1657f268b55d1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 23 Mar 2024 22:23:46 -0700 Subject: [PATCH] [clang-format] Fix a crash with AlignArrayOfStructures o

[clang] [clang-format] Fix a crash with AlignArrayOfStructures option (PR #86420)

2024-03-23 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/86420 >From 2c131e544578072e349ba853543cc60816421a5e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 23 Mar 2024 22:23:46 -0700 Subject: [PATCH] [clang-format] Fix a crash with AlignArrayOfStructures option Fixes #8

[clang] [clang-format] Fix a crash with AlignArrayOfStructures option (PR #86420)

2024-03-24 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/86420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle C++ Core Guidelines suppression tags (PR #86458)

2024-03-24 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/86458 Fixes #86451. >From 4149b046f97a4416041e2cd3fe5f134abed2f5d9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 24 Mar 2024 16:06:14 -0700 Subject: [PATCH] [clang-format] Handle C++ Core Guidelines suppression ta

[clang] [clang-format] Handle C++ Core Guidelines suppression tags (PR #86458)

2024-03-25 Thread Owen Pan via cfe-commits
@@ -4827,6 +4827,10 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, Right.is(TT_TemplateOpener)) { return true; } +if (Left.is(tok::identifier) && Right.is(tok::numeric_constant) && +Right.TokenText[0] == '.') {

[clang] [clang-format] Fix a regression in annotating TrailingReturnArrow (PR #86624)

2024-03-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/86624 Fixes #86559. >From 5ba6a0adcf9de7035dd195f0b83ada39019b7e12 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 25 Mar 2024 21:13:04 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating TrailingR

[clang] [clang-format] Handle C++ Core Guidelines suppression tags (PR #86458)

2024-03-26 Thread Owen Pan via cfe-commits
@@ -4827,6 +4827,10 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, Right.is(TT_TemplateOpener)) { return true; } +if (Left.is(tok::identifier) && Right.is(tok::numeric_constant) && +Right.TokenText[0] == '.') {

[clang] [clang-format] Exit clang-format-diff only after all diffs are printed (PR #86776)

2024-03-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/86776 None >From 216681ceb6346b56e8013935b2d3938bde5039ea Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 26 Mar 2024 23:27:51 -0700 Subject: [PATCH] [clang-format] Exit clang-format-diff only after all diffs are p

[clang] [clang-format] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2024-03-26 Thread Owen Pan via cfe-commits
owenca wrote: See #86776. https://github.com/llvm/llvm-project/pull/70883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Exit clang-format-diff only after all diffs are printed (PR #86776)

2024-03-26 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/86776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle C++ Core Guidelines suppression tags (PR #86458)

2024-03-27 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/86458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Exit clang-format-diff only after all diffs are printed (PR #86776)

2024-03-27 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/86776 ___ 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 annotating TrailingReturnArrow (PR #86624)

2024-03-27 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/86624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Lambda parameter should be passed by const reference (PR #87306)

2024-04-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/87306 Closes #87254. >From 91edc2bff0ea98e39b5614ae91ab562c1135b6e7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 1 Apr 2024 20:08:21 -0700 Subject: [PATCH] [clang-format] Lambda parameter should be passed by cons

[clang] [clang-format] Fix a regression in annotating TrailingReturnArrow (PR #86624)

2024-04-01 Thread Owen Pan via cfe-commits
owenca wrote: Ping @mydeveloperday @HazardyKnusperkeks @rymiel https://github.com/llvm/llvm-project/pull/86624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-04-01 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/82097 ___ 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 annotating BK_BracedInit (PR #87450)

2024-04-04 Thread Owen Pan via cfe-commits
https://github.com/owenca dismissed https://github.com/llvm/llvm-project/pull/87450 ___ 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 annotating BK_BracedInit (PR #87450)

2024-04-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/87450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-04-04 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 8de230093f58 https://github.com/llvm/llvm-project/pull/82097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7702023 - [clang-format][NFC] Rename `kind` to `Kind`

2024-04-05 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-04-05T22:17:50-07:00 New Revision: 770202343ebce1f2bc0745c78e298e251f204bee URL: https://github.com/llvm/llvm-project/commit/770202343ebce1f2bc0745c78e298e251f204bee DIFF: https://github.com/llvm/llvm-project/commit/770202343ebce1f2bc0745c78e298e251f204bee.diff LOG:

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/87868 None >From 5c614fec2b54c146841a9ef3089dee1a63f72543 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 5 Apr 2024 22:45:47 -0700 Subject: [PATCH] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-06 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/87868 >From 5c614fec2b54c146841a9ef3089dee1a63f72543 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 5 Apr 2024 22:45:47 -0700 Subject: [PATCH 1/2] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource -

[clang] 684f27d - [clang-format][NFC] Use `is` instead of `getType() ==`

2024-04-06 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-04-06T01:51:45-07:00 New Revision: 684f27d37a6f1faf546a71bcb784b48c7fc8b7e0 URL: https://github.com/llvm/llvm-project/commit/684f27d37a6f1faf546a71bcb784b48c7fc8b7e0 DIFF: https://github.com/llvm/llvm-project/commit/684f27d37a6f1faf546a71bcb784b48c7fc8b7e0.diff LOG:

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/87868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Owen Pan via cfe-commits
@@ -290,6 +290,16 @@ TEST_F(FormatTestTableGen, MultiClass) { "}\n"); } +TEST_F(FormatTestTableGen, MultiClassesWithPasteOperator) { + // This is a sensitive example for the handling of the paste operators in + // brace type calculation. + verifyFormat("multi

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/87953 Also fix unit tests and reformat polly. Fixes #86550. >From 6d0c7e5602a227b1b7310be46553aa689e6a93e7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 7 Apr 2024 17:27:21 -0700 Subject: [PATCH] [clang-format] C

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
@@ -538,16 +538,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { if (Style.Language == FormatStyle::LK_Proto) { ProbablyBracedList = NextTok->isOneOf(tok::comma, tok::r_square); } else { - // Skip NextTok over prepro

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
owenca wrote: The polly formatting failure should be ignored as CI is using clang-format 18.1.1 instead of the version built from this patch. https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Remove trailing newlines in TableGen formatting test. (PR #87983)

2024-04-08 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/87983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] instanceof is a keyword only in Java/JavaScript (PR #88085)

2024-04-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/88085 Fixes #87907. >From 0daef6caaac5d3779cda0d4cbbf9cd2514662b92 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 8 Apr 2024 20:29:26 -0700 Subject: [PATCH] [clang-format] instanceof is a keyword only in Java/Java

[clang] 5c056b3 - [clang-format] Clean up unit tests from commit 13be0d4a34c4

2024-04-08 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-04-08T21:20:18-07:00 New Revision: 5c056b32350e834924356b1af78504d261d24e42 URL: https://github.com/llvm/llvm-project/commit/5c056b32350e834924356b1af78504d261d24e42 DIFF: https://github.com/llvm/llvm-project/commit/5c056b32350e834924356b1af78504d261d24e42.diff LOG:

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] instanceof is a keyword only in Java/JavaScript (PR #88085)

2024-04-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/88085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't merge a short block for SBS_Never (PR #88238)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/88238 Also fix unit tests. Fixes #87484. >From 4122a4f0e189afa7aff1010f0061b4f4d2b2a627 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 10 Apr 2024 00:03:21 -0700 Subject: [PATCH] [clang-format] Don't merge a short

[clang] [clang-format] Don't merge a short block for SBS_Never (PR #88238)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/88238 >From 4122a4f0e189afa7aff1010f0061b4f4d2b2a627 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 10 Apr 2024 00:03:21 -0700 Subject: [PATCH 1/2] [clang-format] Don't merge a short block for SBS_Never Also fix un

[clang] [clang-format] Don't merge a short block for SBS_Never (PR #88238)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/88238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix test case due to clang-format bug fix (PR #88352)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/88352 See commit 51f1681424f1. >From 3ecf27d15646345f43703f5a361bd9766307ebf4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 10 Apr 2024 21:22:05 -0700 Subject: [PATCH] [clangd] Fix test case due to clang-format bu

[clang-tools-extra] [clangd] Fix test case due to clang-format bug fix (PR #88352)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/88352 >From a070f07c16ddacc1aaf7591a1f7c129bf6abc90a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 10 Apr 2024 21:22:05 -0700 Subject: [PATCH] [clangd] Fix test case due to clang-format bug fix See commit 51f16814

[clang-tools-extra] [clangd] Fix test case due to clang-format bug fix (PR #88352)

2024-04-10 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/88352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix test case due to clang-format bug fix (PR #88352)

2024-04-10 Thread Owen Pan via cfe-commits
owenca wrote: @HighCommander4 Thanks! https://github.com/llvm/llvm-project/pull/88352 ___ 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 ContinuationIndenter (PR #88414)

2024-04-11 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/88414 Commit d06b92391513 caused a regression that breaks after a block comment adjacent to a function paramter that follows. Fixes #86573. >From 2ec43f6dc1fafed9d7fc324eeacfa07133af3abd Mon Sep 17 00:00:00 2001 From:

[clang] [clang-format] Fix a regression in ContinuationIndenter (PR #88414)

2024-04-11 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/88414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   9   10   >