mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 09:28:04 +00:00
only accept DEBUG=true
This commit is contained in:
parent
12466e91f5
commit
a7760df684
@ -90,7 +90,7 @@ public class Compiler {
|
|||||||
options.addOption("d", "debug", false, "Enable debug logging");
|
options.addOption("d", "debug", false, "Enable debug logging");
|
||||||
|
|
||||||
CommandLineParser parser = new DefaultParser();
|
CommandLineParser parser = new DefaultParser();
|
||||||
CommandLine cmd = null;
|
CommandLine cmd;
|
||||||
try {
|
try {
|
||||||
cmd = parser.parse(options, args);
|
cmd = parser.parse(options, args);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
@ -28,8 +28,7 @@ public class MethodContext {
|
|||||||
private final Deque<Label> continueLabels = new ArrayDeque<>();
|
private final Deque<Label> continueLabels = new ArrayDeque<>();
|
||||||
|
|
||||||
public MethodContext(ClassContext classContext, MethodVisitor mv, Type returnType) {
|
public MethodContext(ClassContext classContext, MethodVisitor mv, Type returnType) {
|
||||||
// if DEBUG env variable is set, log all method calls
|
if (Objects.equals(System.getenv("DEBUG"), "true")) {
|
||||||
if (System.getenv("DEBUG") != null) {
|
|
||||||
this.mv = new LoggingMethodVisitor(mv);
|
this.mv = new LoggingMethodVisitor(mv);
|
||||||
} else {
|
} else {
|
||||||
this.mv = mv;
|
this.mv = mv;
|
||||||
@ -85,7 +84,6 @@ public class MethodContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void wrapUp() {
|
public void wrapUp() {
|
||||||
//if return type is void, add return instruction
|
|
||||||
if (returnType.getKind() == Type.Kind.VOID) {
|
if (returnType.getKind() == Type.Kind.VOID) {
|
||||||
mv.visitInsn(Opcodes.RETURN);
|
mv.visitInsn(Opcodes.RETURN);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user