[llvm-commits] CVS: llvm/lib/Support/PluginLoader.cpp

Reid Spencer reid at x10sys.com
Mon Nov 29 06:07:57 PST 2004



Changes in directory llvm/lib/Support:

PluginLoader.cpp updated: 1.12 -> 1.13
---
Log message:

Use System/DynamicLibrary instead of Support/DynamicLinker to implement.


---
Diffs of the changes:  (+12 -2)

Index: llvm/lib/Support/PluginLoader.cpp
diff -u llvm/lib/Support/PluginLoader.cpp:1.12 llvm/lib/Support/PluginLoader.cpp:1.13
--- llvm/lib/Support/PluginLoader.cpp:1.12	Wed Sep  1 17:55:35 2004
+++ llvm/lib/Support/PluginLoader.cpp	Mon Nov 29 08:07:46 2004
@@ -13,13 +13,23 @@
 
 #define DONT_GET_PLUGIN_LOADER_OPTION
 #include "llvm/Support/PluginLoader.h"
-#include "llvm/Support/DynamicLinker.h"
+#include "llvm/System/DynamicLibrary.h"
 #include <iostream>
+
 using namespace llvm;
 
 void PluginLoader::operator=(const std::string &Filename) {
   std::string ErrorMessage;
-  if (LinkDynamicObject(Filename.c_str(), &ErrorMessage))
+  try {
+    sys::DynamicLibrary::LoadLibraryPermanently(Filename.c_str());
+  } catch (const std::string& errmsg) {
+    if (errmsg.empty()) {
+      ErrorMessage = "Unknown";
+    } else {
+      ErrorMessage = errmsg;
+    }
+  }
+  if (!ErrorMessage.empty())
     std::cerr << "Error opening '" << Filename << "': " << ErrorMessage
               << "\n  -load request ignored.\n";	
 }






More information about the llvm-commits mailing list