Skip to content
Snippets Groups Projects
Commit 9ec2761b authored by Reid Spencer's avatar Reid Spencer
Browse files

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

llvm-svn: 18356
parent 0e6a4fc4
No related branches found
No related tags found
No related merge requests found
......@@ -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";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment