Implement optimization for collapse instruction.

This commit is contained in:
2022-10-30 01:39:22 +08:00
parent 0a0be73ea7
commit 13131b0f31
4 changed files with 84 additions and 5 deletions

View File

@@ -80,7 +80,7 @@ namespace Cryville.Common.Pdt {
public class Collapse : PdtInstruction {
private string m_name;
public string Name { get { return m_name; } }
public LinkedListNode<PdtInstruction> Target { get; private set; }
public LinkedListNode<PdtInstruction> Target { get; internal set; }
public Collapse(string name, LinkedListNode<PdtInstruction> target) {
m_name = name;
Target = target;
@@ -195,6 +195,9 @@ namespace Cryville.Common.Pdt {
default: pc++; break;
}
}
else if (OP_TYPE[t2.Value[0]] == 1) {
colp = new Dictionary<LinkedListNode<PdtInstruction>, string> { { ins.Last, t2.Value } };
}
t1 = t2;
break;
case 0x0400: