llvm.org GIT mirror llvm / b0b0ea0
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 Reid Spencer 15 years ago
1 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
5656 ~DynamicLibrary();
5757
5858 /// @}
59 /// @name Functions
60 /// @{
61 public:
62 /// This function allows a library to be loaded without instantiating a
63 /// DynamicLibrary object. Consequently, it is marked as being permanent
64 /// and will only be unloaded when the program terminates.
65 /// @throws std::string on error.
66 /// @brief Open a dynamic library permanently.
67 static void LoadLibraryPermanently(const char* filename);
68
69 /// This function will search through all previously loaded dynamic
70 /// libraries for the symbol \p symbolName. If it is found, the addressof
71 /// that symbol is returned. If not, null is returned. Note that this will
72 /// search permanently loaded libraries (LoadLibraryPermanently) as well
73 /// as ephemerally loaded libraries (constructors).
74 /// @throws std::string on error.
75 /// @brief Search through libraries for address of a symbol
76 static void* SearchForAddressOfSymbol(const char* symbolName);
77
78 /// @brief Convenience function for C++ophiles.
79 static void* SearchForAddressOfSymbol(const std::string& symbolName) {
80 return SearchForAddressOfSymbol(symbolName.c_str());
81 }
82
83 /// @}
5984 /// @name Accessors
6085 /// @{
6186 public: