[llvm] r254363 - [Windows] Simplify assertion code. NFC.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 18:35:04 PST 2015


Author: davide
Date: Mon Nov 30 20:35:04 2015
New Revision: 254363

URL: http://llvm.org/viewvc/llvm-project?rev=254363&view=rev
Log:
[Windows] Simplify assertion code. NFC.


Modified:
    llvm/trunk/lib/Support/Windows/DynamicLibrary.inc
    llvm/trunk/lib/Support/Windows/Signals.inc

Modified: llvm/trunk/lib/Support/Windows/DynamicLibrary.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/DynamicLibrary.inc?rev=254363&r1=254362&r2=254363&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/DynamicLibrary.inc (original)
+++ llvm/trunk/lib/Support/Windows/DynamicLibrary.inc Mon Nov 30 20:35:04 2015
@@ -61,10 +61,8 @@ DynamicLibrary DynamicLibrary::getPerman
       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);

Modified: llvm/trunk/lib/Support/Windows/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Signals.inc?rev=254363&r1=254362&r2=254363&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Signals.inc (original)
+++ llvm/trunk/lib/Support/Windows/Signals.inc Mon Nov 30 20:35:04 2015
@@ -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);




More information about the llvm-commits mailing list