ClockMan added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/llvmlibc/InlineFunctionDeclCheck.cpp:20
+void InlineFunctionDeclCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(decl(functionDecl()).bind("func_decl"), this);
+}
----------------
carlosgalvezp wrote:
> ClockMan wrote:
> > or maybe even better:
> > Finder->addMatcher(functionDecl(unless(isExpansionInMainFile()), 
> > isInline()).bind("func_decl"), this);
> > Instead of line 26 and 32.
> I'm not sure that works - if we pass a header directly to clang-tidy, it will 
> consider it as the "main file", right? That's why the established pattern is 
> based on `HeaderFileExtensions`, please check out other checks.
Yes you right, but isInline still can be checked here.
As for HeaderFileExtensions never used it from both developer and user point of 
view.
When running clang-tidy on headers is still better simply create file with 
single include.
Maybe if there would be AST_MATCHER for HeaderFileExtensions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142592

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to