[llvm] r184760 - Improve diagnostics when getSizeInBits is called on the Other type.

Chad Rosier mcrosier at apple.com
Mon Jun 24 10:29:51 PDT 2013


Author: mcrosier
Date: Mon Jun 24 12:29:51 2013
New Revision: 184760

URL: http://llvm.org/viewvc/llvm-project?rev=184760&view=rev
Log:
Improve diagnostics when getSizeInBits is called on the Other type.

Modified:
    llvm/trunk/include/llvm/CodeGen/ValueTypes.h

Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=184760&r1=184759&r2=184760&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Mon Jun 24 12:29:51 2013
@@ -343,6 +343,10 @@ namespace llvm {
 
     unsigned getSizeInBits() const {
       switch (SimpleTy) {
+      default:
+        llvm_unreachable("getSizeInBits called on extended MVT.");
+      case Other:
+        llvm_unreachable("Value type is non-standard value, Other.");
       case iPTR:
         llvm_unreachable("Value type size is target-dependent. Ask TLI.");
       case iPTRAny:
@@ -352,8 +356,6 @@ namespace llvm {
         llvm_unreachable("Value type is overloaded.");
       case Metadata:
         llvm_unreachable("Value type is metadata.");
-      default:
-        llvm_unreachable("getSizeInBits called on extended MVT.");
       case i1  :  return 1;
       case v2i1:  return 2;
       case v4i1:  return 4;





More information about the llvm-commits mailing list