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

Viktoriia Bakalova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 01:07:08 PST 2022


VitaNuo added inline comments.


================
Comment at: clang-tools-extra/include-cleaner/lib/WalkAST.cpp:86
       report(UD->getLocation(), TD,
              IsUsed ? RefType::Explicit : RefType::Ambiguous);
     }
----------------
hokein wrote:
> 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).
Ok, thank you. I have re-introduced the isUsed check now.


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