[llvm-commits] [compiler-rt] r165913 - /compiler-rt/trunk/lib/ubsan/ubsan_value.cc

Richard Smith richard-llvm at metafoo.co.uk
Sun Oct 14 16:53:37 PDT 2012


Author: rsmith
Date: Sun Oct 14 18:53:37 2012
New Revision: 165913

URL: http://llvm.org/viewvc/llvm-project?rev=165913&view=rev
Log:
Provide a slightly more helpful diagnostic if -fcatch-undefined-behavior finds
a problem with __int128 arithmetic but the runtime was not built with __int128
support.

Modified:
    compiler-rt/trunk/lib/ubsan/ubsan_value.cc

Modified: compiler-rt/trunk/lib/ubsan/ubsan_value.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_value.cc?rev=165913&r1=165912&r2=165913&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_value.cc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_value.cc Sun Oct 14 18:53:37 2012
@@ -30,6 +30,9 @@
 #if HAVE_INT128_T
   if (getType().getIntegerBitWidth() == 128)
     return *reinterpret_cast<s128*>(Val);
+#else
+  if (getType().getIntegerBitWidth() == 128)
+    UNREACHABLE("libclang_rt.ubsan was built without __int128 support");
 #endif
   UNREACHABLE("unexpected bit width");
 }
@@ -43,6 +46,9 @@
 #if HAVE_INT128_T
   if (getType().getIntegerBitWidth() == 128)
     return *reinterpret_cast<u128*>(Val);
+#else
+  if (getType().getIntegerBitWidth() == 128)
+    UNREACHABLE("libclang_rt.ubsan was built without __int128 support");
 #endif
   UNREACHABLE("unexpected bit width");
 }





More information about the llvm-commits mailing list