mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Factor param/arg ref logic to a class. (#3728)
Just segmenting out a chunk of logic while I'm thinking about function parameters.
This commit is contained in:
@@ -27,8 +27,8 @@ auto InstBlockStack::PushGlobalInit() -> void {
|
||||
}
|
||||
|
||||
auto InstBlockStack::PeekOrAdd(int depth) -> SemIR::InstBlockId {
|
||||
CARBON_CHECK(size() > depth) << "no such block";
|
||||
int index = size() - depth - 1;
|
||||
CARBON_CHECK(size_ > depth) << "no such block";
|
||||
int index = size_ - depth - 1;
|
||||
auto& slot = stack_[index];
|
||||
if (!slot.id.is_valid()) {
|
||||
slot.id = sem_ir_->inst_blocks().AddDefaultValue();
|
||||
|
||||
Reference in New Issue
Block a user