mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 08:38:03 +00:00
register block vars
This commit is contained in:
parent
8cdbf7a23b
commit
21aa8b1a2b
@ -203,7 +203,6 @@ public class TypedBinary implements TypedExpression {
|
||||
ctx.getMv().visitInsn(Opcodes.IMUL);
|
||||
}
|
||||
}
|
||||
//TODO: implement other operators
|
||||
ctx.popStack();
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class TypedBlock implements TypedNode {
|
||||
|
||||
public void codeGen(MethodContext ctx) {
|
||||
for (TypedLocalVariable var : vars) {
|
||||
//var.codeGen(ctx);
|
||||
ctx.registerVariable(var.getName(), var.getType());
|
||||
}
|
||||
for (TypedStatement stmt : stmts) {
|
||||
stmt.codeGen(ctx);
|
||||
|
@ -1,11 +1,16 @@
|
||||
public class ClassCanBeTyped {
|
||||
public ClassCanBeTyped c;
|
||||
public ClassCanBeTyped p;
|
||||
public int x;
|
||||
public boolean y;
|
||||
|
||||
|
||||
public boolean test(boolean b, boolean c) {
|
||||
return b || c;
|
||||
public int test(boolean b, boolean c) {
|
||||
int y;
|
||||
y = 0;
|
||||
if (b && c) {
|
||||
y = 12;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user