Skip to content

Commit

Permalink
[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload
Browse files Browse the repository at this point in the history
llvm-svn: 356788
  • Loading branch information
alexfh committed Mar 22, 2019
1 parent aea9db9 commit 5e381fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang-tools-extra/clangd/ClangdUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,12 @@ ParsedAST::build(std::unique_ptr<CompilerInvocation> CI,
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);
}
}
Expand Down

0 comments on commit 5e381fb

Please sign in to comment.