add preproc tags.

git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4244 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2009-05-24 12:18:09 +00:00
parent 4d889a2588
commit 2871c6d19d
1 changed files with 6 additions and 0 deletions

View File

@ -90,9 +90,11 @@ class IRGenerator implements ASTVisitor<Void, Expr> {
}
// #@@}
// #@@range/assign{
private void assign(Location loc, Expr lhs, Expr rhs) {
stmts.add(new Assign(loc, addressOf(lhs), rhs));
}
// #@@}
private DefinedVariable tmpVar(Type t) {
return scopeStack.getLast().allocateTmp(t);
@ -692,7 +694,9 @@ class IRGenerator implements ASTVisitor<Void, Expr> {
Expr expr = addressOf(transformExpr(node.expr()));
Expr offset = ptrdiff(node.offset());
Expr addr = new Bin(ptr_t(), Op.ADD, expr, offset);
// #@@range/Member_ret{
return node.isLoadable() ? mem(addr, node.type()) : addr;
// #@@}
}
// #@@}
@ -801,9 +805,11 @@ class IRGenerator implements ASTVisitor<Void, Expr> {
}
// mem(expr) -> (Mem expr)
// #@@range/mem{
private Mem mem(Expr expr, Type t) {
return new Mem(asmType(t), expr);
}
// #@@}
// #@@range/ptrdiff{
private Int ptrdiff(long n) {