[clang-tools-extra] r345984 - [clang-tidy] Fixed code sample in a comment. NFC
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 2 08:29:37 PDT 2018
Author: alexfh
Date: Fri Nov 2 08:29:37 2018
New Revision: 345984
URL: http://llvm.org/viewvc/llvm-project?rev=345984&view=rev
Log:
[clang-tidy] Fixed code sample in a comment. NFC
Modified:
clang-tools-extra/trunk/clang-tidy/utils/IncludeInserter.h
Modified: clang-tools-extra/trunk/clang-tidy/utils/IncludeInserter.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/IncludeInserter.h?rev=345984&r1=345983&r2=345984&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/IncludeInserter.h (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/IncludeInserter.h Fri Nov 2 08:29:37 2018
@@ -25,16 +25,18 @@ namespace utils {
/// \brief Produces fixes to insert specified includes to source files, if not
/// yet present.
///
-/// ``IncludeInserter`` can be used by ``ClangTidyCheck`` in the following
-/// fashion:
+/// ``IncludeInserter`` can be used in clang-tidy checks in the following way:
/// \code
+/// #include "../utils/IncludeInserter.h"
+/// #include "clang/Frontend/CompilerInstance.h"
+///
/// class MyCheck : public ClangTidyCheck {
/// public:
/// void registerPPCallbacks(CompilerInstance& Compiler) override {
/// Inserter = llvm::make_unique<IncludeInserter>(&Compiler.getSourceManager(),
/// &Compiler.getLangOpts());
/// Compiler.getPreprocessor().addPPCallbacks(
-/// Inserter->CreatePPCallback());
+/// Inserter->CreatePPCallbacks());
/// }
///
/// void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
@@ -49,7 +51,7 @@ namespace utils {
/// }
///
/// private:
-/// std::unique_ptr<IncludeInserter> Inserter;
+/// std::unique_ptr<clang::tidy::utils::IncludeInserter> Inserter;
/// };
/// \endcode
class IncludeInserter {
More information about the cfe-commits
mailing list