[PATCH] D147034: [clangd] Replace the hacky include-cleaner macro-reference implementation.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 23 04:33:15 PDT 2023


kadircet accepted this revision.
kadircet added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:360
+    for (const auto &Ref : Refs) {
+      SourceLocation Loc = SM.getLocForStartOfFile(SM.getMainFileID())
+                               .getLocWithOffset(Ref.StartOffset);
----------------
nit: `auto Loc = SM.getComposedLoc(MainFile, Offset)`


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:369
+
+      if (auto DefLoc = Macro->NameLoc; DefLoc.isValid())
+        Macros.push_back(
----------------
nit: do early exit here as well


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147034



More information about the cfe-commits mailing list