Allow LocalVariable
to be assigned more than once (#2288)
* Allow `LocalVariable` to be assigned more than once This allows us to write flow controls like loops and if-elses with LocalVariables participating in phi nodes. * Add `GetLocalNumber` to operand
This commit is contained in:
parent
212e472c9f
commit
c805542b29
6 changed files with 47 additions and 16 deletions
|
@ -10,15 +10,17 @@ namespace ARMeilleure.Translation
|
|||
private BasicBlock[] _postOrderBlocks;
|
||||
private int[] _postOrderMap;
|
||||
|
||||
public int LocalsCount { get; }
|
||||
public BasicBlock Entry { get; }
|
||||
public IntrusiveList<BasicBlock> Blocks { get; }
|
||||
public BasicBlock[] PostOrderBlocks => _postOrderBlocks;
|
||||
public int[] PostOrderMap => _postOrderMap;
|
||||
|
||||
public ControlFlowGraph(BasicBlock entry, IntrusiveList<BasicBlock> blocks)
|
||||
public ControlFlowGraph(BasicBlock entry, IntrusiveList<BasicBlock> blocks, int localsCount)
|
||||
{
|
||||
Entry = entry;
|
||||
Blocks = blocks;
|
||||
LocalsCount = localsCount;
|
||||
|
||||
Update(removeUnreachableBlocks: true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue