llvm-project/clang/lib/DependencyScanning/DependencyScanningService.cpp
Jan Svoboda e7bad4ac4f
[clang][deps] Make the service provide the VFS (#181424)
This PR makes it so that the base VFS used during a scan is provided to
the top-level service, not to each worker/tool individually. This
enables resolving a FIXME in the async-scan-modules mode of the scanner,
will clean up [downstream
code](0eb56baa1d/clang/tools/libclang/CDependencies.cpp (L619-L622)),
and will make it more difficult to have mismatching VFSs across workers,
which may cause non-deterministic poisoning of
`DependencyScanningFilesystemSharedCache`.
2026-02-17 12:25:39 -08:00

20 lines
757 B
C++

//===- DependencyScanningService.cpp - Scanning Service -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "clang/DependencyScanning/DependencyScanningService.h"
#include "llvm/Support/Chrono.h"
using namespace clang;
using namespace dependencies;
DependencyScanningServiceOptions::DependencyScanningServiceOptions()
: MakeVFS([] { return llvm::vfs::createPhysicalFileSystem(); }),
BuildSessionTimestamp(
llvm::sys::toTimeT(std::chrono::system_clock::now())) {}