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`.
20 lines
757 B
C++
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())) {}
|