* net/loveruby/cflat/asm/Symbol.java -> LabelRef.java

* net/loveruby/cflat/asm/*.java: Symbol -> LabelRef.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4028 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2008-09-15 17:53:12 +00:00
parent de82f43658
commit a95ad7b451
6 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,9 @@
Tue Sep 16 02:53:07 2008 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/asm/Symbol.java -> LabelRef.java
* net/loveruby/cflat/asm/*.java: Symbol -> LabelRef.
Tue Sep 16 02:49:21 2008 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/asm/AsmEntity.java -> AsmOperand.java

2
ToDo
View File

@ -2,7 +2,6 @@
== Current
* AsmEntity -> AsmOperand
* Symbol -> LabelRef
* reject struct/union/array on stmt context
* -O (peephole optimization)
@ -240,3 +239,4 @@
- va_list
- objectify instruction
- fix &puts
- AsmEntity -> AsmOperand

View File

@ -162,23 +162,23 @@ public class Assembler {
//
public void jmp(Label label) {
insn("jmp", new Symbol(label));
insn("jmp", new LabelRef(label));
}
public void jz(Label label) {
insn("jz", new Symbol(label));
insn("jz", new LabelRef(label));
}
public void jnz(Label label) {
insn("jnz", new Symbol(label));
insn("jnz", new LabelRef(label));
}
public void je(Label label) {
insn("je", new Symbol(label));
insn("je", new LabelRef(label));
}
public void jne(Label label) {
insn("jne", new Symbol(label));
insn("jne", new LabelRef(label));
}
public void cmp(Type t, Register a, Register b) {
@ -239,7 +239,7 @@ public class Assembler {
// call function by relative address
public void call(String sym) {
insn("call", new Symbol(new Label(sym)));
insn("call", new LabelRef(new Label(sym)));
}
// call function by absolute address

View File

@ -4,7 +4,7 @@ public class DirectMemoryReference extends MemoryReference {
protected Literal value;
public DirectMemoryReference(Label label) {
this.value = new Symbol(label);
this.value = new LabelRef(label);
}
public DirectMemoryReference(IntegerLiteral n) {

View File

@ -8,7 +8,7 @@ public class ImmediateValue extends AsmOperand {
}
public ImmediateValue(Label label) {
this(new Symbol(label));
this(new LabelRef(label));
}
public ImmediateValue(AsmOperand entity) {

View File

@ -1,9 +1,9 @@
package net.loveruby.cflat.asm;
public class Symbol extends Literal {
public class LabelRef extends Literal {
protected Label label;
public Symbol(Label label) {
public LabelRef(Label label) {
this.label = label;
}