Refactor coalescing logic out of the file context. (#5723)

Move coalescing logic outside of the file context.
This is intended to be pure refactoring / NFC.
This commit is contained in:
Alina Sbirlea authored and GitHub committed 2025-06-25 21:22:58 +00:00
1 parent 70c94cb5b4
commit dd0905ccbb
7 files changed
+428 -360

No files matched your search

+3 -2
View File
@@ -13,6 +13,7 @@
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "toolchain/lower/file_context.h"
#include "toolchain/lower/specific_coalescer.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/ids.h"
@@ -27,7 +28,7 @@ class FunctionContext {
explicit FunctionContext(
FileContext& file_context, llvm::Function* function,
FileContext& specific_file_context, SemIR::SpecificId specific_id,
FileContext::SpecificFunctionFingerprint* function_fingerprint,
SpecificCoalescer::SpecificFunctionFingerprint* function_fingerprint,
llvm::DISubprogram* di_subprogram, llvm::raw_ostream* vlog_stream);
// Describes a function's body fingerprint while creating the function body.
@@ -349,7 +350,7 @@ class FunctionContext {
// The accumulated fingerprint is owned by the FileContext and passed into
// the FunctionContext. The function fingerprint is currently only built for
// specific functions, otherwise, this will be nullptr.
FileContext::SpecificFunctionFingerprint* function_fingerprint_;
SpecificCoalescer::SpecificFunctionFingerprint* function_fingerprint_;
// Maps a function's SemIR::File blocks to lowered blocks.
Map<SemIR::InstBlockId, llvm::BasicBlock*> blocks_;