[clang] [clang-format] Option to ignore macro definitions (PR #70338)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 22 04:36:19 PST 2023


================
@@ -1355,6 +1362,10 @@ unsigned UnwrappedLineFormatter::format(
     bool FixIndentation = (FixBadIndentation || ContinueFormatting) &&
                           Indent != TheLine.First->OriginalColumn;
     bool ShouldFormat = TheLine.Affected || FixIndentation;
+
+    if (Style.IgnorePPDefinitions && lineContainsPPDefinition(TheLine))
+      ShouldFormat = false;
----------------
tomekpaszek wrote:

Personally, I like the original approach but maybe having longer conditions is more in line with the rest of the code. Let me know if I should change it.

https://github.com/llvm/llvm-project/pull/70338


More information about the cfe-commits mailing list