cling/patches/llvm-DyLib-from-handle.diff
2013-08-21 16:43:33 +02:00

29 lines
1.2 KiB
Diff

diff --git a/interpreter/llvm/src/include/llvm/Support/DynamicLibrary.h b/interpreter/llvm/src/include/llvm/Support/DynamicLibrary.h
index 1e2d16c..c73f046 100644
--- include/llvm/Support/DynamicLibrary.h
+++ include/llvm/Support/DynamicLibrary.h
@@ -67,6 +67,8 @@ namespace sys {
static DynamicLibrary getPermanentLibrary(const char *filename,
std::string *errMsg = 0);
+ static DynamicLibrary addPermanentLibrary(void *handle);
+
/// This function permanently loads the dynamic library at the given path.
/// Use this instead of getPermanentLibrary() when you won't need to get
/// symbols from the library itself.
diff --git a/interpreter/llvm/src/lib/Support/DynamicLibrary.cpp b/interpreter/llvm/src/lib/Support/DynamicLibrary.cpp
index f14cb45..46ad224 100644
--- lib/Support/DynamicLibrary.cpp
+++ lib/Support/DynamicLibrary.cpp
@@ -86,7 +86,10 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,
if (filename == NULL)
handle = RTLD_DEFAULT;
#endif
+ return addPermanentLibrary(handle);
+}
+DynamicLibrary DynamicLibrary::addPermanentLibrary(void *handle) {
if (OpenedHandles == 0)
OpenedHandles = new DenseSet<void *>();