[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload

llvm-svn: 356788
This commit is contained in:
Alexander Kornienko 2019-03-22 18:16:51 +00:00
parent aea9db9d40
commit 5e381fb11a

View File

@ -295,10 +295,12 @@ ParsedAST::build(std::unique_ptr<CompilerInvocation> CI,
CTContext->setASTContext(&Clang->getASTContext()); CTContext->setASTContext(&Clang->getASTContext());
CTContext->setCurrentFile(MainInput.getFile()); CTContext->setCurrentFile(MainInput.getFile());
CTFactories.createChecks(CTContext.getPointer(), CTChecks); CTFactories.createChecks(CTContext.getPointer(), CTChecks);
Preprocessor *PP = &Clang->getPreprocessor();
for (const auto &Check : CTChecks) { for (const auto &Check : CTChecks) {
// FIXME: the PP callbacks skip the entire preamble. // FIXME: the PP callbacks skip the entire preamble.
// Checks that want to see #includes in the main file do not see them. // Checks that want to see #includes in the main file do not see them.
Check->registerPPCallbacks(*Clang); Check->registerPPCallbacks(*Clang);
Check->registerPPCallbacks(Clang->getSourceManager(), PP, PP);
Check->registerMatchers(&CTFinder); Check->registerMatchers(&CTFinder);
} }
} }