summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-08 05:51:08 +0000
committerChris Lattner <sabre@nondot.org>2002-12-08 05:51:08 +0000
commit4f96aa450e8647abe4df2f9aab3de719e6933db3 (patch)
tree80516680d9e8b66144e3740f6012f8f0543be749
parent3935d2b1ec200de9f55bb93e65638c1f98696477 (diff)
downloadbcm5719-llvm-4f96aa450e8647abe4df2f9aab3de719e6933db3.tar.gz
bcm5719-llvm-4f96aa450e8647abe4df2f9aab3de719e6933db3.zip
Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp8
-rw-r--r--llvm/tools/lli/lli.cpp5
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index d11ed6e5218..3d6cf0bfb9c 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -15,6 +15,7 @@
#include "llvm/Assembly/Writer.h"
#include "llvm/Target/TargetData.h"
#include "Support/CommandLine.h"
+#include "Support/Statistic.h"
#include <math.h> // For fmod
#include <signal.h>
#include <setjmp.h>
@@ -22,6 +23,10 @@ using std::vector;
using std::cout;
using std::cerr;
+namespace {
+ Statistic<> NumDynamicInsts("lli", "Number of dynamic instructions executed");
+}
+
static cl::opt<bool>
QuietMode("quiet", cl::desc("Do not emit any non-program output"));
@@ -1251,6 +1256,9 @@ bool Interpreter::executeInstruction() {
if (Trace)
CW << "Run:" << I;
+ // Track the number of dynamic instructions executed.
+ ++NumDynamicInsts;
+
// Set a sigsetjmp buffer so that we can recover if an error happens during
// instruction execution...
//
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 76e1eb19771..3f718e599e8 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -21,10 +21,7 @@ MainFunction ("f", cl::desc("Function to execute"), cl::init("main"),
cl::value_desc("function name"));
static cl::opt<bool>
-DebugMode("debug", cl::desc("Start program in debugger"));
-
-static cl::alias
-DebugModeA("d", cl::desc("Alias for -debug"), cl::aliasopt(DebugMode));
+DebugMode("d", cl::desc("Start program in debugger"));
static cl::opt<bool>
TraceMode("trace", cl::desc("Enable Tracing"));
OpenPOWER on IntegriCloud