diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 | 
| commit | 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch) | |
| tree | f5944309621cee4fe0976be6f9ac619b7ebfc4c2 /lib/Support/DynamicLibrary.cpp | |
| parent | 68bcb7db193e4bc81430063148253d30a791023e (diff) | |
Notes
Diffstat (limited to 'lib/Support/DynamicLibrary.cpp')
| -rw-r--r-- | lib/Support/DynamicLibrary.cpp | 18 | 
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp index a825c687bdcf..d2b551e8a0a6 100644 --- a/lib/Support/DynamicLibrary.cpp +++ b/lib/Support/DynamicLibrary.cpp @@ -7,19 +7,19 @@  //  //===----------------------------------------------------------------------===//  // -//  This header file implements the operating system DynamicLibrary concept. +//  This file implements the operating system DynamicLibrary concept.  //  // FIXME: This file leaks ExplicitSymbols and OpenedHandles!  //  //===----------------------------------------------------------------------===//  #include "llvm/Support/DynamicLibrary.h" -#include "llvm/Support/ManagedStatic.h" +#include "llvm-c/Support.h"  #include "llvm/ADT/DenseSet.h"  #include "llvm/ADT/StringMap.h"  #include "llvm/Config/config.h" +#include "llvm/Support/ManagedStatic.h"  #include "llvm/Support/Mutex.h" -#include "llvm-c/Support.h"  #include <cstdio>  #include <cstring> @@ -51,14 +51,14 @@ using namespace llvm::sys;  //===          independent code.  //===----------------------------------------------------------------------===// -static DenseSet<void *> *OpenedHandles = 0; +static DenseSet<void *> *OpenedHandles = nullptr;  DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,                                                     std::string *errMsg) {    SmartScopedLock<true> lock(*SymbolsMutex);    void *handle = dlopen(filename, RTLD_LAZY|RTLD_GLOBAL); -  if (handle == 0) { +  if (!handle) {      if (errMsg) *errMsg = dlerror();      return DynamicLibrary();    } @@ -66,11 +66,11 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,  #ifdef __CYGWIN__    // Cygwin searches symbols only in the main    // with the handle of dlopen(NULL, RTLD_GLOBAL). -  if (filename == NULL) +  if (!filename)      handle = RTLD_DEFAULT;  #endif -  if (OpenedHandles == 0) +  if (!OpenedHandles)      OpenedHandles = new DenseSet<void *>();    // If we've already loaded this library, dlclose() the handle in order to @@ -83,7 +83,7 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,  void *DynamicLibrary::getAddressOfSymbol(const char *symbolName) {    if (!isValid()) -    return NULL; +    return nullptr;    return dlsym(Data, symbolName);  } @@ -166,7 +166,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {  #endif  #undef EXPLICIT_SYMBOL -  return 0; +  return nullptr;  }  #endif // LLVM_ON_WIN32  | 
