mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:11:05 +01:00
This removes a bunch of manual filesystem helpers and complexity that are directly provided by the new library. It also moves all of the install paths detection to use `std::filesystem::path` instead of the LLVM path library. The goal is to consolidate all our logic onto a single stack, and the standard one seems the best for that purpose. This does give up some of the optimizations of this code to avoid memory allocation, but in practice that likely isn't a critical issue. And with the new filesystem library we can likely do more to avoid that by using directory-object-relative filesystem access. However, that will have to wait for moving more parts of the toolchain over to use this set of filesystem abstractions. There is a related TODO left in the manifest handling code.
21 lines
745 B
C++
21 lines
745 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TOOLCHAIN_INSTALL_INSTALL_PATHS_TEST_HELPERS_H_
|
|
#define CARBON_TOOLCHAIN_INSTALL_INSTALL_PATHS_TEST_HELPERS_H_
|
|
|
|
#include "llvm/Support/VirtualFileSystem.h"
|
|
#include "toolchain/install/install_paths.h"
|
|
|
|
namespace Carbon::Testing {
|
|
|
|
// Prepares the VFS with prelude files from the real filesystem.
|
|
auto AddPreludeFilesToVfs(
|
|
const InstallPaths& install_paths,
|
|
llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem>& vfs) -> void;
|
|
|
|
} // namespace Carbon::Testing
|
|
|
|
#endif // CARBON_TOOLCHAIN_INSTALL_INSTALL_PATHS_TEST_HELPERS_H_
|