diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp b/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp index ec1e779a8e8..137bb6c41ce 100644 --- a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp @@ -40,14 +40,14 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { // FIXME: Check that this namespace is "long". if (Tok.is(tok::comment)) { // FIXME: Check comment content. + // FIXME: Check comment placement on the same line. return; } std::string Fix = " // namespace"; if (!ND->isAnonymousNamespace()) Fix = Fix.append(" ").append(ND->getNameAsString()); - Context->Diag(ND->getLocation(), - "namespace not terminated with a closing comment") + diag(ND->getLocation(), "namespace not terminated with a closing comment") << FixItHint::CreateInsertion(ND->getRBraceLoc().getLocWithOffset(1), Fix); } @@ -55,8 +55,8 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { namespace { class IncludeOrderPPCallbacks : public PPCallbacks { public: - explicit IncludeOrderPPCallbacks(ClangTidyContext &Context) - : Context(Context) {} + explicit IncludeOrderPPCallbacks(IncludeOrderCheck &Check) + : Check(Check) {} virtual void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, @@ -66,17 +66,17 @@ public: const Module *Imported) { // FIXME: This is a dummy implementation to show how to get at preprocessor // information. Implement a real include order check. - Context.Diag(HashLoc, "This is an include"); + Check.diag(HashLoc, "This is an include"); } private: - ClangTidyContext &Context; + IncludeOrderCheck &Check; }; } // namespace void IncludeOrderCheck::registerPPCallbacks(CompilerInstance &Compiler) { Compiler.getPreprocessor() - .addPPCallbacks(new IncludeOrderPPCallbacks(*Context)); + .addPPCallbacks(new IncludeOrderPPCallbacks(*this)); } class LLVMModule : public ClangTidyModule { |