kadircet accepted this revision. kadircet added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/Sema/SemaDecl.cpp:1784 if (D->isInvalidDecl() || D->isUsed() || D->hasAttr<UnusedAttr>()) return false; ---------------- sammccall wrote: > kadircet wrote: > > i think we can just bail out early here when the main file is a header file > > (i.e. lang opts have `IsHeaderFile` set). > This makes sense. > > I'd rather do this as a separate commit in case we need to revert. > This one is a functional change the IsHeaderFile check to a place that's > already testing for header-like contexts. > The other would be a (hopefully) NFC for performance. > > (This function isn't terribly hot in the clangd profiles I have, but seems > like a reasonable change to me anyway) SG. i was actually worried about the behaviour implied by the name "isMainFileLoc". i feel like both `TU_Complete` and `IsHeaderFile` check should actually happen here (or at least outside of the `isMainFileLoc`). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129642/new/ https://reviews.llvm.org/D129642 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits