mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
precompile and cache Carbon prelude (#7432)
Refactors the link driver to automatically compile and cache the carbon prelude for use in linking. Implements a `carbon_library` rule for compiling the Core library dependencies in the examples.
This commit is contained in:
@@ -26,19 +26,21 @@ can be written to standard output as these phases progress.
|
||||
CompileSubcommand::CompileSubcommand() : DriverSubcommand(SubcommandInfo) {}
|
||||
|
||||
auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
|
||||
if (driver_env.fuzzing && !options_.clang_args.empty()) {
|
||||
options_.compile_options.FixupFlags();
|
||||
|
||||
if (driver_env.fuzzing && !options_.compile_options.clang_args.empty()) {
|
||||
// Parsing specific Clang arguments can reach deep into
|
||||
// external libraries that aren't fuzz clean.
|
||||
TestAndDiagnoseIfFuzzingExternalLibraries(driver_env, "compile");
|
||||
return {.success = false};
|
||||
}
|
||||
|
||||
auto compile_driver = CompileDriver(&options_);
|
||||
auto compile_driver = CompileDriver(&options_.compile_options);
|
||||
|
||||
if (!compile_driver.Initialize(driver_env,
|
||||
[&](llvm::StringRef) -> std::string {
|
||||
return options_.output_filename.str();
|
||||
})) {
|
||||
if (!compile_driver.Initialize(
|
||||
driver_env, [&](llvm::StringRef) -> std::string {
|
||||
return options_.compile_options.output_filename.str();
|
||||
})) {
|
||||
return {.success = false};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user