mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 20:48:12 +00:00
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.
33 lines
895 B
C++
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_
|