[llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp

Reid Spencer reid at x10sys.com
Mon Nov 29 02:39:57 PST 2004



Changes in directory llvm/lib/System:

DynamicLibrary.cpp updated: 1.1 -> 1.2
---
Log message:

Implement the default constructor which causes the current program to be
opened as if it was a dynamic library so its symbols can be searched too.


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

Index: llvm/lib/System/DynamicLibrary.cpp
diff -u llvm/lib/System/DynamicLibrary.cpp:1.1 llvm/lib/System/DynamicLibrary.cpp:1.2
--- llvm/lib/System/DynamicLibrary.cpp:1.1	Wed Nov 17 22:33:40 2004
+++ llvm/lib/System/DynamicLibrary.cpp	Mon Nov 29 04:39:46 2004
@@ -28,6 +28,16 @@
 
 #ifdef HAVE_LT_DLOPEN
 
+DynamicLibrary::DynamicLibrary() : handle(0) {
+  if (0 != lt_dlinit())
+    throw std::string(lt_dlerror());
+
+  handle = lt_dlopen(0);
+
+  if (handle == 0)
+    throw std::string("Can't open program as dynamic library");
+}
+
 DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
   if (0 != lt_dlinit())
     throw std::string(lt_dlerror());






More information about the llvm-commits mailing list