clang-tools 6.0.0

DeprecatedHeadersCheck.h
Go to the documentation of this file.
1 //===--- DeprecatedHeadersCheck.h - clang-tidy-------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
12
13 #include "../ClangTidy.h"
14
15 namespace clang {
16 namespace tidy {
17 namespace modernize {
18
19 /// This check replaces deprecated C library headers with their C++ STL
20 /// alternatives.
21 ///
22 /// Before:
23 /// ~~~{.cpp}
24 /// #include <header.h>
25 /// ~~~
26 ///
27 /// After:
28 /// ~~~{.cpp}
29 /// #include <cheader>
30 /// ~~~
31 ///
32 /// Example: ``<stdio.h> => <cstdio>``
33 ///
34 /// For the user-facing documentation see:
35 /// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
36 class DeprecatedHeadersCheck : public ClangTidyCheck {
37 public:
38 DeprecatedHeadersCheck(StringRef Name, ClangTidyContext *Context)
39 : ClangTidyCheck(Name, Context) {}
40 void registerPPCallbacks(CompilerInstance &Compiler) override;
41 };
42
43 } // namespace modernize
44 } // namespace tidy
45 } // namespace clang
46
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
Name
StringHandle Name
Definition: PreprocessorTracker.cpp:525
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
clang::tidy::modernize::DeprecatedHeadersCheck
This check replaces deprecated C library headers with their C++ STL alternatives. ...
Definition: DeprecatedHeadersCheck.h:36
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::modernize::DeprecatedHeadersCheck::DeprecatedHeadersCheck
DeprecatedHeadersCheck(StringRef Name, ClangTidyContext *Context)
Definition: DeprecatedHeadersCheck.h:38
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:104
clang::tidy::modernize::DeprecatedHeadersCheck::registerPPCallbacks
void registerPPCallbacks(CompilerInstance &Compiler) override
Override this to register PPCallbacks with Compiler.
Definition: DeprecatedHeadersCheck.cpp:43