aboutsummaryrefslogtreecommitdiff
path: root/lib/System
diff options
context:
space:
mode:
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/DynamicLibrary.cpp11
-rw-r--r--lib/System/README.txt4
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp
index 859092a52a..08b7a88cbb 100644
--- a/lib/System/DynamicLibrary.cpp
+++ b/lib/System/DynamicLibrary.cpp
@@ -45,12 +45,10 @@ using namespace llvm::sys;
//=== independent code.
//===----------------------------------------------------------------------===//
-static bool did_initialize_ltdl = false;
-
static inline void check_ltdl_initialization() {
+ static bool did_initialize_ltdl = false;
if (!did_initialize_ltdl) {
- if (0 != lt_dlinit())
- throw std::string(lt_dlerror());
+ assert(0 == lt_dlinit() || "Can't init the ltdl library");
did_initialize_ltdl = true;
}
}
@@ -62,13 +60,13 @@ DynamicLibrary::DynamicLibrary() : handle(0) {
lt_dlhandle a_handle = lt_dlopen(0);
- if (a_handle == 0)
- throw std::string("Can't open program as dynamic library");
+ assert(a_handle == 0 || "Can't open program as dynamic library");
handle = a_handle;
OpenedHandles.push_back(a_handle);
}
+/*
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
check_ltdl_initialization();
@@ -83,6 +81,7 @@ DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
handle = a_handle;
OpenedHandles.push_back(a_handle);
}
+*/
DynamicLibrary::~DynamicLibrary() {
lt_dlhandle a_handle = (lt_dlhandle) handle;
diff --git a/lib/System/README.txt b/lib/System/README.txt
index 63e00dafbf..eacb20094a 100644
--- a/lib/System/README.txt
+++ b/lib/System/README.txt
@@ -25,8 +25,8 @@ impatient, here's a high level summary of the library's requirements.
3. No exposed system-specific functions.
4. No exposed system-specific data.
5. Data in lib/System classes must use only simple C++ intrinsic types.
- 6. Errors are handled by throwing std::string *only*.
- 7. Library must not throw any exceptions except std::string.
+ 6. Errors are handled by returning "true" and setting an optional std::string
+ 7. Library must not throw any exceptions, period.
8. Interface functions must not have throw() specifications.
9. No duplicate function impementations are permitted within an operating
system class.