[llvm-commits] CVS: llvm/tools/lli/Interpreter/Execution.cpp ExecutionAnnotations.h Interpreter.h
Brian Gaeke
gaeke at cs.uiuc.edu
Thu Sep 4 18:16:02 PDT 2003
Changes in directory llvm/tools/lli/Interpreter:
Execution.cpp updated: 1.92 -> 1.93
ExecutionAnnotations.h updated: 1.10 -> 1.11
Interpreter.h updated: 1.35 -> 1.36
---
Log message:
Remove support for breakpoints (not used).
Remove some dead code and whitespace.
---
Diffs of the changes:
Index: llvm/tools/lli/Interpreter/Execution.cpp
diff -u llvm/tools/lli/Interpreter/Execution.cpp:1.92 llvm/tools/lli/Interpreter/Execution.cpp:1.93
--- llvm/tools/lli/Interpreter/Execution.cpp:1.92 Thu Sep 4 17:21:24 2003
+++ llvm/tools/lli/Interpreter/Execution.cpp Thu Sep 4 18:15:40 2003
@@ -1019,10 +1019,9 @@
StackFrame.VarArgs.assign(ArgVals.begin()+i, ArgVals.end());
}
-// executeInstruction - Interpret a single instruction, increment the "PC", and
-// return true if the next instruction is a breakpoint...
+// executeInstruction - Interpret a single instruction & increment the "PC".
//
-bool Interpreter::executeInstruction() {
+void Interpreter::executeInstruction() {
assert(!ECStack.empty() && "No program running, cannot execute inst!");
ExecutionContext &SF = ECStack.back(); // Current stack frame
@@ -1037,11 +1036,8 @@
// instruction execution...
//
if (int SigNo = sigsetjmp(SignalRecoverBuffer, 1)) {
- --SF.CurInst; // Back up to erroring instruction
std::cout << "EXCEPTION OCCURRED [" << strsignal(SigNo) << "]\n";
exit(1);
- InInstruction = false;
- return true;
}
InInstruction = true;
@@ -1050,11 +1046,6 @@
// Reset the current frame location to the top of stack
CurFrame = ECStack.size()-1;
-
- if (CurFrame == -1) return false; // No breakpoint if no code
-
- // Return true if there is a breakpoint annotation on the instruction...
- return ECStack[CurFrame].CurInst->getAnnotation(BreakpointAID) != 0;
}
void Interpreter::stepInstruction() { // Do the 'step' command
@@ -1082,12 +1073,7 @@
if (ECStack.back().CurInst->getOpcode() == Instruction::Call) {
unsigned StackSize = ECStack.size();
// Step into the function...
- if (executeInstruction()) {
- // Hit a breakpoint, print current instruction, then return to user...
- std::cout << "Breakpoint hit!\n";
- printCurrentInstruction();
- return;
- }
+ executeInstruction();
// If we we able to step into the function, finish it now. We might not be
// able the step into a function, if it's external for example.
@@ -1108,15 +1094,11 @@
return;
}
- bool HitBreakpoint = false;
- while (!ECStack.empty() && !HitBreakpoint) {
+ while (!ECStack.empty()) {
// Run an instruction...
- HitBreakpoint = executeInstruction();
+ executeInstruction();
}
- if (HitBreakpoint)
- std::cout << "Breakpoint hit!\n";
-
// Print the next instruction to execute...
printCurrentInstruction();
}
@@ -1128,20 +1110,14 @@
}
unsigned StackSize = ECStack.size();
- bool HitBreakpoint = false;
- while (ECStack.size() >= StackSize && !HitBreakpoint) {
+ while (ECStack.size() >= StackSize) {
// Run an instruction...
- HitBreakpoint = executeInstruction();
+ executeInstruction();
}
- if (HitBreakpoint)
- std::cout << "Breakpoint hit!\n";
-
// Print the next instruction to execute...
printCurrentInstruction();
}
-
-
// printCurrentInstruction - Print out the instruction that the virtual PC is
// at, or fail silently if no program is running.
Index: llvm/tools/lli/Interpreter/ExecutionAnnotations.h
diff -u llvm/tools/lli/Interpreter/ExecutionAnnotations.h:1.10 llvm/tools/lli/Interpreter/ExecutionAnnotations.h:1.11
--- llvm/tools/lli/Interpreter/ExecutionAnnotations.h:1.10 Thu May 8 11:18:31 2003
+++ llvm/tools/lli/Interpreter/ExecutionAnnotations.h Thu Sep 4 18:15:40 2003
@@ -37,7 +37,6 @@
unsigned getValueSlot(const Value *V);
};
-
//===----------------------------------------------------------------------===//
// Support for the SlotNumber annotation
//===----------------------------------------------------------------------===//
@@ -58,9 +57,6 @@
SlotNum(sn) {}
};
-
-
-
//===----------------------------------------------------------------------===//
// Support for the InstNumber annotation
//===----------------------------------------------------------------------===//
@@ -78,15 +74,5 @@
InstNumber(unsigned in, unsigned sn) : SlotNumber(sn), InstNum(in) {}
};
-
-
-//===----------------------------------------------------------------------===//
-// Support for the Breakpoint annotation
-//===----------------------------------------------------------------------===//
-
-static AnnotationID BreakpointAID(
- AnnotationManager::getID("Interpreter::Breakpoint"));
-// Just use an Annotation directly, Breakpoint is currently just a marker
-
#endif
Index: llvm/tools/lli/Interpreter/Interpreter.h
diff -u llvm/tools/lli/Interpreter/Interpreter.h:1.35 llvm/tools/lli/Interpreter/Interpreter.h:1.36
--- llvm/tools/lli/Interpreter/Interpreter.h:1.35 Thu Sep 4 17:21:24 2003
+++ llvm/tools/lli/Interpreter/Interpreter.h Thu Sep 4 18:15:40 2003
@@ -111,7 +111,6 @@
// User Interation Methods...
bool callFunction(const std::string &Name); // return true on failure
- void setBreakpoint(const std::string &Name);
void infoValue(const std::string &Name);
void print(const std::string &Name);
static void print(const Type *Ty, GenericValue V);
@@ -125,7 +124,7 @@
// Code execution methods...
void callFunction(Function *F, const std::vector<GenericValue> &ArgVals);
- bool executeInstruction(); // Execute one instruction...
+ void executeInstruction(); // Execute one instruction...
void stepInstruction(); // Do the 'step' command
void nextInstruction(); // Do the 'next' command
More information about the llvm-commits
mailing list