[clang] 62fec3d - [NFCI] [ClangScanDeps] [P1689] Use PreprocessorOnly Action for P1689

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 00:21:32 PDT 2024


Author: Chuanqi Xu
Date: 2024-09-06T15:20:59+08:00
New Revision: 62fec3d23d2325869e6eba0263b0b9f834c2067f

URL: https://github.com/llvm/llvm-project/commit/62fec3d23d2325869e6eba0263b0b9f834c2067f
DIFF: https://github.com/llvm/llvm-project/commit/62fec3d23d2325869e6eba0263b0b9f834c2067f.diff

LOG: [NFCI] [ClangScanDeps] [P1689] Use PreprocessorOnly Action for P1689

It is fine enough to use PreprocessorOnly action for P1689 format. We
don't need to read any PCH or module files.

Added: 
    

Modified: 
    clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 1a21a4f5e30ff8..09ad5ebc7954cf 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -430,7 +430,9 @@ class DependencyScanningAction : public tooling::ToolAction {
 
     std::unique_ptr<FrontendAction> Action;
 
-    if (ModuleName)
+    if (Format == ScanningOutputFormat::P1689)
+      Action = std::make_unique<PreprocessOnlyAction>();
+    else if (ModuleName)
       Action = std::make_unique<GetDependenciesByModuleNameAction>(*ModuleName);
     else
       Action = std::make_unique<ReadPCHAndPreprocessAction>();


        


More information about the cfe-commits mailing list