[llvm-commits] CVS: llvm/include/llvm/System/DynamicLibrary.h

Reid Spencer reid at x10sys.com
Mon Nov 29 05:28:06 PST 2004



Changes in directory llvm/include/llvm/System:

DynamicLibrary.h updated: 1.2 -> 1.3
---
Log message:

Add in some methods for use by the JIT. LoadLibraryPermanently brings the
library into the address space permanently. SearchForAddressOfSymbol looks
in all previously permanently loaded libraries and any currently open 
libraries for a symbol, instead of just one library like GetAddressOfSymbol


---
Diffs of the changes:  (+25 -0)

Index: llvm/include/llvm/System/DynamicLibrary.h
diff -u llvm/include/llvm/System/DynamicLibrary.h:1.2 llvm/include/llvm/System/DynamicLibrary.h:1.3
--- llvm/include/llvm/System/DynamicLibrary.h:1.2	Mon Nov 29 04:38:54 2004
+++ llvm/include/llvm/System/DynamicLibrary.h	Mon Nov 29 07:27:56 2004
@@ -57,6 +57,31 @@
       ~DynamicLibrary();
 
     /// @}
+    /// @name Functions
+    /// @{
+    public:
+      /// This function allows a library to be loaded without instantiating a
+      /// DynamicLibrary object. Consequently, it is marked as being permanent
+      /// and will only be unloaded when the program terminates.
+      /// @throws std::string on error.
+      /// @brief Open a dynamic library permanently.
+      static void LoadLibraryPermanently(const char* filename);
+
+      /// This function will search through all previously loaded dynamic
+      /// libraries for the symbol \p symbolName. If it is found, the addressof
+      /// that symbol is returned. If not, null is returned. Note that this will
+      /// search permanently loaded libraries (LoadLibraryPermanently) as well
+      /// as ephemerally loaded libraries (constructors).
+      /// @throws std::string on error.
+      /// @brief Search through libraries for address of a symbol
+      static void* SearchForAddressOfSymbol(const char* symbolName);
+
+      /// @brief Convenience function for C++ophiles.
+      static void* SearchForAddressOfSymbol(const std::string& symbolName) {
+        return SearchForAddressOfSymbol(symbolName.c_str());
+      }
+
+    /// @}
     /// @name Accessors
     /// @{
     public:






More information about the llvm-commits mailing list