Provide a slightly more helpful diagnostic if -fcatch-undefined-behavior finds
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 14 Oct 2012 23:53:37 +0000 (23:53 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 14 Oct 2012 23:53:37 +0000 (23:53 +0000)
a problem with __int128 arithmetic but the runtime was not built with __int128
support.

llvm-svn: 165913

compiler-rt/lib/ubsan/ubsan_value.cc

index 3d6a735..f17c589 100644 (file)
@@ -30,6 +30,9 @@ SIntMax Value::getSIntValue() const {
 #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 @@ UIntMax Value::getUIntValue() const {
 #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");
 }