aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-08-29 16:11:38 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-08-29 16:11:38 +0200
commitebc4dae51761cb54c1db28cf4d328d3f2f55b758 (patch)
treed26b66aefee3e1fe5d798e178ab0b577e2dfe088 /src/libexpr/eval.cc
parent662db921e2f5bebeb0fd455aa744708468df8bfa (diff)
parent84de8210040580ce7189332b43038d52c56a9689 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 46c622ee8..faa76f1f7 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -10,6 +10,7 @@
#include "flake/flake.hh"
#include <algorithm>
+#include <chrono>
#include <cstring>
#include <unistd.h>
#include <sys/time.h>
@@ -17,7 +18,6 @@
#include <iostream>
#include <fstream>
-#include <sys/time.h>
#include <sys/resource.h>
#if HAVE_BOEHMGC
@@ -1103,9 +1103,13 @@ void EvalState::callPrimOp(Value & fun, Value & arg, Value & v, const Pos & pos)
}
}
-
void EvalState::callFunction(Value & fun, Value & arg, Value & v, const Pos & pos)
{
+ std::optional<FunctionCallTrace> trace;
+ if (evalSettings.traceFunctionCalls) {
+ trace.emplace(pos);
+ }
+
forceValue(fun, pos);
if (fun.type == tPrimOp || fun.type == tPrimOpApp) {