diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-09-05 04:46:26 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-09-05 04:46:26 +0000 |
commit | 413ab6655bfe0b1e58d0da6c3f4c3a9833e8a952 (patch) | |
tree | 425b8328fdb502358c6b20cd83f71d844f4860f1 /lib/ExecutionEngine/Interpreter/Execution.cpp | |
parent | 8df956ccf2da851d4cb2887c5e27ae1ae507e6d8 (diff) |
Remove support for interactive (step finish next) instructions.
Remove printCurrentInstruction, printStackFrame and infoValue
(only used interactively) and other unused methods of Interpreter.
Fold UserInput.cpp containing only callMainFunction() into Interpreter.cpp.
Remove unused Profile flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index fc0beeaf7a..6881ff9ed7 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1048,46 +1048,6 @@ void Interpreter::executeInstruction() { CurFrame = ECStack.size()-1; } -void Interpreter::stepInstruction() { // Do the 'step' command - if (ECStack.empty()) { - std::cout << "Error: no program running, cannot step!\n"; - return; - } - - // Run an instruction... - executeInstruction(); - - // Print the next instruction to execute... - printCurrentInstruction(); -} - -// --- UI Stuff... -void Interpreter::nextInstruction() { // Do the 'next' command - if (ECStack.empty()) { - std::cout << "Error: no program running, cannot 'next'!\n"; - return; - } - - // If this is a call instruction, step over the call instruction... - // TODO: ICALL, CALL WITH, ... - if (ECStack.back().CurInst->getOpcode() == Instruction::Call) { - unsigned StackSize = ECStack.size(); - // Step into the function... - 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. - if (ECStack.size() != StackSize) - finish(); // Finish executing the function... - else - printCurrentInstruction(); - - } else { - // Normal instruction, just step... - stepInstruction(); - } -} - void Interpreter::run() { if (ECStack.empty()) { std::cout << "Error: no program running, cannot run!\n"; @@ -1098,40 +1058,6 @@ void Interpreter::run() { // Run an instruction... executeInstruction(); } - - // Print the next instruction to execute... - printCurrentInstruction(); -} - -void Interpreter::finish() { - if (ECStack.empty()) { - std::cout << "Error: no program running, cannot run!\n"; - return; - } - - unsigned StackSize = ECStack.size(); - while (ECStack.size() >= StackSize) { - // Run an instruction... - executeInstruction(); - } - - // 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. -// -void Interpreter::printCurrentInstruction() { - if (!ECStack.empty()) { - if (ECStack.back().CurBB->begin() == ECStack.back().CurInst) // print label - WriteAsOperand(std::cout, ECStack.back().CurBB) << ":\n"; - - Instruction &I = *ECStack.back().CurInst; - InstNumber *IN = (InstNumber*)I.getAnnotation(SlotNumberAID); - assert(IN && "Instruction has no numbering annotation!"); - std::cout << "#" << IN->InstNum << I; - } } void Interpreter::printValue(const Type *Ty, GenericValue V) { @@ -1177,44 +1103,3 @@ void Interpreter::print(const std::string &Name) { std::cout << "\n"; } } - -void Interpreter::infoValue(const std::string &Name) { - Value *PickedVal = ChooseOneOption(Name, LookupMatchingNames(Name)); - if (!PickedVal) return; - - std::cout << "Value: "; - print(PickedVal->getType(), - getOperandValue(PickedVal, ECStack[CurFrame])); - std::cout << "\n"; - printOperandInfo(PickedVal, ECStack[CurFrame]); -} - -// printStackFrame - Print information about the specified stack frame, or -1 -// for the default one. -// -void Interpreter::printStackFrame(int FrameNo) { - if (FrameNo == -1) FrameNo = CurFrame; - Function *F = ECStack[FrameNo].CurFunction; - const Type *RetTy = F->getReturnType(); - - CW << ((FrameNo == CurFrame) ? '>' : '-') << "#" << FrameNo << ". " - << (Value*)RetTy << " \"" << F->getName() << "\"("; - - unsigned i = 0; - for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I, ++i) { - if (i != 0) std::cout << ", "; - CW << *I << "="; - - printValue(I->getType(), getOperandValue(I, ECStack[FrameNo])); - } - - std::cout << ")\n"; - - if (FrameNo != int(ECStack.size()-1)) { - BasicBlock::iterator I = ECStack[FrameNo].CurInst; - CW << --I; - } else { - CW << *ECStack[FrameNo].CurInst; - } -} - |