we don't use libtool anymore, update comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-07 17:50:11 +00:00
parent f361238a93
commit 0875c7ccf5

View File

@ -23,26 +23,18 @@
static std::map<std::string, void*> symbols; static std::map<std::string, void*> symbols;
static llvm::sys::SmartRWMutex<true> SymbolsLock; static llvm::sys::SmartRWMutex<true> SymbolsLock;
void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName, void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName,
void *symbolValue) { void *symbolValue) {
llvm::sys::SmartScopedWriter<true> Writer(&SymbolsLock); llvm::sys::SmartScopedWriter<true> Writer(&SymbolsLock);
symbols[symbolName] = symbolValue; symbols[symbolName] = symbolValue;
} }
// It is not possible to use ltdl.c on VC++ builds as the terms of its LGPL
// license and special exception would cause all of LLVM to be placed under
// the LGPL. This is because the exception applies only when libtool is
// used, and obviously libtool is not used with Visual Studio. An entirely
// separate implementation is provided in win32/DynamicLibrary.cpp.
#ifdef LLVM_ON_WIN32 #ifdef LLVM_ON_WIN32
#include "Win32/DynamicLibrary.inc" #include "Win32/DynamicLibrary.inc"
#else #else
//#include "ltdl.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <cassert> #include <cassert>
using namespace llvm; using namespace llvm;
@ -53,7 +45,6 @@ using namespace llvm::sys;
//=== independent code. //=== independent code.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//static std::vector<lt_dlhandle> OpenedHandles;
static std::vector<void *> OpenedHandles; static std::vector<void *> OpenedHandles;
DynamicLibrary::DynamicLibrary() {} DynamicLibrary::DynamicLibrary() {}
@ -61,7 +52,8 @@ DynamicLibrary::DynamicLibrary() {}
DynamicLibrary::~DynamicLibrary() { DynamicLibrary::~DynamicLibrary() {
SmartScopedWriter<true> Writer(&SymbolsLock); SmartScopedWriter<true> Writer(&SymbolsLock);
while(!OpenedHandles.empty()) { while(!OpenedHandles.empty()) {
void *H = OpenedHandles.back(); OpenedHandles.pop_back(); void *H = OpenedHandles.back();
OpenedHandles.pop_back();
dlclose(H); dlclose(H);
} }
} }
@ -80,8 +72,6 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
} }
void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
// check_ltdl_initialization();
// First check symbols added via AddSymbol(). // First check symbols added via AddSymbol().
SymbolsLock.reader_acquire(); SymbolsLock.reader_acquire();
std::map<std::string, void *>::iterator I = symbols.find(symbolName); std::map<std::string, void *>::iterator I = symbols.find(symbolName);