aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Support/DynamicLibrary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/DynamicLibrary.cpp')
-rw-r--r--contrib/llvm/lib/Support/DynamicLibrary.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/llvm/lib/Support/DynamicLibrary.cpp b/contrib/llvm/lib/Support/DynamicLibrary.cpp
index a825c687bdcf..d2b551e8a0a6 100644
--- a/contrib/llvm/lib/Support/DynamicLibrary.cpp
+++ b/contrib/llvm/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