mirror of https://github.com/aamine/cbc
r4749@macbookpro: aamine | 2009-05-06 17:08:10 +0900
* net/loveruby/cflat/compiler/CodeGenerator.java: refactoring: rename variables. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4183 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
ec4ae3acfd
commit
98937145c8
|
|
@ -1,3 +1,8 @@
|
|||
Wed May 6 17:08:40 2009 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/compiler/CodeGenerator.java: refactoring:
|
||||
rename variables.
|
||||
|
||||
Wed May 6 15:50:22 2009 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/asm/Type.java: types should not know signed
|
||||
|
|
|
|||
|
|
@ -1081,35 +1081,28 @@ public class CodeGenerator implements IRVisitor<Void,Void>, ELFConstants {
|
|||
}
|
||||
// #@@}
|
||||
|
||||
/**
|
||||
* Loads variable value to the register. You must check node
|
||||
* by #isConstantAddress before calling this method.
|
||||
*/
|
||||
/** Loads variable value to the register. */
|
||||
// #@@range/loadVariable{
|
||||
protected void loadVariable(Var node, Register dest) {
|
||||
if (node.memref() == null) {
|
||||
as.mov(node.address(), dest);
|
||||
load(node.type(), mem(dest), dest);
|
||||
protected void loadVariable(Var var, Register dest) {
|
||||
if (var.memref() == null) {
|
||||
as.mov(var.address(), dest);
|
||||
load(var.type(), mem(dest), dest);
|
||||
}
|
||||
else {
|
||||
// regular variable
|
||||
load(node.type(), node.memref(), dest);
|
||||
load(var.type(), var.memref(), dest);
|
||||
}
|
||||
}
|
||||
// #@@}
|
||||
|
||||
/**
|
||||
* Loads an address of the variable to the register.
|
||||
* You must check node by #isConstantAddress before
|
||||
* calling this method.
|
||||
*/
|
||||
/** Loads the address of the variable to the register. */
|
||||
// #@@range/loadVariableAddress{
|
||||
protected void loadVariableAddress(Expr node, Register dest) {
|
||||
if (node.address() != null) {
|
||||
as.mov(node.address(), dest);
|
||||
protected void loadVariableAddress(Var var, Register dest) {
|
||||
if (var.address() != null) {
|
||||
as.mov(var.address(), dest);
|
||||
}
|
||||
else {
|
||||
as.lea(node.memref(), dest);
|
||||
as.lea(var.memref(), dest);
|
||||
}
|
||||
}
|
||||
// #@@}
|
||||
|
|
|
|||
Loading…
Reference in New Issue