clang-tools
23.0.0git
llvm-project
clang-tools-extra
clang-tidy
llvmlibc
InlineFunctionDeclCheck.h
Go to the documentation of this file.
1
//===----------------------------------------------------------------------===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H
11
12
#include "
../ClangTidyCheck.h
"
13
14
namespace
clang::tidy::llvm_libc
{
15
16
/// Checks that explicitly and implicitly inline functions in headers files
17
/// are tagged with the LIBC_INLINE macro.
18
///
19
/// For more information about the LIBC_INLINE macro, see
20
/// https://libc.llvm.org/dev/code_style.html.
21
///
22
/// For the user-facing documentation see:
23
/// https://clang.llvm.org/extra/clang-tidy/checks/llvmlibc/inline-function-decl-check.html
24
class
InlineFunctionDeclCheck
:
public
ClangTidyCheck
{
25
public
:
26
InlineFunctionDeclCheck
(StringRef Name,
ClangTidyContext
*Context);
27
28
bool
isLanguageVersionSupported
(
const
LangOptions &LangOpts)
const override
{
29
return
LangOpts.CPlusPlus;
30
}
31
32
void
registerMatchers
(ast_matchers::MatchFinder *Finder)
override
;
33
void
check
(
const
ast_matchers::MatchFinder::MatchResult &Result)
override
;
34
35
// Ignore implicit functions (e.g. implicit constructors or destructors)
36
std::optional<TraversalKind>
getCheckTraversalKind
()
const override
{
37
return
TK_IgnoreUnlessSpelledInSource;
38
}
39
};
40
41
}
// namespace clang::tidy::llvm_libc
42
43
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_INLINEFUNCTIONDECLCHECK_H
ClangTidyCheck.h
ClangTidyCheck
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition
ClangTidyDiagnosticConsumer.h:70
clang::tidy::llvm_libc::InlineFunctionDeclCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Definition
InlineFunctionDeclCheck.cpp:39
clang::tidy::llvm_libc::InlineFunctionDeclCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
Definition
InlineFunctionDeclCheck.cpp:45
clang::tidy::llvm_libc::InlineFunctionDeclCheck::isLanguageVersionSupported
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Definition
InlineFunctionDeclCheck.h:28
clang::tidy::llvm_libc::InlineFunctionDeclCheck::getCheckTraversalKind
std::optional< TraversalKind > getCheckTraversalKind() const override
Definition
InlineFunctionDeclCheck.h:36
clang::tidy::llvm_libc::InlineFunctionDeclCheck::InlineFunctionDeclCheck
InlineFunctionDeclCheck(StringRef Name, ClangTidyContext *Context)
Definition
InlineFunctionDeclCheck.cpp:35
clang::tidy::llvm_libc
Definition
CalleeNamespaceCheck.cpp:18
Generated on
for clang-tools by
1.14.0