Skip to content

Commit da3aa43

Browse files
committed
Better debugging for downgrades
1 parent d850625 commit da3aa43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/scala/firrtl/ir/IR.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ case object FnBinding extends Expression {
7575

7676
case class Declassify(expr: Expression, lbl: Label) extends Expression {
7777
def tpe = expr.tpe
78-
def serialize: String = expr.serialize
78+
def serialize: String =
79+
s"declassify(${expr.serialize}, ${expr.lbl.serialize} to ${lbl.serialize})"
7980
def mapExpr(f: Expression => Expression): Expression = this.copy(expr = f(expr))
8081
def mapLabel(f: Label => Label): Expression = this.copy(lbl = f(lbl))
8182
def mapType(f: Type => Type): Expression = this
@@ -84,7 +85,8 @@ case class Declassify(expr: Expression, lbl: Label) extends Expression {
8485

8586
case class Endorse(expr: Expression, lbl: Label) extends Expression {
8687
def tpe = expr.tpe
87-
def serialize: String = expr.serialize
88+
def serialize: String =
89+
s"endorse(${expr.serialize}, ${expr.lbl.serialize} to ${lbl.serialize})"
8890
def mapExpr(f: Expression => Expression): Expression = this.copy(expr = f(expr))
8991
def mapLabel(f: Label => Label): Expression = this.copy(lbl = f(lbl))
9092
def mapType(f: Type => Type): Expression = this

0 commit comments

Comments
 (0)