diff options
| author | Jim Lawson | 2018-02-16 17:10:30 -0800 |
|---|---|---|
| committer | GitHub | 2018-02-16 17:10:30 -0800 |
| commit | edcb81a34dbf8a04d0b011aa1ca07c6e19598f23 (patch) | |
| tree | aba2e3b8b921f9fdc861ed51687735f6d18d7bff /src/main/scala/firrtl/Compiler.scala | |
| parent | 74a3b302df4422bec47e754cad1703b36ff75cd2 (diff) | |
Replacematcherror - catch exceptions and convert to internal error. (#424)
* Catch exceptions and convert to internal error.
We need to update the displayed message to incorporate a line number and text to be used for the issue.
* Cleanup exception handling/throwing.
Re-throw expected (or uncorrectable exceptions).
Provide Utils.getThrowable() to get the first (eldest) or last throwable in the chain.
Update tests to conform to FreeSpec protocol.
* Minor cleanup
Admit we've updated some deprecated ScalaTest methods.
Diffstat (limited to 'src/main/scala/firrtl/Compiler.scala')
| -rw-r--r-- | src/main/scala/firrtl/Compiler.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala index 43596765..504ec85c 100644 --- a/src/main/scala/firrtl/Compiler.scala +++ b/src/main/scala/firrtl/Compiler.scala @@ -203,7 +203,7 @@ final case object LowForm extends CircuitForm(0) * this requirement. */ final case object UnknownForm extends CircuitForm(-1) { - override def compare(that: CircuitForm): Int = { error("Illegal to compare UnknownForm"); 0 } + override def compare(that: CircuitForm): Int = { sys.error("Illegal to compare UnknownForm"); 0 } } /** The basic unit of operating on a Firrtl AST */ @@ -331,8 +331,8 @@ object CompilerUtils extends LazyLogging { Seq(new IRToWorkingIR, new ResolveAndCheck, new transforms.DedupModules, new HighFirrtlToMiddleFirrtl) ++ getLoweringTransforms(MidForm, outputForm) case MidForm => Seq(new MiddleFirrtlToLowFirrtl) ++ getLoweringTransforms(LowForm, outputForm) - case LowForm => throwInternalError // should be caught by if above - case UnknownForm => throwInternalError // should be caught by if above + case LowForm => throwInternalError(Some("getLoweringTransforms - LowForm")) // should be caught by if above + case UnknownForm => throwInternalError(Some("getLoweringTransforms - UnknownForm")) // should be caught by if above } } } |
