summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-09-05 05:04:32 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-09-05 05:04:32 +0000
commit932539a941dff605bdced24c56ea10a01fc113e8 (patch)
tree95e6dfb3c649a469cd14c5c97438cf469e733f38 /lib/ExecutionEngine
parent413ab6655bfe0b1e58d0da6c3f4c3a9833e8a952 (diff)
downloadllvm-932539a941dff605bdced24c56ea10a01fc113e8.tar.gz
llvm-932539a941dff605bdced24c56ea10a01fc113e8.tar.bz2
llvm-932539a941dff605bdced24c56ea10a01fc113e8.tar.xz
Remove support for printing values from a module by name, only used
w/ interactive keyboard entry of names. With that, Support.cpp is history. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp17
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.h15
-rw-r--r--lib/ExecutionEngine/Interpreter/Support.cpp77
3 files changed, 0 insertions, 109 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 6881ff9ed7..800a62cc8d 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1086,20 +1086,3 @@ void Interpreter::print(const Type *Ty, GenericValue V) {
CW << Ty << " ";
printValue(Ty, V);
}
-
-void Interpreter::print(const std::string &Name) {
- Value *PickedVal = ChooseOneOption(Name, LookupMatchingNames(Name));
- if (!PickedVal) return;
-
- if (const Function *F = dyn_cast<Function>(PickedVal)) {
- CW << F; // Print the function
- } else if (const Type *Ty = dyn_cast<Type>(PickedVal)) {
- CW << "type %" << Name << " = " << Ty->getDescription() << "\n";
- } else if (const BasicBlock *BB = dyn_cast<BasicBlock>(PickedVal)) {
- CW << BB; // Print the basic block
- } else { // Otherwise there should be an annotation for the slot#
- print(PickedVal->getType(),
- getOperandValue(PickedVal, ECStack[CurFrame]));
- std::cout << "\n";
- }
-}
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h
index 9ea2bb1f6d..5434fe0b81 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -103,7 +103,6 @@ public:
// User Interation Methods...
bool callFunction(const std::string &Name); // return true on failure
- void print(const std::string &Name);
static void print(const Type *Ty, GenericValue V);
static void printValue(const Type *Ty, GenericValue V);
@@ -181,20 +180,6 @@ private: // Helper functions
//
void printCurrentInstruction();
- // LookupMatchingNames - Search the current function namespace, then the
- // global namespace looking for values that match the specified name. Return
- // ALL matches to that name. This is obviously slow, and should only be used
- // for user interaction.
- //
- std::vector<Value*> LookupMatchingNames(const std::string &Name);
-
- // ChooseOneOption - Prompt the user to choose among the specified options to
- // pick one value. If no options are provided, emit an error. If a single
- // option is provided, just return that option.
- //
- Value *ChooseOneOption(const std::string &Name,
- const std::vector<Value*> &Opts);
-
void initializeExecutionEngine();
void initializeExternalFunctions();
};
diff --git a/lib/ExecutionEngine/Interpreter/Support.cpp b/lib/ExecutionEngine/Interpreter/Support.cpp
deleted file mode 100644
index d857b664f9..0000000000
--- a/lib/ExecutionEngine/Interpreter/Support.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-//===-- Support.cpp - Support routines for interpreter --------------------===//
-//
-// This file contains support routines for the interpreter core.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Interpreter.h"
-#include "llvm/SymbolTable.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Module.h"
-
-//===----------------------------------------------------------------------===//
-//
-// LookupMatchingNames helper - Search a symbol table for values matching Name.
-//
-static inline void LookupMatchingNames(const std::string &Name,
- SymbolTable &SymTab,
- std::vector<Value*> &Results) {
- // Loop over all of the type planes in the symbol table...
- for (SymbolTable::iterator I = SymTab.begin(), E = SymTab.end(); I != E; ++I){
- SymbolTable::VarMap &Plane = I->second;
-
- // Search the symbol table plane for this name...
- SymbolTable::VarMap::iterator Val = Plane.find(Name);
- if (Val != Plane.end())
- Results.push_back(Val->second); // Found a name match!
- }
-}
-
-// LookupMatchingNames - Search the current function namespace, then the global
-// namespace looking for values that match the specified name. Return ALL
-// matches to that name. This is obviously slow, and should only be used for
-// user interaction.
-//
-std::vector<Value*> Interpreter::LookupMatchingNames(const std::string &Name) {
- std::vector<Value*> Results;
- Function *CurFunc = getCurrentFunction();
-
- if (CurFunc) ::LookupMatchingNames(Name, CurFunc->getSymbolTable(), Results);
- ::LookupMatchingNames(Name, getModule().getSymbolTable(), Results);
- return Results;
-}
-
-// ChooseOneOption - Prompt the user to choose among the specified options to
-// pick one value. If no options are provided, emit an error. If a single
-// option is provided, just return that option.
-//
-Value *Interpreter::ChooseOneOption(const std::string &Name,
- const std::vector<Value*> &Opts) {
- switch (Opts.size()) {
- case 1: return Opts[0];
- case 0:
- std::cout << "Error: no entities named '" << Name << "' found!\n";
- return 0;
- default: break; // Must prompt user...
- }
-
- std::cout << "Multiple entities named '" << Name
- << "' found! Please choose:\n";
- std::cout << " 0. Cancel operation\n";
- for (unsigned i = 0; i < Opts.size(); ++i) {
- std::cout << " " << (i+1) << ".";
- WriteAsOperand(std::cout, Opts[i]) << "\n";
- }
-
- unsigned Option;
- do {
- std::cout << "lli> " << std::flush;
- std::cin >> Option;
- if (Option > Opts.size())
- std::cout << "Invalid selection: Please choose from 0 to " << Opts.size()
- << "\n";
- } while (Option > Opts.size());
-
- if (Option == 0) return 0;
- return Opts[Option-1];
-}