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

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 19:45:07 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();
+  }
----------------
owenca wrote:

Np!

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


More information about the cfe-commits mailing list