Skip to content

Commit 5e381fb

Browse files
committed
[clangd] Call the new ClangTidyCheck::registerPPCallbacks overload
llvm-svn: 356788
1 parent aea9db9 commit 5e381fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang-tools-extra/clangd/ClangdUnit.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,12 @@ ParsedAST::build(std::unique_ptr<CompilerInvocation> CI,
295295
CTContext->setASTContext(&Clang->getASTContext());
296296
CTContext->setCurrentFile(MainInput.getFile());
297297
CTFactories.createChecks(CTContext.getPointer(), CTChecks);
298+
Preprocessor *PP = &Clang->getPreprocessor();
298299
for (const auto &Check : CTChecks) {
299300
// FIXME: the PP callbacks skip the entire preamble.
300301
// Checks that want to see #includes in the main file do not see them.
301302
Check->registerPPCallbacks(*Clang);
303+
Check->registerPPCallbacks(Clang->getSourceManager(), PP, PP);
302304
Check->registerMatchers(&CTFinder);
303305
}
304306
}

0 commit comments

Comments
 (0)