Files
carbon-lang/toolchain/driver/driver_subcommand.cpp
T
Chandler Carruth 046fbbcb29 Tweak the name for the function that diagnoses when fuzzing external libraries (#5974)
The old function name caused some confusion during the review of #5338,
sending this to see if it provides a less surprising function name and
boolean result. Happy to try other names / approaches as well.
2025-08-21 19:36:44 +00:00

29 lines
851 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
#include "toolchain/driver/driver_subcommand.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include "toolchain/driver/lld_runner.h"
namespace Carbon {
auto DriverSubcommand::TestAndDiagnoseIfFuzzingExternalLibraries(
DriverEnv& driver_env, llvm::StringRef name) -> bool {
// Only need to do anything when fuzzing.
if (!driver_env.fuzzing) {
return false;
}
CARBON_DIAGNOSTIC(
ToolFuzzingDisallowed, Error,
"preventing fuzzing of `{0}` subcommand due to external library",
std::string);
driver_env.emitter.Emit(ToolFuzzingDisallowed, name.str());
return true;
}
} // namespace Carbon