mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 00:18:16 +00:00
Track the list of blocks that form the body of a function. (#2941)
Use that list for lowering in lexical order, instead of rediscovering the list based on which blocks are referenced as branch targets.
This commit is contained in:
1 parent
5a90f660b9
commit
b908c6e274
61 files changed
+145
-176
No files matched your search
@@ -21,7 +21,6 @@ auto LoweringFunctionContext::GetBlock(SemanticsNodeBlockId block_id)
|
||||
llvm::BasicBlock*& entry = blocks_[block_id];
|
||||
if (!entry) {
|
||||
entry = llvm::BasicBlock::Create(llvm_context(), "", function_);
|
||||
block_worklist().Push(block_id);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
@@ -31,7 +30,6 @@ auto LoweringFunctionContext::TryToReuseBlock(SemanticsNodeBlockId block_id,
|
||||
if (!blocks_.insert({block_id, block}).second) {
|
||||
return false;
|
||||
}
|
||||
block_worklist().Push(block_id);
|
||||
if (block == synthetic_block_) {
|
||||
synthetic_block_ = nullptr;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user