diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-08 05:51:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-08 05:51:08 +0000 |
commit | bbdabce1e97f77d383def3f06a51c4fc75d114cf (patch) | |
tree | a5c440618c3fa6f8ea9931d8631943e9eac2d529 /lib/ExecutionEngine/Interpreter/Execution.cpp | |
parent | a1af8bd72b783108ad950e22ba98a402a773111a (diff) |
Add support to count the number of dynamic instructions executed by LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index d11ed6e521..3d6cf0bfb9 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/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... // |