mirror of https://github.com/aamine/cbc
add preproc tags
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4284 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
592bff7634
commit
092ff61e93
|
|
@ -586,17 +586,22 @@ public class CodeGenerator implements net.loveruby.cflat.sysdep.CodeGenerator,
|
|||
}
|
||||
|
||||
private long locateLocalVariables(LocalScope scope, long parentStackLen) {
|
||||
// #@@range/locateLocalVariables_loc{
|
||||
long len = parentStackLen;
|
||||
for (DefinedVariable var : scope.localVariables()) {
|
||||
len = alignStack(len + var.allocSize());
|
||||
var.setMemref(relocatableMem(-len, bp()));
|
||||
}
|
||||
// #@@}
|
||||
|
||||
// #@@range/locateLocalVariables_child{
|
||||
long maxLen = len;
|
||||
for (LocalScope s : scope.children()) {
|
||||
long childLen = locateLocalVariables(s, len);
|
||||
maxLen = Math.max(maxLen, childLen);
|
||||
}
|
||||
return maxLen;
|
||||
// #@@}
|
||||
}
|
||||
// #@@}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package net.loveruby.cflat.utils;
|
||||
|
||||
public abstract class AsmUtils {
|
||||
public final class AsmUtils {
|
||||
private AsmUtils() {}
|
||||
|
||||
// #@@range/align{
|
||||
static public long align(long n, long alignment) {
|
||||
return (n + alignment - 1) / alignment * alignment;
|
||||
}
|
||||
// #@@}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue