[clang] [clang][DependencyScanning] Fix misplaced Driver includes (NFC) (PR #187599)

Naveen Seth Hanig via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 19 15:02:49 PDT 2026


https://github.com/naveen-seth created https://github.com/llvm/llvm-project/pull/187599

As pointed out in [the review of #15277](https://github.com/llvm/llvm-project/pull/152770#discussion_r2962823008), `DependencyScannerImpl.h` includes headers from the driver. However, the dependency scanning library does not depend on the driver at all. This PR fixes the include issue.

The dependency on the Driver was removed following the RFC: https://discourse.llvm.org/t/rfc-new-clangoptions-library-remove-dependency-on-clangdriver-from-clangfrontend-and-flangfrontend/88773

>From 982df7c901b01a8b77eceb59a2ef9fc0b15f449e Mon Sep 17 00:00:00 2001
From: Naveen Seth Hanig <naveen.hanig at outlook.com>
Date: Thu, 19 Mar 2026 22:49:51 +0100
Subject: [PATCH] [clang][DependencyScanning] Fix misplaced Driver includes
 (NFC)

As pointed out in
https://github.com/llvm/llvm-project/pull/152770#discussion_r2962823008,
`DependencyScannerImpl.h` includes headers from the driver.
However, the dependency scanning library does not depend on the driver
at all. This fixes the include issue.

The dependency on the Driver was removed following the RFC:
https://discourse.llvm.org/t/rfc-new-clangoptions-library-remove-dependency-on-clangdriver-from-clangfrontend-and-flangfrontend/88773
---
 clang/include/clang/DependencyScanning/DependencyScannerImpl.h | 2 --
 clang/lib/Tooling/DependencyScanningTool.cpp                   | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/DependencyScanning/DependencyScannerImpl.h b/clang/include/clang/DependencyScanning/DependencyScannerImpl.h
index 9b1aa22a5c9f8..55dcbd6fe0e9f 100644
--- a/clang/include/clang/DependencyScanning/DependencyScannerImpl.h
+++ b/clang/include/clang/DependencyScanning/DependencyScannerImpl.h
@@ -11,8 +11,6 @@
 
 #include "clang/DependencyScanning/DependencyScanningFilesystem.h"
 #include "clang/DependencyScanning/ModuleDepCollector.h"
-#include "clang/Driver/Compilation.h"
-#include "clang/Driver/Driver.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Frontend/TextDiagnosticPrinter.h"
diff --git a/clang/lib/Tooling/DependencyScanningTool.cpp b/clang/lib/Tooling/DependencyScanningTool.cpp
index adf0c10612468..d1f8805c6b24b 100644
--- a/clang/lib/Tooling/DependencyScanningTool.cpp
+++ b/clang/lib/Tooling/DependencyScanningTool.cpp
@@ -10,6 +10,8 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticFrontend.h"
 #include "clang/DependencyScanning/DependencyScannerImpl.h"
+#include "clang/Driver/Compilation.h"
+#include "clang/Driver/Driver.h"
 #include "clang/Driver/Tool.h"
 #include "clang/Frontend/FrontendActions.h"
 #include "clang/Frontend/Utils.h"



More information about the cfe-commits mailing list