about summary refs log tree commit diff
path: root/src/fix-ng/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-09T10·35+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-09T10·35+0000
commit15801c88fad38253b19ac2ea77e7597deab5fd6b (patch)
tree2dab8ab76792328b6c5376509d6b2e659ad19cf8 /src/fix-ng/eval.cc
parentd2e3a132fe6796b2ac038ccb20e7aa32afc1a85f (diff)
* Turned the msg() and debug() functions into macros, since they
  turned out to be a huge performance bottleneck (the text to printed
  would always be evaluated, even when it was above the verbosity
  level).  This reduces fix-ng execution time by over 50%.

  gprof(1) is very useful. :-)

Diffstat (limited to 'src/fix-ng/eval.cc')
-rw-r--r--src/fix-ng/eval.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fix-ng/eval.cc b/src/fix-ng/eval.cc
index 8e10caa843..2b45b47984 100644
--- a/src/fix-ng/eval.cc
+++ b/src/fix-ng/eval.cc
@@ -23,7 +23,6 @@ static Expr substArgs(Expr body, ATermList formals, Expr arg)
     while (!ATisEmpty(formals)) {
         ATerm t = ATgetFirst(formals);
         Expr name, def;
-        debug(printTerm(t));
         if (ATmatch(t, "NoDefFormal(<term>)", &name))
             subs.set(name, undefined);
         else if (ATmatch(t, "DefFormal(<term>, <term>)", &name, &def))
@@ -234,7 +233,8 @@ Expr evalExpr2(EvalState & state, Expr e)
 
 Expr evalExpr(EvalState & state, Expr e)
 {
-    Nest nest(lvlVomit, format("evaluating expression: %1%") % printTerm(e));
+    startNest(nest, lvlVomit,
+        format("evaluating expression: %1%") % printTerm(e));
 
     state.nrEvaluated++;
 
@@ -258,7 +258,7 @@ Expr evalExpr(EvalState & state, Expr e)
 
 Expr evalFile(EvalState & state, const Path & path)
 {
-    Nest nest(lvlTalkative, format("evaluating file `%1%'") % path);
+    startNest(nest, lvlTalkative, format("evaluating file `%1%'") % path);
     Expr e = parseExprFromFile(path);
     return evalExpr(state, e);
 }