Skip to content

Commit

Permalink
Add debugging compiler stack trace for Tim Poterba (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgruen authored Oct 9, 2022
1 parent 71b268d commit 7921901
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hail/src/main/scala/is/hail/expr/ir/Emit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,13 @@ case class IEmitCodeGen[+A](Lmissing: CodeLabel, Lpresent: CodeLabel, value: A,
value
}

def get(cb: EmitCodeBuilder, errorMsg: Code[String]=s"expected non-missing", errorID: Code[Int] = const(ErrorIDs.NO_ERROR)): A =
handle(cb, cb._fatalWithError(errorID, errorMsg))
def get(cb: EmitCodeBuilder, errorMsg: Code[String]=null, errorID: Code[Int] = const(ErrorIDs.NO_ERROR)): A = {
val msg: Code[String] = if (errorMsg != null)
errorMsg
else
s"expected non-missing - compiler stacktrace: \n ${Thread.currentThread().getStackTrace.mkString("\n ")}"
handle(cb, cb._fatalWithError(errorID, msg))
}

def consume(cb: EmitCodeBuilder, ifMissing: => Unit, ifPresent: (A) => Unit): Unit = {
val Lafter = CodeLabel()
Expand Down

0 comments on commit 7921901

Please sign in to comment.