Skip to content

Commit

Permalink
cli, compile: support -no-bounds-checking v flag (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon authored Sep 15, 2024
1 parent 8b5c5c0 commit 5295b1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/compile.v
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn compile_v_to_c(opt CompileOptions) !VMetaInfo {
// Boehm-Demers-Weiser Garbage Collector (bdwgc / libgc)
uses_gc := opt.uses_gc()
if opt.verbosity > 1 {
println('Garbage collecting is ${uses_gc}')
println('Garbage collection is ${uses_gc}')
}

vexe := vxt.vexe()
Expand Down
6 changes: 4 additions & 2 deletions cli/cli.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Compile, package and deploy graphical V apps for Android.
The following flags does the same as if they were passed to the "v" compiler:
-autofree, -gc <type>, -g, -cg, -prod, -showcc, -skip-unused
-autofree, -gc <type>, -g, -cg, -prod, -showcc,
-skip-unused, -no-bounds-checking
Sub-commands:
doctor Display useful info about your system,
Expand All @@ -31,7 +32,8 @@ Sub-commands:
pub const exe_git_hash = vab_commit_hash()
pub const work_directory = vab_tmp_work_dir()
pub const cache_directory = vab_cache_dir()
pub const rip_vflags = ['-autofree', '-gc', '-g', '-cg', '-prod', 'run', '-showcc', '-skip-unused'] // NOTE this can be removed when the deprecated `cli.args_to_options()` is removed
pub const rip_vflags = ['-autofree', '-gc', '-g', '-cg', '-prod', 'run', '-showcc', '-skip-unused',
'-no-bounds-checking'] // NOTE this can be removed when the deprecated `cli.args_to_options()` is removed
pub const subcmds = ['complete', 'test-cleancode']
pub const subcmds_builtin = ['doctor', 'install']
pub const accepted_input_files = ['.v', '.apk', '.aab']
Expand Down
18 changes: 11 additions & 7 deletions cli/options.v
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ mut:

struct SupportedVFlags {
pub:
autofree bool
gc string
v_debug bool @[long: g]
c_debug bool @[long: cg]
prod bool
showcc bool
skip_unused bool
autofree bool
gc string
v_debug bool @[long: g]
c_debug bool @[long: cg]
prod bool
showcc bool
skip_unused bool
no_bounds_checking bool
}

fn (svf &SupportedVFlags) as_flags() []string {
Expand All @@ -111,6 +112,9 @@ fn (svf &SupportedVFlags) as_flags() []string {
if svf.skip_unused {
v_flags << '-skip-unused'
}
if svf.no_bounds_checking {
v_flags << '-no-bounds-checking'
}
return v_flags
}

Expand Down

0 comments on commit 5295b1c

Please sign in to comment.