Files
carbon-lang/toolchain/driver/driver_env.h
T
Jon Ross-Perkins de57c9988c Break out driver environment info into its own type. (#4299)
I want to split commands out so that we don't keep piling onto driver
(particularly as I'm eyeing clang-related commands). This extracts out
the DriverEnv so that it can be easily shared, with the CompilationUnit
as an example.

CARBON_VLOG_TO is to remove the vlog_stream_ requirement of CARBON_VLOG.
2024-09-12 00:06:31 +00:00

33 lines
895 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_DRIVER_DRIVER_ENV_H_
#define CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_
#include "common/ostream.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "toolchain/install/install_paths.h"
namespace Carbon {
struct DriverEnv {
// The filesystem for source code.
llvm::vfs::FileSystem& fs;
// Helper to locate the toolchain installation's files.
const InstallPaths* installation;
// Standard output; stdout.
llvm::raw_pwrite_stream& output_stream;
// Error output; stderr.
llvm::raw_pwrite_stream& error_stream;
// For CARBON_VLOG.
llvm::raw_pwrite_stream* vlog_stream = nullptr;
};
} // namespace Carbon
#endif // CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_