Files
carbon-lang/toolchain/driver/driver_env.h
T
Chandler Carruth 954441c358 Exempt the clang subcommand when fuzzing. (#4468)
This teaches the driver library to track when its being used with
fuzzing and disables the `clang` subcommand from actually running Clang.

The Clang libraries have a large backlog of fuzzer-found issues that
isn't being actively reduced, so we can't productively fuzz into it.
This lets us more productively fuzz at the top level.

This is also available on the command line itself, which should be
useful if anyone wants to fuzz Carbon from the command line using tools
like AFL -- they can inject this flag to avoid getting noise from the
fuzzer hitting known issues in Clang.
2024-11-01 15:35:29 +00:00

36 lines
965 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;
// Tracks when the driver is being fuzzed.
bool fuzzing = false;
};
} // namespace Carbon
#endif // CARBON_TOOLCHAIN_DRIVER_DRIVER_ENV_H_