xref: /llvm-project/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.h (revision 4718da506091a37ca4863d979bc541e359b79b10)
18683f5deSPaula Toth //===-- CalleeNamespaceCheck.h ----------------------------------*- C++ -*-===//
28683f5deSPaula Toth //
38683f5deSPaula Toth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
48683f5deSPaula Toth // See https://llvm.org/LICENSE.txt for license information.
58683f5deSPaula Toth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
68683f5deSPaula Toth //
78683f5deSPaula Toth //===----------------------------------------------------------------------===//
88683f5deSPaula Toth 
98683f5deSPaula Toth #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
108683f5deSPaula Toth #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
118683f5deSPaula Toth 
128683f5deSPaula Toth #include "../ClangTidyCheck.h"
138683f5deSPaula Toth 
14*4718da50SCarlos Galvez namespace clang::tidy::llvm_libc {
158683f5deSPaula Toth 
168683f5deSPaula Toth /// Checks all calls resolve to functions within __llvm_libc namespace.
178683f5deSPaula Toth ///
188683f5deSPaula Toth /// For the user-facing documentation see:
196e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/llvmlibc/callee-namespace.html
208683f5deSPaula Toth class CalleeNamespaceCheck : public ClangTidyCheck {
218683f5deSPaula Toth public:
CalleeNamespaceCheck(StringRef Name,ClangTidyContext * Context)228683f5deSPaula Toth   CalleeNamespaceCheck(StringRef Name, ClangTidyContext *Context)
238683f5deSPaula Toth       : ClangTidyCheck(Name, Context) {}
248683f5deSPaula Toth 
isLanguageVersionSupported(const LangOptions & LangOpts)258683f5deSPaula Toth   bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
268683f5deSPaula Toth     return LangOpts.CPlusPlus;
278683f5deSPaula Toth   }
288683f5deSPaula Toth   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
298683f5deSPaula Toth   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
308683f5deSPaula Toth };
318683f5deSPaula Toth 
32*4718da50SCarlos Galvez } // namespace clang::tidy::llvm_libc
338683f5deSPaula Toth 
348683f5deSPaula Toth #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
35