mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/Statistic.h"
|
||||||
#include <math.h> // For fmod
|
#include <math.h> // For fmod
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
@ -22,6 +23,10 @@ using std::vector;
|
|||||||
using std::cout;
|
using std::cout;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
Statistic<> NumDynamicInsts("lli", "Number of dynamic instructions executed");
|
||||||
|
}
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
QuietMode("quiet", cl::desc("Do not emit any non-program output"));
|
QuietMode("quiet", cl::desc("Do not emit any non-program output"));
|
||||||
|
|
||||||
@ -1251,6 +1256,9 @@ bool Interpreter::executeInstruction() {
|
|||||||
if (Trace)
|
if (Trace)
|
||||||
CW << "Run:" << I;
|
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
|
// Set a sigsetjmp buffer so that we can recover if an error happens during
|
||||||
// instruction execution...
|
// instruction execution...
|
||||||
//
|
//
|
||||||
|
@ -21,10 +21,7 @@ MainFunction ("f", cl::desc("Function to execute"), cl::init("main"),
|
|||||||
cl::value_desc("function name"));
|
cl::value_desc("function name"));
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
DebugMode("debug", cl::desc("Start program in debugger"));
|
DebugMode("d", cl::desc("Start program in debugger"));
|
||||||
|
|
||||||
static cl::alias
|
|
||||||
DebugModeA("d", cl::desc("Alias for -debug"), cl::aliasopt(DebugMode));
|
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
TraceMode("trace", cl::desc("Enable Tracing"));
|
TraceMode("trace", cl::desc("Enable Tracing"));
|
||||||
|
Reference in New Issue
Block a user