[PATCH] D138821: [include-cleaner] Remove filtering from UsingDecl visit.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 03:07:44 PST 2022


hokein added inline comments.


================
Comment at: clang-tools-extra/include-cleaner/lib/WalkAST.cpp:86
       report(UD->getLocation(), TD,
              IsUsed ? RefType::Explicit : RefType::Ambiguous);
     }
----------------
VitaNuo wrote:
> kadircet wrote:
> > hokein wrote:
> > > we should report all references as explicit.
> > i think having `Ambiguous` here for unused symbols is fine. we'd like to consider such symbols for the purposes of saying "yeah this include is probably used" but we shouldn't be inserting headers for the unused ones.
> > 
> > do we have an example for the contrary?
> @hokein so what would be the final conclusion then? Should I re-introduce the "isUsed" check?
oh, right. `Ambiguous` is better, this is similar to OverloadExpr, we can't prove that the symbol is used. (sorry, I somewhat had an impression this should be explicit).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138821



More information about the cfe-commits mailing list