mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix slow compilation of vtl/nn/examples/mnist.v (reduce RAM usage)
This commit is contained in:
@@ -358,10 +358,16 @@ fn (mut c Checker) fn_decl(mut node ast.FnDecl) {
|
|||||||
}
|
}
|
||||||
node.source_file = c.file
|
node.source_file = c.file
|
||||||
|
|
||||||
if c.table.known_fn(node.name) && node.name != 'main.main' {
|
if node.name in c.table.fns && node.name != 'main.main' {
|
||||||
mut dep_names := []string{}
|
mut dep_names := []string{}
|
||||||
for stmt in node.stmts {
|
for stmt in node.stmts {
|
||||||
dep_names << c.table.dependent_names_in_stmt(stmt)
|
dnames := c.table.dependent_names_in_stmt(stmt)
|
||||||
|
for dname in dnames {
|
||||||
|
if dname in dep_names {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
dep_names << dname
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if dep_names.len > 0 {
|
if dep_names.len > 0 {
|
||||||
c.table.fns[node.name].dep_names = dep_names
|
c.table.fns[node.name].dep_names = dep_names
|
||||||
|
|||||||
Reference in New Issue
Block a user