Skip to content

Commit 9754c57

Browse files
committed
v3: address fastc scoped lowering reviews
1 parent 07cc173 commit 9754c57

4 files changed

Lines changed: 403 additions & 86 deletions

File tree

vlib/v3/fastcdriver/fastcdriver.v

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,29 @@ fn parse_arguments(args []string) (string, string, bool) {
2222
fail('fastc: missing value after `${arg}`')
2323
}
2424
value := args[index + 1]
25-
if arg == '-o' {
26-
output = value
27-
} else if arg == '-b' && value != 'fastc' {
28-
fail('fastc self-host compiler only supports `-b fastc`')
25+
match arg {
26+
'-o' {
27+
output = value
28+
}
29+
'-b' {
30+
if value != 'fastc' {
31+
fail('fastc self-host compiler only supports `-b fastc`')
32+
}
33+
}
34+
'-gc' {
35+
if value != 'none' {
36+
fail('fastc self-host compiler only supports `-gc none`')
37+
}
38+
}
39+
'-cc' {
40+
if value !in ['tinyc', 'tcc'] {
41+
fail('fastc self-host compiler only supports bundled TinyCC')
42+
}
43+
}
44+
'-d' {
45+
fail('fastc self-host compiler does not support custom `-d ${value}` defines')
46+
}
47+
else {}
2948
}
3049
index += 2
3150
continue

0 commit comments

Comments
 (0)