1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: parallelize (#10844)

This commit is contained in:
crthpl
2021-09-28 00:28:04 -07:00
committed by GitHub
parent a17b943e87
commit 85b58b03a3
43 changed files with 1003 additions and 580 deletions

View File

@@ -21,11 +21,13 @@ fn main() {
println('fast.html generator needs to be located in `v/cmd/tools/fast`')
}
println('fast.html generator\n')
println('Fetching updates...')
ret := os.system('$vdir/v up')
if ret != 0 {
println('failed to update V')
return
if !os.args.contains('-noupdate') {
println('Fetching updates...')
ret := os.system('$vdir/v up')
if ret != 0 {
println('failed to update V')
return
}
}
// Fetch the last commit's hash
commit := exec('git rev-parse HEAD')[..8]
@@ -55,7 +57,6 @@ fn main() {
} else {
exec('./v -o vprod -prod -prealloc cmd/v')
}
// println('cur vdir="$vdir"')
// cache vlib modules
exec('$vdir/v wipe-cache')
exec('$vdir/v -o v2 -prod cmd/v')

View File

@@ -111,10 +111,10 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
mut command_for_building_v_from_c_source := ''
mut command_for_selfbuilding := ''
if 'windows' == os.user_os() {
command_for_building_v_from_c_source = '$vgit_context.cc -std=c99 -municode -w -o cv.exe "$vgit_context.path_vc/v_win.c" '
command_for_building_v_from_c_source = '$vgit_context.cc -std=c99 -I ./thirdparty/stdatomic/win -municode -w -o cv.exe "$vgit_context.path_vc/v_win.c" '
command_for_selfbuilding = './cv.exe -o $vgit_context.vexename {SOURCE}'
} else {
command_for_building_v_from_c_source = '$vgit_context.cc -std=gnu11 -w -o cv "$vgit_context.path_vc/v.c" -lm -lpthread'
command_for_building_v_from_c_source = '$vgit_context.cc -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o cv "$vgit_context.path_vc/v.c" -lm -lpthread'
command_for_selfbuilding = './cv -o $vgit_context.vexename {SOURCE}'
}
scripting.chdir(vgit_context.workdir)

View File

@@ -8,6 +8,7 @@ import v.parser
import v.ast
import v.pref
import v.errors
import strings
struct Context {
mut:
@@ -208,7 +209,7 @@ fn (t Tree) type_node(typ ast.Type) &Node {
return create_null()
} else {
type_name := t.table.get_type_name(typ)
return create_string(type_name)
return create_string(strings.repeat(`&`, typ.nr_muls()) + type_name)
}
}

View File

@@ -148,7 +148,7 @@ fn get_all_commands() []Command {
}
$if macos || linux {
res << Command{
line: '$vexe -o v.c cmd/v && cc -Werror v.c && rm -rf a.out'
line: '$vexe -o v.c cmd/v && cc -I "$vroot/thirdparty/stdatomic/nix" -lpthread v.c && rm -rf a.out'
label: 'v.c should be buildable with no warnings...'
okmsg: 'v.c can be compiled without warnings. This is good :)'
rmfile: 'v.c'