summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-29 13:27:56 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-29 13:27:56 +0000
commitc4c3f5a980489fd2f5b8d9e31614670bd6439e40 (patch)
tree00a98386908918e85161046bfddd72d44fc4e7f5
parentd1697bf2f771a844748230d262208c2e613dca3e (diff)
downloadbcm5719-llvm-c4c3f5a980489fd2f5b8d9e31614670bd6439e40.tar.gz
bcm5719-llvm-c4c3f5a980489fd2f5b8d9e31614670bd6439e40.zip
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 llvm-svn: 18354
-rw-r--r--llvm/include/llvm/System/DynamicLibrary.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/include/llvm/System/DynamicLibrary.h b/llvm/include/llvm/System/DynamicLibrary.h
index d8535284eb9..6f1ebb59911 100644
--- a/llvm/include/llvm/System/DynamicLibrary.h
+++ b/llvm/include/llvm/System/DynamicLibrary.h
@@ -57,6 +57,31 @@ namespace sys {
~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:
OpenPOWER on IntegriCloud