diff options
author | FICTURE7 <FICTURE7@gmail.com> | 2021-05-17 03:54:53 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 01:54:53 +0200 |
commit | c805542b29975b0d9bf3ea324526f62cfe4331bf (patch) | |
tree | 7c29106997c8f08b9335f7de856518f103e7f42c /ARMeilleure/Translation/ControlFlowGraph.cs | |
parent | 212e472c9fac8253456d710e0b071579da330c0a (diff) |
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
Diffstat (limited to 'ARMeilleure/Translation/ControlFlowGraph.cs')
-rw-r--r-- | ARMeilleure/Translation/ControlFlowGraph.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ARMeilleure/Translation/ControlFlowGraph.cs b/ARMeilleure/Translation/ControlFlowGraph.cs index ee1a245e..4c76d5dd 100644 --- a/ARMeilleure/Translation/ControlFlowGraph.cs +++ b/ARMeilleure/Translation/ControlFlowGraph.cs @@ -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); } |