mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 08:51:04 +01:00
Split a cross-file Lower::Context out of Lower::FileContext. (#5583)
In preparation for lowering information from multiple `SemIR::File`s into a single `llvm::Module`. The primary purpose of this is to support lowering a local specific for an imported generic function, where the instructions for the generic function are in a different file than the instructions for the specific. See #5475 for a draft PR implementing that functionality on top of this. The per-`llvm::Module` state now lives in `Lower::Context`, and `Lower::FileContext` tracks only the per-`SemIR::File` information. `Lower::Context` should not mention any `SemIR` IDs that are file-specific. For now, the C++ lowering and the specific coalescing logic are kept per-file for simplicity.
This commit is contained in:
@@ -713,8 +713,8 @@ auto CompilationUnit::RunLower() -> void {
|
||||
subtrees = cache_->tree_and_subtrees_getters();
|
||||
}
|
||||
module_ = Lower::LowerToLLVM(*llvm_context_, driver_env_->fs, subtrees,
|
||||
input_filename_, *sem_ir_, sem_ir_->cpp_ast(),
|
||||
&inst_namer, vlog_stream_);
|
||||
input_filename_, *sem_ir_, &inst_namer,
|
||||
vlog_stream_);
|
||||
});
|
||||
if (vlog_stream_) {
|
||||
CARBON_VLOG("*** llvm::Module ***\n");
|
||||
|
||||
Reference in New Issue
Block a user