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

fix maps; use maps for storing functions; verify struct initialization

This commit is contained in:
Alexander Medvednikov
2019-06-30 22:44:15 +02:00
parent 8e6cb1e1c2
commit 5936ab16c8
7 changed files with 222 additions and 199 deletions

View File

@ -151,10 +151,9 @@ fn (g mut CGen) register_thread_fn(wrapper_name, wrapper_text, struct_text strin
fn (c mut V) prof_counters() string {
mut res := []string
// Global fns
for f in c.table.fns {
res << 'double ${c.table.cgen_name(f)}_time;'
// println(f.name)
}
//for f in c.table.fns {
//res << 'double ${c.table.cgen_name(f)}_time;'
//}
// Methods
for typ in c.table.types {
// println('')
@ -170,11 +169,10 @@ fn (c mut V) prof_counters() string {
fn (p mut Parser) print_prof_counters() string {
mut res := []string
// Global fns
for f in p.table.fns {
counter := '${p.table.cgen_name(f)}_time'
res << 'if ($counter) printf("%%f : $f.name \\n", $counter);'
// println(f.name)
}
//for f in p.table.fns {
//counter := '${p.table.cgen_name(f)}_time'
//res << 'if ($counter) printf("%%f : $f.name \\n", $counter);'
//}
// Methods
for typ in p.table.types {
// println('')