wrap lines to 80 columns.
authorChris Lattner <sabre@nondot.org>
Wed, 22 Mar 2006 06:06:37 +0000 (06:06 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 22 Mar 2006 06:06:37 +0000 (06:06 +0000)
Add static JITCtor/InterpCtor fields

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26945 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/ExecutionEngine.h

index 6b248e54c8ec827c12275a4f20f43a7437603f1d..e3c1219d2984d44baef879251bdbe26354ef3329 100644 (file)
@@ -48,11 +48,13 @@ private:
   std::map<void *, const GlobalValue*> GlobalAddressReverseMap;
 
 public:
-  std::map<const GlobalValue*, void *>& getGlobalAddressMap(const MutexGuard& locked) {
+  std::map<const GlobalValue*, void *> &
+  getGlobalAddressMap(const MutexGuard &locked) {
     return GlobalAddressMap;
   }
 
-  std::map<void *, const GlobalValue*>& getGlobalAddressReverseMap(const MutexGuard& locked) {
+  std::map<void*, const GlobalValue*> & 
+  getGlobalAddressReverseMap(const MutexGuard& locked) {
     return GlobalAddressReverseMap;
   }
 };
@@ -71,9 +73,16 @@ protected:
     TD = &td;
   }
 
+  // To avoid having libexecutionengine depend on the JIT and interpreter
+  // libraries, the JIT and Interpreter set these functions to ctor pointers
+  // at startup time if they are linked in.
+  typedef ExecutionEngine *(*EECtorFn)(ModuleProvider*, IntrinsicLowering*);
+  static EECtorFn JITCtor, InterpCtor;
+    
 public:
-  /// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and JITEmitter classes.
-  /// It must be held while changing the internal state of any of those classes.
+  /// lock - This lock is protects the ExecutionEngine, JIT, JITResolver and
+  /// JITEmitter classes.  It must be held while changing the internal state of
+  /// any of those classes.
   sys::Mutex lock; // Used to make this class and subclasses thread-safe
 
   ExecutionEngine(ModuleProvider *P);
@@ -156,7 +165,8 @@ public:
   void *getPointerToGlobalIfAvailable(const GlobalValue *GV) {
     MutexGuard locked(lock);
 
-    std::map<const GlobalValue*, void*>::iterator I = state.getGlobalAddressMap(locked).find(GV);
+    std::map<const GlobalValue*, void*>::iterator I =
+      state.getGlobalAddressMap(locked).find(GV);
     return I != state.getGlobalAddressMap(locked).end() ? I->second : 0;
   }