Skip to content

Commit 628f1d6

Browse files
authored
Merge pull request #2004 from andrew-johnson-4/start-enabling-gc-dfsdssl
Start enabling gc dfsdssl
2 parents bf3e99f + ea6e3fb commit 628f1d6

7 files changed

Lines changed: 3391 additions & 3368 deletions

File tree

BOOTSTRAP/cli.c

Lines changed: 3357 additions & 3357 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LSTSFLAGS = MALLOC_CHECK_=3
88
# recommendation: ulimit -s unlimited
99

1010
dev: install-production
11-
lm --v23 tests/promises/typechecking/nil-never-variables.lsts
11+
lm tests/promises/typechecking/must-use-reject-2.lsts
1212
$(CC) $(CFLAGS) tmp.c
1313
./a.out
1414

PLUGINS/FRONTEND/LSTS/lsts-parse.lsts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
371371
head(args);
372372
} else if base==c"CompatOwnedData" and args.length==1 {
373373
t1(c"OwnedData",head(args));
374-
} else if base==c"CompatMustRetain" and args.length==0 {
375-
t0(c"MustRetain");
376-
} else if base==c"CompatMustRelease" and args.length==0 {
377-
t0(c"MustRelease");
378374
} else TGround ( base, close(args) );
379375
};
380376
while lsts-parse-head(tokens) == c"[" or lsts-parse-head(tokens)==c"?" {
@@ -936,12 +932,16 @@ let lsts-parse-typedef(tokens: List<Token>): (AST, List<Token>) = (
936932
if lsts-parse-head(tokens)==c"implies" {
937933
lsts-parse-expect(c"implies", tokens); tokens = tail(tokens);
938934
(let i, tokens) = lsts-parse-type(tokens);
939-
if not(config-v3) and (i.is-t(c"MustRetain",0) or i.is-t(c"MustRelease",0)) then ()
935+
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
936+
else if config-v23 and i.is-t(c"MustRelease",0) then ()
937+
else if config-v23 and i.is-t(c"MustRetain",0) then ()
940938
else infers = infers.push(i);
941939
while lsts-parse-head(tokens)==c"," {
942940
lsts-parse-expect(c",", tokens); tokens = tail(tokens);
943941
(i, tokens) = lsts-parse-type(tokens);
944-
if not(config-v3) and (i.is-t(c"MustRetain",0) or i.is-t(c"MustRelease",0)) then ()
942+
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
943+
else if config-v23 and i.is-t(c"MustRelease",0) then ()
944+
else if config-v23 and i.is-t(c"MustRetain",0) then ()
945945
else infers = infers.push(i);
946946
}
947947
};

SRC/typecheck-infer-expr.lsts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,14 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
387387
);
388388
_ => fail("Unexpected Term in std-infer-expr at \{term.location}\n\{term}\n");
389389
};
390-
if used.is-unused and typeof-term(term).slot(c"Phi::State",1).is-linear-live {
390+
if used.is-unused and typeof-term(term).is-t(c"MustUse",0) then exit-error("MustUse term value must be used", term);
391+
else if used.is-unused and typeof-term(term).slot(c"Phi::State",1).is-linear-live {
391392
if typeof-term(term).slot(c"Phi::State",1).l1.is-t(c"MustRelease::ToRelease",1) {
392393
(tctx, term) = wrap-call(tctx, c".release", term);
393394
} else if typeof-term(term).is-t(c"MustRetain",0) {
394395
tctx = tctx.phi-move(typeof-term(term),term);
395396
}
396397
}};
397-
if used.is-unused and typeof-term(term).is-t(c"MustUse",0) then exit-error("MustUse term value must be used", term);
398398
(tctx, term);
399399
);
400400

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
import lib/core/bedrock.lsts;
3+
4+
let f() = (
5+
let x = ("a", "b");
6+
let y = [] : List<String>;
7+
if non-zero(x.first) then g(y, "c");
8+
);
9+
10+
let g(x: List<String>, y: String) = ();
11+
12+

tests/promises/typechecking/linear-in-if-1.lsts.skip

Whitespace-only changes.

tests/regress.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ fn compile_bootstrap() {
3030
};
3131
}
3232

33-
fn run_bootstrap(target: &str, leave_tmp: bool, is_v23: bool) -> String {
33+
fn run_bootstrap(target: &str, leave_tmp: bool, is_v3: bool) -> String {
3434
if !leave_tmp { rm("tmp.c"); };
3535
rm("a.out");
3636

37-
let exit = if is_v23 {
37+
let exit = if is_v3 && target.contains("lm-") {
3838
Command::new("./bootstrap.exe")
3939
.stdout(std::process::Stdio::piped())
4040
.stderr(std::process::Stdio::piped())
@@ -46,6 +46,17 @@ fn run_bootstrap(target: &str, leave_tmp: bool, is_v23: bool) -> String {
4646
.expect("failed to execute process")
4747
.wait_with_output()
4848
.expect("failed to wait for process")
49+
} else if is_v3 {
50+
Command::new("./bootstrap.exe")
51+
.stdout(std::process::Stdio::piped())
52+
.stderr(std::process::Stdio::piped())
53+
.arg("-o")
54+
.arg("tmp.c")
55+
.arg(target)
56+
.spawn()
57+
.expect("failed to execute process")
58+
.wait_with_output()
59+
.expect("failed to wait for process")
4960
} else {
5061
Command::new("./bootstrap.exe")
5162
.stdout(std::process::Stdio::piped())

0 commit comments

Comments
 (0)