diff options
Diffstat (limited to 'func.go')
-rw-r--r-- | func.go | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -447,7 +447,7 @@ func (f *funcWildcard) Eval(w io.Writer, ev *Evaluator) { assertArity("wildcard", 1, len(f.args)) abuf := newBuf() f.args[1].Eval(abuf, ev) - te := traceEvent.begin("wildcard", tmpval(abuf.Bytes())) + te := traceEvent.begin("wildcard", string(abuf.Bytes()), traceEventMain) if ev.avoidIO && !useWildcardCache { ev.hasIO = true w.Write([]byte("$(/bin/ls -d ")) @@ -721,7 +721,7 @@ func (f *funcShell) Eval(w io.Writer, ev *Evaluator) { abuf := newBuf() f.args[1].Eval(abuf, ev) if ev.avoidIO && !hasNoIoInShellScript(abuf.Bytes()) { - te := traceEvent.begin("shell", tmpval(abuf.Bytes())) + te := traceEvent.begin("shell", string(abuf.Bytes()), traceEventMain) ev.hasIO = true w.Write([]byte("$(")) w.Write(abuf.Bytes()) @@ -740,7 +740,7 @@ func (f *funcShell) Eval(w io.Writer, ev *Evaluator) { Args: cmdline, Stderr: os.Stderr, } - te := traceEvent.begin("shell", literal(arg)) + te := traceEvent.begin("shell", arg, traceEventMain) out, err := cmd.Output() shellFuncTime += time.Since(te.t) shellFuncCount++ @@ -784,14 +784,15 @@ func (f *funcCall) Arity() int { return 0 } func (f *funcCall) Eval(w io.Writer, ev *Evaluator) { abuf := newBuf() fargs := ev.args(abuf, f.args[1:]...) - variable := fargs[0] - te := traceEvent.begin("call", tmpval(variable)) + varname := fargs[0] + variable := string(varname) + te := traceEvent.begin("call", variable, traceEventMain) Logf("call %q variable %q", f.args[1], variable) - v := ev.LookupVar(string(variable)) + v := ev.LookupVar(variable) // Evalualte all arguments first before we modify the table. var args []tmpval // $0 is variable. - args = append(args, tmpval(variable)) + args = append(args, tmpval(varname)) // TODO(ukai): If variable is the name of a built-in function, // the built-in function is always invoked (even if a make variable // by that name also exists). |