We just use ltdl's implementation for this abstraction now. Its portable to

more platforms than LLVM supports.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-11-29 12:39:10 +00:00
parent 7d277000af
commit 29ae1777c1

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/System/DynamicLibrary.h" #include "llvm/System/DynamicLibrary.h"
#include "llvm/Config/dlfcn.h" #include "ltdl.h"
#include <cassert> #include <cassert>
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -20,14 +20,10 @@
//=== independent code. //=== independent code.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifdef HAVE_LTDL_H
namespace llvm { namespace llvm {
using namespace sys; using namespace sys;
#ifdef HAVE_LT_DLOPEN
DynamicLibrary::DynamicLibrary() : handle(0) { DynamicLibrary::DynamicLibrary() : handle(0) {
if (0 != lt_dlinit()) if (0 != lt_dlinit())
throw std::string(lt_dlerror()); throw std::string(lt_dlerror());
@ -63,7 +59,7 @@ void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
return lt_dlsym((lt_dlhandle) handle,symbolName); return lt_dlsym((lt_dlhandle) handle,symbolName);
} }
#else #if 0
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) { DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
assert(!"Have ltdl.h but not libltdl.a!"); assert(!"Have ltdl.h but not libltdl.a!");
} }
@ -77,12 +73,6 @@ void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
return 0; return 0;
} }
#endif // HAVE_DLOPEN #endif
} // namespace llvm } // namespace llvm
#else // HAVE_LTDL_H
#include "platform/DynamicLibrary.cpp"
#endif