[clang-tools-extra] r356788 - [clangd] Call the new ClangTidyCheck::registerPPCallbacks overload

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 11:16:51 PDT 2019


Author: alexfh
Date: Fri Mar 22 11:16:51 2019
New Revision: 356788

URL: http://llvm.org/viewvc/llvm-project?rev=356788&view=rev
Log:
[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload

Modified:
    clang-tools-extra/trunk/clangd/ClangdUnit.cpp

Modified: clang-tools-extra/trunk/clangd/ClangdUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdUnit.cpp?rev=356788&r1=356787&r2=356788&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdUnit.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdUnit.cpp Fri Mar 22 11:16:51 2019
@@ -295,10 +295,12 @@ ParsedAST::build(std::unique_ptr<Compile
     CTContext->setASTContext(&Clang->getASTContext());
     CTContext->setCurrentFile(MainInput.getFile());
     CTFactories.createChecks(CTContext.getPointer(), CTChecks);
+    Preprocessor *PP = &Clang->getPreprocessor();
     for (const auto &Check : CTChecks) {
       // FIXME: the PP callbacks skip the entire preamble.
       // Checks that want to see #includes in the main file do not see them.
       Check->registerPPCallbacks(*Clang);
+      Check->registerPPCallbacks(Clang->getSourceManager(), PP, PP);
       Check->registerMatchers(&CTFinder);
     }
   }




More information about the cfe-commits mailing list