aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-09-04 22:21:24 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-09-04 22:21:24 +0000
commitf58815e161c8c91075dd1af7a277314190ebc286 (patch)
tree7c79f34768f6a53fa55d67346e68fdd04b255a5a /lib/ExecutionEngine/Interpreter/Execution.cpp
parent82d8277ad5862b54341808812bb4016e52347060 (diff)
Interpreter cleanups:
Get rid of support for DebugMode (make it always off). Mung some comments. Get rid of interpreter's PROFILE_STRUCTURE_FIELDS and PerformExitStuff which have been disabled forever. Get rid of -abort-on-exception (make it always on). Get rid of user interaction stuff (debug mode innards). Simplify Interpreter's callMainFunction(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp81
1 files changed, 2 insertions, 79 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 84486c21ee..79c404aae0 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -31,10 +31,6 @@ namespace {
cl::opt<bool>
ArrayChecksEnabled("array-checks", cl::desc("Enable array bound checks"));
-
- cl::opt<bool>
- AbortOnExceptions("abort-on-exception",
- cl::desc("Halt execution on a machine exception"));
}
// Create a TargetData structure to handle memory addressing and size/alignment
@@ -42,14 +38,6 @@ namespace {
//
CachedWriter CW; // Object to accelerate printing of LLVM
-#ifdef PROFILE_STRUCTURE_FIELDS
-static cl::opt<bool>
-ProfileStructureFields("profilestructfields",
- cl::desc("Profile Structure Field Accesses"));
-#include <map>
-static std::map<const StructType *, std::vector<unsigned> > FieldAccessCounts;
-#endif
-
sigjmp_buf SignalRecoverBuffer;
static bool InInstruction = false;
@@ -520,54 +508,6 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) {
// Terminator Instruction Implementations
//===----------------------------------------------------------------------===//
-// PerformExitStuff - Print out counters and profiling information if
-// applicable...
-void Interpreter::PerformExitStuff() {
-#ifdef PROFILE_STRUCTURE_FIELDS
- // Print out structure field accounting information...
- if (!FieldAccessCounts.empty()) {
- CW << "Profile Field Access Counts:\n";
- std::map<const StructType *, std::vector<unsigned> >::iterator
- I = FieldAccessCounts.begin(), E = FieldAccessCounts.end();
- for (; I != E; ++I) {
- std::vector<unsigned> &OfC = I->second;
- CW << " '" << (Value*)I->first << "'\t- Sum=";
-
- unsigned Sum = 0;
- for (unsigned i = 0; i < OfC.size(); ++i)
- Sum += OfC[i];
- CW << Sum << " - ";
-
- for (unsigned i = 0; i < OfC.size(); ++i) {
- if (i) CW << ", ";
- CW << OfC[i];
- }
- CW << "\n";
- }
- CW << "\n";
-
- CW << "Profile Field Access Percentages:\n";
- std::cout.precision(3);
- for (I = FieldAccessCounts.begin(); I != E; ++I) {
- std::vector<unsigned> &OfC = I->second;
- unsigned Sum = 0;
- for (unsigned i = 0; i < OfC.size(); ++i)
- Sum += OfC[i];
-
- CW << " '" << (Value*)I->first << "'\t- ";
- for (unsigned i = 0; i < OfC.size(); ++i) {
- if (i) CW << ", ";
- CW << double(OfC[i])/Sum;
- }
- CW << "\n";
- }
- CW << "\n";
-
- FieldAccessCounts.clear();
- }
-#endif
-}
-
void Interpreter::exitCalled(GenericValue GV) {
if (!QuietMode) {
std::cout << "Program returned ";
@@ -756,15 +696,6 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, User::op_iterator I,
assert(CPU->getType() == Type::UByteTy);
unsigned Index = CPU->getValue();
-#ifdef PROFILE_STRUCTURE_FIELDS
- if (ProfileStructureFields) {
- // Do accounting for this field...
- std::vector<unsigned> &OfC = FieldAccessCounts[STy];
- if (OfC.size() == 0) OfC.resize(STy->getElementTypes().size());
- OfC[Index]++;
- }
-#endif
-
Total += SLO->MemberOffsets[Index];
Ty = STy->getElementTypes()[Index];
} else if (const SequentialType *ST = cast<SequentialType>(Ty)) {
@@ -1107,16 +1038,8 @@ bool Interpreter::executeInstruction() {
//
if (int SigNo = sigsetjmp(SignalRecoverBuffer, 1)) {
--SF.CurInst; // Back up to erroring instruction
- if (SigNo != SIGINT) {
- std::cout << "EXCEPTION OCCURRED [" << strsignal(SigNo) << "]:\n";
- printStackTrace();
- // If -abort-on-exception was specified, terminate LLI instead of trying
- // to debug it.
- //
- if (AbortOnExceptions) exit(1);
- } else if (SigNo == SIGINT) {
- std::cout << "CTRL-C Detected, execution halted.\n";
- }
+ std::cout << "EXCEPTION OCCURRED [" << strsignal(SigNo) << "]\n";
+ exit(1);
InInstruction = false;
return true;
}