OSDN Git Service

[Windows] Simplify assertion code. NFC.
authorDavide Italiano <davide@freebsd.org>
Tue, 1 Dec 2015 02:35:04 +0000 (02:35 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 1 Dec 2015 02:35:04 +0000 (02:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254363 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/DynamicLibrary.inc
lib/Support/Windows/Signals.inc

index 17418b0..77146d4 100644 (file)
@@ -61,10 +61,8 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,
       OpenedHandles = new DenseSet<HMODULE>();
 
     if (!fEnumerateLoadedModules) {
-      if (!loadDebugHelp()) {
-        assert(false && "These APIs should always be available");
-        return DynamicLibrary();
-      }
+      assert(loadDebugHelp() && "These APIs should always be available");
+      return DynamicLibrary();
     }
 
     fEnumerateLoadedModules(GetCurrentProcess(), ELM_Callback, 0);
index f40ca72..d109a66 100644 (file)
@@ -405,10 +405,7 @@ static void RegisterHandler() {
   // If we cannot load up the APIs (which would be unexpected as they should
   // exist on every version of Windows we support), we will bail out since
   // there would be nothing to report.
-  if (!load64BitDebugHelp()) {
-    assert(false && "These APIs should always be available");
-    return;
-  }
+  assert(load64BitDebugHelp() && "These APIs should always be available");
 
   if (RegisteredUnhandledExceptionFilter) {
     EnterCriticalSection(&CriticalSection);