1 //===-- InlineFunctionDeclCheck.h -------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H
12 #include "../ClangTidyCheck.h"
13 #include "../FileExtensionsSet.h"
15 namespace clang::tidy::llvm_libc
{
17 /// Checks that explicitly and implicitly inline functions in headers files
18 /// are tagged with the LIBC_INLINE macro.
20 /// For more information about the LIBC_INLINE macro, see
21 /// https://libc.llvm.org/dev/code_style.html.
23 /// For the user-facing documentation see:
24 /// http://clang.llvm.org/extra/clang-tidy/checks/llvmlibc/inline-function-decl-check.html
25 class InlineFunctionDeclCheck
: public ClangTidyCheck
{
27 InlineFunctionDeclCheck(StringRef Name
, ClangTidyContext
*Context
);
29 bool isLanguageVersionSupported(const LangOptions
&LangOpts
) const override
{
30 return LangOpts
.CPlusPlus
;
33 void registerMatchers(ast_matchers::MatchFinder
*Finder
) override
;
34 void check(const ast_matchers::MatchFinder::MatchResult
&Result
) override
;
37 FileExtensionsSet HeaderFileExtensions
;
40 } // namespace clang::tidy::llvm_libc
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H