[PATCH] D143093: [clangd] #undef macros inside preamble patch

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 09:46:18 PST 2023


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Preamble.cpp:721
+      // re-definition warnings.
+      if (TD.Directive == tok::pp_define)
+        Patch << "#undef " << TD.MacroName << '\n';
----------------
i know we've discussed emitting all the `#undef` directives at the top of the patch together rather than right before `#define` directives. but i am failing to remember any benefits and looping twice here doesn't feel great. so leaving it as-is for now, LMK if it feels wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143093/new/

https://reviews.llvm.org/D143093



More information about the cfe-commits mailing list