diff options
| author | Jack Koenig | 2021-12-20 12:08:39 -0800 |
|---|---|---|
| committer | Jack Koenig | 2021-12-20 13:39:34 -0800 |
| commit | 7c7de8d404b0e6d5ed0c67b4a7862c62b36e0958 (patch) | |
| tree | 9f71c74c1f84b3f17df6be0525631e732b92d21a /plugin/src | |
| parent | 3d5ae7eb746416f23683f83fc4280f4bd1170b43 (diff) | |
[plugin] Internal refactor, remove useBundlePlugin
It is always true. The scalacOption to enable it is still supported and
prints a warning that the option no longer does anything.
Diffstat (limited to 'plugin/src')
| -rw-r--r-- | plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala | 8 | ||||
| -rw-r--r-- | plugin/src/main/scala/chisel3/internal/plugin/ChiselPlugin.scala | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala index 67d744fc..c3a001fa 100644 --- a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala +++ b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala @@ -26,14 +26,10 @@ private[plugin] class BundleComponent(val global: Global, arguments: ChiselPlugi // instead we just check the version and if its an early Scala version, the plugin does nothing val scalaVersion = scala.util.Properties.versionNumberString.split('.') val scalaVersionOk = scalaVersion(0).toInt == 2 && scalaVersion(1).toInt >= 12 - if (scalaVersionOk && arguments.useBundlePlugin) { + if (scalaVersionOk) { unit.body = new MyTypingTransformer(unit).transform(unit.body) } else { - val reason = if (!scalaVersionOk) { - s"invalid Scala version '${scala.util.Properties.versionNumberString}'" - } else { - s"not enabled via '${arguments.useBundlePluginFullOpt}'" - } + val reason = s"invalid Scala version '${scala.util.Properties.versionNumberString}'" // Enable this with scalacOption '-Ylog:chiselbundlephase' global.log(s"Skipping BundleComponent on account of $reason.") } diff --git a/plugin/src/main/scala/chisel3/internal/plugin/ChiselPlugin.scala b/plugin/src/main/scala/chisel3/internal/plugin/ChiselPlugin.scala index 23082329..2282059f 100644 --- a/plugin/src/main/scala/chisel3/internal/plugin/ChiselPlugin.scala +++ b/plugin/src/main/scala/chisel3/internal/plugin/ChiselPlugin.scala @@ -7,14 +7,18 @@ import nsc.Global import nsc.plugins.{Plugin, PluginComponent} import scala.reflect.internal.util.NoPosition -private[plugin] case class ChiselPluginArguments(var useBundlePlugin: Boolean = true) { +private[plugin] case class ChiselPluginArguments() { def useBundlePluginOpt = "useBundlePlugin" - def useBundlePluginFullOpt = s"-P:chiselplugin:$useBundlePluginOpt" + def useBundlePluginFullOpt = s"-P:${ChiselPlugin.name}:$useBundlePluginOpt" +} + +object ChiselPlugin { + val name = "chiselplugin" } // The plugin to be run by the Scala compiler during compilation of Chisel code class ChiselPlugin(val global: Global) extends Plugin { - val name = "chiselplugin" + val name = ChiselPlugin.name val description = "Plugin for Chisel 3 Hardware Description Language" private val arguments = ChiselPluginArguments() val components: List[PluginComponent] = List[PluginComponent]( |
