Zap some more unused static method decls
[oota-llvm.git] / include / llvm / ExecutionEngine / ExecutionEngine.h
index e833be786966fefc69eb9a5549275df0785c8855..89a264333a4d9aafa15eb6d73bdf7260f1ffcef7 100644 (file)
@@ -11,6 +11,7 @@
 #include <vector>
 #include <string>
 #include <map>
+#include <cassert>
 class Constant;
 class Type;
 class GlobalValue;
@@ -30,7 +31,6 @@ protected:
 
   void setTargetData(const TargetData &td) {
     TD = &td;
-    emitGlobals();
   }
 public:
   ExecutionEngine(Module *M) : CurMod(*M) {
@@ -41,20 +41,15 @@ public:
   Module &getModule() const { return CurMod; }
   const TargetData &getTargetData() const { return *TD; }
 
-  /// run - Start execution with the specified function and arguments.
+  /// run - Start execution with the specified function, arguments, and
+  ///       environment.
   ///
   virtual int run(const std::string &FnName,
-                 const std::vector<std::string> &Args) = 0;
+                  const std::vector<std::string> &Args,
+                  const char ** envp) = 0;
 
-  /// createJIT - Create an return a new JIT compiler if there is one available
-  /// for the current target.  Otherwise it returns null.
-  ///
-  static ExecutionEngine *createJIT(Module *M, unsigned Config);
-
-  /// createInterpreter - Create a new interpreter object.  This can never fail.
-  ///
-  static ExecutionEngine *createInterpreter(Module *M, unsigned Config,
-                                           bool DebugMode, bool TraceMode);
+  static ExecutionEngine *create (Module *M, bool ForceInterpreter,
+                                 bool TraceMode);
 
   void addGlobalMapping(const Function *F, void *Addr) {
     void *&CurVal = GlobalAddress[(const GlobalValue*)F];
@@ -62,6 +57,14 @@ public:
     CurVal = Addr;
   }
 
+  // getPointerToGlobalIfAvailable - This returns the address of the specified
+  // global value if it is available, otherwise it returns null.
+  //
+  void *getPointerToGlobalIfAvailable(const GlobalValue *GV) {
+    std::map<const GlobalValue*, void*>::iterator I = GlobalAddress.find(GV);
+    return I != GlobalAddress.end() ? I->second : 0;
+  }
+
   // getPointerToGlobal - This returns the address of the specified global
   // value.  This may involve code generation if it's a function.
   //
@@ -71,9 +74,9 @@ public:
   // different ways.  They should each implement this to say what a function
   // pointer should look like.
   //
-  virtual void *getPointerToFunction(const Function *F) = 0;
+  virtual void *getPointerToFunction(Function *F) = 0;
 
-private:
+protected:
   void emitGlobals();
 
 public:   // FIXME: protected:   // API shared among subclasses