about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-02T18·29+0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-02T18·29+0000
commit46ffcce0c355ee16075b4ba216bc0aea054143aa (patch)
treee061b76819212fb465a0fcc17ef5fa79c5e03a92 /src/libexpr/eval.cc
parent8e74c0bfd1b61b175f04a7e0a8f0a3d9db809f1a (diff)
In the profiler output, show function names (if available)
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 766440fc67..b1100a6623 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -788,7 +788,7 @@ void EvalState::callFunction(Value & fun, Value & arg, Value & v)
     }
 
     nrFunctionCalls++;
-    if (countCalls) functionCalls[fun.lambda.fun->pos]++;
+    if (countCalls) functionCalls[fun.lambda.fun]++;
 
     try {
         fun.lambda.fun->body->eval(*this, env2, v);
@@ -1283,23 +1283,23 @@ void EvalState::printStats()
 
         printMsg(v, format("calls to %1% primops:") % primOpCalls.size());
         typedef std::multimap<unsigned int, Symbol> PrimOpCalls_;
-        std::multimap<unsigned int, Symbol> primOpCalls_;
+        PrimOpCalls_ primOpCalls_;
         foreach (PrimOpCalls::iterator, i, primOpCalls)
             primOpCalls_.insert(std::pair<unsigned int, Symbol>(i->second, i->first));
         foreach_reverse (PrimOpCalls_::reverse_iterator, i, primOpCalls_)
             printMsg(v, format("%1$10d %2%") % i->first % i->second);
 
         printMsg(v, format("calls to %1% functions:") % functionCalls.size());
-        typedef std::multimap<unsigned int, Pos> FunctionCalls_;
-        std::multimap<unsigned int, Pos> functionCalls_;
+        typedef std::multimap<unsigned int, ExprLambda *> FunctionCalls_;
+        FunctionCalls_ functionCalls_;
         foreach (FunctionCalls::iterator, i, functionCalls)
-            functionCalls_.insert(std::pair<unsigned int, Pos>(i->second, i->first));
+            functionCalls_.insert(std::pair<unsigned int, ExprLambda *>(i->second, i->first));
         foreach_reverse (FunctionCalls_::reverse_iterator, i, functionCalls_)
-            printMsg(v, format("%1$10d %2%") % i->first % i->second);
+            printMsg(v, format("%1$10d %2%") % i->first % i->second->showNamePos());
 
         printMsg(v, format("evaluations of %1% attributes:") % attrSelects.size());
         typedef std::multimap<unsigned int, Pos> AttrSelects_;
-        std::multimap<unsigned int, Pos> attrSelects_;
+        AttrSelects_ attrSelects_;
         foreach (AttrSelects::iterator, i, attrSelects)
             attrSelects_.insert(std::pair<unsigned int, Pos>(i->second, i->first));
         foreach_reverse (AttrSelects_::reverse_iterator, i, attrSelects_)