driver_env.h 990 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_
  5. #define CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_
  6. #include "common/ostream.h"
  7. #include "llvm/Support/VirtualFileSystem.h"
  8. #include "toolchain/install/install_paths.h"
  9. namespace Carbon {
  10. struct DriverEnv {
  11. // The filesystem for source code.
  12. llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs;
  13. // Helper to locate the toolchain installation's files.
  14. const InstallPaths* installation;
  15. // Standard output; stdout.
  16. llvm::raw_pwrite_stream& output_stream;
  17. // Error output; stderr.
  18. llvm::raw_pwrite_stream& error_stream;
  19. // For CARBON_VLOG.
  20. llvm::raw_pwrite_stream* vlog_stream = nullptr;
  21. // Tracks when the driver is being fuzzed.
  22. bool fuzzing = false;
  23. };
  24. } // namespace Carbon
  25. #endif // CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_