Skip to content

Commit

Permalink
Add Debug.UNSTABLE and gate unstable target/features behind it
Browse files Browse the repository at this point in the history
  • Loading branch information
titzer committed Sep 11, 2024
1 parent 98633de commit b3558b2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions aeneas/src/arm64/Arm64Linux.v3
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
def SPACE = AddressSpace.new("mem", false, 64, 8,
Alignment.new(4096), Alignment.new(8));
def KERNEL_CALL_RETURN = Tuple.newType(Lists.cons2(Long.TYPE, Long.TYPE));
def Arm64_LINUX_TARGET = Aeneas.registerTarget(
LinuxTarget.new("arm64-linux", SPACE, IntNormalizers.I64LE, Arm64Common.LOWERING,
def X_ = if(Debug.UNSTABLE, // unstable target for now
Aeneas.registerTarget(LinuxTarget.new("arm64-linux", SPACE, IntNormalizers.I64LE, Arm64Common.LOWERING,
Arm64LinuxBackend.new(_, _, _, _, _, false), ElfConst.EM_AARCH64,
KERNEL_CALL_RETURN));
KERNEL_CALL_RETURN)));

def Regs: Arm64Regs;
def MRegs: Arm64RegSet;
Expand Down
1 change: 1 addition & 0 deletions aeneas/src/main/Aeneas.v3
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ component Aeneas {
def printVersion(long: bool, next: string) {
Terminal.put("Aeneas ");
Terminal.put(Version.version);
if (!Debug.UNSTABLE) Terminal.put(" (stable)");
var data = Version.buildData;
if (long && data != null) {
Terminal.put("\nBuild Data: ");
Expand Down
6 changes: 3 additions & 3 deletions aeneas/src/main/CLOptions.v3
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ component CLOptions {
"Force inlining of direct calls to the given method(s).");
// Debugging options
def PRINT_IC = debugOpt.newMatcherOption("print-ic",
"Printer internal interpreter code as it is generated.");
"Print internal interpreter code as it is generated.");
def PRINT_ID = debugOpt.newBoolOption("print-id", false,
"Print additional internal IR ids.");
def PRINT_INLINING = debugOpt.newBoolOption("print-inlining", false,
Expand Down Expand Up @@ -113,7 +113,7 @@ component CLOptions {
def TRACE = runOpt.newBoolOption("trace", false,
"Trace execution of interpreter code.");
def SSA_INT = runOpt.newBoolOption("ssa-int", true,
"Use the SsaInterpreter instead of the IC interpreter");
"Use the SsaInterpreter instead of the IC interpreter.");
def TRACE_PARENT = runOpt.newBoolOption("trace-parent", false,
"Trace the parent of function callers during intepretation.");
def TRACE_CALLS = runOpt.newMatcherOption("trace-calls",
Expand Down Expand Up @@ -164,7 +164,7 @@ component CLOptions {
def UNBOX_VARIANT_CASES = compileOpt.newStringOption("unbox-variant-cases", null,
"Unbox all non-recursive variants.");
def REDEF_FIELD = compileOpt.newStringOption("redef-field", null,
"Redefines one or more program fields, setting them to the given value.");
"Redefine one or more program fields, setting them to the given values.");
// JVM target options
def JVM_RT_PATH = jvmOpt.newStringOption("jvm.rt-path", null,
"Specify the path to the Java runtime.");
Expand Down
1 change: 1 addition & 0 deletions aeneas/src/main/Debug.v3
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

component Debug {
def PARANOID = false;
def UNSTABLE = true;
}
2 changes: 1 addition & 1 deletion aeneas/src/main/Version.v3
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

// Updated by VCS scripts. DO NOT EDIT.
component Version {
def version: string = "III-7.1758";
def version: string = "III-7.1759";
var buildData: string;
}
6 changes: 3 additions & 3 deletions aeneas/src/vst/Parser.v3
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ component Parser {
if (pt != null) rettype = ReturnType.This(Token.new(p.fileName, str, loc.0, loc.1));
else rettype = ReturnType.Explicit(Parser.parseTypeRef(p));
body = if(p.curByte == ';', EmptyStmt.new(p.token(1)), Parser.parseBlockStmt(p));
} else if ((start = p.optN("=>")) >= 0) {
} else if ((start = p.optN("=>")) >= 0) { // TODO: add option to enable simple function bodies
var expr = parseExpr(p);
rettype = ReturnType.Implicit(expr);
if (isDef) p.req1(';');
Expand Down Expand Up @@ -847,11 +847,11 @@ component Parser {
}
return parseVarExpr(p);
}
if (p.enableFunExprs && ch == 'f') {
if (Debug.UNSTABLE && p.enableFunExprs && ch == 'f') {
var start = optKeyword(p, "fun");
if (start != null) {
var id = if(Char.isIdentStart(p.curByte), parseIdentVoid(p).name);
var params = parseMethodParams(p);
var params = parseMethodParams(p); // TODO: make parameters optional
var t = parseReturnTypeAndBody(p, false);
return FunExpr.new(start, id, params, t.0, t.1);
}
Expand Down

0 comments on commit b3558b2

Please sign in to comment.