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

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 01:40:35 PST 2024


================
@@ -1157,7 +1157,15 @@ void UnwrappedLineParser::parsePPDefine() {
   // guard processing above, and changes preprocessing nesting.
   FormatTok->Tok.setKind(tok::identifier);
   FormatTok->Tok.setIdentifierInfo(Keywords.kw_internal_ident_after_define);
-  nextToken();
+
+  if (Style.SkipMacroDefinitionBody) {
+    do {
+      nextToken();
+    } while (!eof());
+  } else {
+    nextToken();
+  }
----------------
tomekpaszek wrote:

Hi!
Maybe it's a little late, but I wanted to let you know that I've tried that but it didn't give the expected results. Didn't have time to dig into this approach.

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


More information about the cfe-commits mailing list