mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Modularize driver subcommands and prune unused dependencies (#7658)
- Subdivide toolchain/driver:driver into granular subcommand targets (compile_subcommand, format_subcommand, lld_subcommand, etc.) to enable independent compilation and linking. - Decouple Target and TargetMachine options from driver headers. - Prune unused direct dependencies across toolchain BUILD files. Assisted-by: Antigravity with Gemini
This commit is contained in:
@@ -19,11 +19,14 @@
|
||||
#include "llvm/ADT/ScopeExit.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/MC/TargetRegistry.h"
|
||||
#include "llvm/Passes/OptimizationLevel.h"
|
||||
#include "llvm/Passes/PassBuilder.h"
|
||||
#include "llvm/Passes/StandardInstrumentations.h"
|
||||
#include "llvm/Support/SaveAndRestore.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "toolchain/base/clang_invocation.h"
|
||||
#include "toolchain/base/timings.h"
|
||||
#include "toolchain/check/check.h"
|
||||
@@ -62,6 +65,8 @@ CompilationUnit::CompilationUnit(
|
||||
}
|
||||
}
|
||||
|
||||
CompilationUnit::~CompilationUnit() = default;
|
||||
|
||||
auto CompilationUnit::IncludeInDumps() -> bool {
|
||||
return cache_->include_in_dumps().Get(check_ir_id_);
|
||||
}
|
||||
@@ -421,6 +426,8 @@ auto CompilationUnit::LogCall(llvm::StringLiteral logging_label,
|
||||
|
||||
CompileDriver::CompileDriver(CompileOptions* options) : options_(options) {}
|
||||
|
||||
CompileDriver::~CompileDriver() = default;
|
||||
|
||||
auto CompileDriver::Initialize(
|
||||
DriverEnv& driver_env,
|
||||
llvm::function_ref<auto(llvm::StringRef)->std::string> map_input) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user