[llvm] 01f3a59 - Replace abort with llvm_unreachable.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 17:09:11 PDT 2019


Author: Joerg Sonnenberger
Date: 2019-10-29T01:08:11+01:00
New Revision: 01f3a59fb3e2542fce74c768718f594d0debd0da

URL: https://github.com/llvm/llvm-project/commit/01f3a59fb3e2542fce74c768718f594d0debd0da
DIFF: https://github.com/llvm/llvm-project/commit/01f3a59fb3e2542fce74c768718f594d0debd0da.diff

LOG: Replace abort with llvm_unreachable.

The former depended on header pollution to be found and doesn't fit the
LLVM style of error handling.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/Hashing.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
index b22606bdb518..59659d290495 100644
--- a/llvm/include/llvm/ADT/Hashing.h
+++ b/llvm/include/llvm/ADT/Hashing.h
@@ -45,6 +45,7 @@
 #define LLVM_ADT_HASHING_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SwapByteOrder.h"
 #include "llvm/Support/type_traits.h"
 #include <algorithm>
@@ -539,7 +540,7 @@ struct hash_combine_recursive_helper {
       // store types smaller than the buffer.
       if (!store_and_advance(buffer_ptr, buffer_end, data,
                              partial_store_size))
-        abort();
+        llvm_unreachable("buffer smaller than stored type");
     }
     return buffer_ptr;
   }


        


More information about the llvm-commits mailing list