changeset 20824:7976223c77b5

Add convenient shouldNotReachHere method
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 08 Apr 2015 22:01:36 -0700
parents 3c1f872f280e
children 854b0b6854f4
files graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java	Wed Apr 08 22:00:47 2015 -0700
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java	Wed Apr 08 22:01:36 2015 -0700
@@ -48,6 +48,10 @@
         throw new GraalInternalError("should not reach here: %s", msg);
     }
 
+    public static RuntimeException shouldNotReachHere(Throwable cause) {
+        throw new GraalInternalError(cause);
+    }
+
     /**
      * Checks a given condition and throws a {@link GraalInternalError} if it is false. Guarantees
      * are stronger than assertions in that they are always checked. Error messages for guarantee