Skip to content

Conversation

@naveen-seth
Copy link
Contributor

Improves the readability of getFirstCC1CommandLine() by using consistent naming and adding documentation.
(This addresses the feedback in #169964 (comment))

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Dec 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 15, 2025

@llvm/pr-subscribers-clang

Author: Naveen Seth Hanig (naveen-seth)

Changes

Improves the readability of getFirstCC1CommandLine() by using consistent naming and adding documentation.
(This addresses the feedback in #169964 (comment))


Full diff: https://github.com/llvm/llvm-project/pull/172352.diff

1 Files Affected:

  • (modified) clang/lib/Tooling/DependencyScanningTool.cpp (+5-2)
diff --git a/clang/lib/Tooling/DependencyScanningTool.cpp b/clang/lib/Tooling/DependencyScanningTool.cpp
index 74cc6af3551f8..87f756d2f4df4 100644
--- a/clang/lib/Tooling/DependencyScanningTool.cpp
+++ b/clang/lib/Tooling/DependencyScanningTool.cpp
@@ -189,15 +189,18 @@ buildCC1CommandLine(const driver::Command &Cmd) {
   return Out;
 }
 
+/// Builds the compilation for the given driver command line and returns the
+/// first -cc1 command line, or std::nullopt on error, with diagnostics
+/// reported to \c Diags.
 static std::optional<std::vector<std::string>> getFirstCC1CommandLine(
     ArrayRef<std::string> CommandLine, DiagnosticsEngine &Diags,
-    llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> ScanFS) {
+    llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS) {
   // Compilation holds a non-owning a reference to the Driver, hence we need to
   // keep the Driver alive when we use Compilation. Arguments to commands may be
   // owned by Alloc when expanded from response files.
   llvm::BumpPtrAllocator Alloc;
   const auto [Driver, Compilation] =
-      buildCompilation(CommandLine, Diags, ScanFS, Alloc);
+      buildCompilation(CommandLine, Diags, OverlayFS, Alloc);
   if (!Compilation)
     return std::nullopt;
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants