# HG changeset patch # User Christian Wimmer # Date 1428555696 25200 # Node ID 7976223c77b5dd07b703c547b6ee84716df48762 # Parent 3c1f872f280e89c01e24a5b19fe1accf67fcc78d Add convenient shouldNotReachHere method diff -r 3c1f872f280e -r 7976223c77b5 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalInternalError.java --- 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