summaryrefslogtreecommitdiff
path: root/include/llvm/System
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
commitb0b0ea07bb3a24aa336e0145482f37df358918d6 (patch)
treeaa7b83578a541e471c10ffa90e6be959ecb380fa /include/llvm/System
parenta564845f838cb9e56e6df5106ad57d91552e6568 (diff)
downloadllvm-b0b0ea07bb3a24aa336e0145482f37df358918d6.tar.gz
llvm-b0b0ea07bb3a24aa336e0145482f37df358918d6.tar.bz2
llvm-b0b0ea07bb3a24aa336e0145482f37df358918d6.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/System')
-rw-r--r--include/llvm/System/DynamicLibrary.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/llvm/System/DynamicLibrary.h b/include/llvm/System/DynamicLibrary.h
index d8535284eb..6f1ebb5991 100644
--- a/include/llvm/System/DynamicLibrary.h
+++ b/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: