[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 01/10] Added an option to ignore macro definitions. --- clang

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
https://github.com/tomekpaszek edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -1355,8 +1355,11 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; bool ShouldFormat = TheLine.Affected || FixIndentation; -if (Style.I

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -24153,6 +24153,113 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + v

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -1355,6 +1355,8 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; bool ShouldFormat = TheLine.Affected || FixIndentation; +if (Style.Ig

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -1134,6 +1134,14 @@ void UnwrappedLineParser::parsePPDefine() { return; } + if (Style.IgnorePPDefinitions) { +do { + nextToken(); +} while (!eof()); tomekpaszek wrote: In this case, `eof` is a marker for the end of the unwrapped line th

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -24206,10 +24206,11 @@ TEST_F(FormatTest, IgnorePPDefinitions) { Style.IndentPPDirectives = FormatStyle::PPDIS_None; verifyNoChange("#if A\n" "#define A a\n" - "#endif", + "#endif\n", tomekpaszek wrote:

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
https://github.com/tomekpaszek commented: >Something here doesn't feel right Could you be more specific? https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-18 Thread via cfe-commits
@@ -24153,6 +24153,113 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + v

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-26 Thread via cfe-commits
https://github.com/tomekpaszek created https://github.com/llvm/llvm-project/pull/70338 None >From 8404d703d58658593e6112b478533edb124cd0e1 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Thu, 26 Oct 2023 16:19:36 +0200 Subject: [PATCH] Added an option to ignore macro definitions. --- clang

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-26 Thread via cfe-commits
https://github.com/tomekpaszek edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From 8404d703d58658593e6112b478533edb124cd0e1 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Thu, 26 Oct 2023 16:19:36 +0200 Subject: [PATCH 1/2] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
https://github.com/tomekpaszek ready_for_review https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
https://github.com/tomekpaszek edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
https://github.com/tomekpaszek edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From 8404d703d58658593e6112b478533edb124cd0e1 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Thu, 26 Oct 2023 16:19:36 +0200 Subject: [PATCH 1/2] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff ba11d314a67638454989d4e0aebae64145d1a8ac 228301b783fe365bb01cc8b7ba122ed9845c9a37 --

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { HazardyKnusperkeks wrote: Add some tests: * With formatted code a

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Björn Schäpers via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. + /// \version 18 + bool IgnorePPDefinitions; HazardyKnusperkeks wrote: Please sort alphabetically.

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Björn Schäpers via cfe-commits
@@ -1354,7 +1354,9 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; -bool ShouldFormat = TheLine.Affected || FixIndentation; +bool Shoul

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Emilia Kond via cfe-commits
rymiel wrote: https://github.com/llvm/llvm-project/pull/67911 is a pull request, not an issue, i'm not sure what you're referring to https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Emilia Kond via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. + /// \version 18 + bool IgnorePPDefinitions; rymiel wrote: (this applies to not just here, but belo

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Please refer to the [policy](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options) for adding new options. https://github.com/llvm/llvm-project/pull/70338 _

[clang] [clang-format] Option to ignore PP directives (PR #70338)

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

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Owen Pan via cfe-commits
owenca wrote: > #67911 is a pull request, not an issue, i'm not sure what you're referring to I think it was a typo. It should be #67991. https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-30 Thread via cfe-commits
https://github.com/mydeveloperday edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-30 Thread via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. mydeveloperday wrote: If you are changing this you need to regenerate the documentation https://githu

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-30 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-30 Thread via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-10 Thread Tobias Hieta via cfe-commits
tru wrote: @tomekpaszek do you plan to finish this PR? we have been testing it internally on our code and would really like this to land in upstream LLVM. https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-10 Thread via cfe-commits
tomekpaszek wrote: Yes, I just couldn't find time for it. I'll try to look into it within the next few days. Great to hear you there is interest in using it! https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From 46a2ad3fd19697ab8b92b7de061346b1471a8eed Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/3] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. + /// \version 18 + bool IgnorePPDefinitions; tomekpaszek wrote: fixed https://github.com/llvm/llvm

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
@@ -1354,7 +1354,9 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; -bool ShouldFormat = TheLine.Affected || FixIndentation; +bool Shoul

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { tomekpaszek wrote: added more tests now https://github.com/llvm/

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-11 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From cfe5937f53b549fdfbd6e4845a2d0ab91226cad3 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/3] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { HazardyKnusperkeks wrote: Can you also add some nested `#if` and

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,53 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -1134,6 +1134,14 @@ void UnwrappedLineParser::parsePPDefine() { return; } + if (Style.IgnorePPDefinitions) { +do { + nextToken(); +} while (!eof()); HazardyKnusperkeks wrote: I assume you have tested this on real code. Can you explain w

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,53 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -4719,6 +4723,7 @@ struct FormatStyle { R.IncludeStyle.IncludeIsMainRegex && IncludeStyle.IncludeIsMainSourceRegex == R.IncludeStyle.IncludeIsMainSourceRegex && + IgnorePPDefinitions == R.IgnorePPDefinitions && -

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -1355,6 +1355,8 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; bool ShouldFormat = TheLine.Affected || FixIndentation; +if (Style.Ig

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. HazardyKnusperkeks wrote: Run `clang/docs/tools/dump_format_style.py`. https://github.com/llvm/llvm-p

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,53 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,53 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-12 Thread Björn Schäpers via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + ve

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/4] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tomek (tomekpaszek) Changes Sometimes macro definitions contain a layout we don't want to change in any context. This PR adds a new style option `IgnorePPDefinitions` that prevents clang-format from touching PP directives. This PR addres

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/5] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/7] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
@@ -24153,6 +24153,23 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { tomekpaszek wrote: Good idea. Added cases to cover that https://

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-13 Thread via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. tomekpaszek wrote: thanks for the tip! https://github.com/llvm/llvm-project/pull/70338 __

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-14 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/8] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-14 Thread via cfe-commits
https://github.com/tomekpaszek updated https://github.com/llvm/llvm-project/pull/70338 >From b5ba0b3fde2c6662e19dfdf96a787621ec767460 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 1/9] Added an option to ignore macro definitions. --- clang/i

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-14 Thread Björn Schäpers via cfe-commits
@@ -1355,8 +1355,11 @@ unsigned UnwrappedLineFormatter::format( bool FixIndentation = (FixBadIndentation || ContinueFormatting) && Indent != TheLine.First->OriginalColumn; bool ShouldFormat = TheLine.Affected || FixIndentation; -if (Style.I

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-14 Thread Björn Schäpers via cfe-commits
@@ -24206,10 +24206,11 @@ TEST_F(FormatTest, IgnorePPDefinitions) { Style.IndentPPDirectives = FormatStyle::PPDIS_None; verifyNoChange("#if A\n" "#define A a\n" - "#endif", + "#endif\n", HazardyKnusperkeks w

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-17 Thread via cfe-commits
https://github.com/mydeveloperday edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-17 Thread via cfe-commits
https://github.com/mydeveloperday commented: Something here doesn't feel right https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-11-17 Thread via cfe-commits
@@ -24153,6 +24153,113 @@ TEST_F(FormatTest, WhitespaceSensitiveMacros) { verifyNoChange("FOO(String-ized&Messy+But: :Still=Intentional);", Style); } +TEST_F(FormatTest, IgnorePPDefinitions) { + FormatStyle Style = getLLVMStyle(); + Style.IgnorePPDefinitions = true; + + v