summaryrefslogtreecommitdiff
path: root/coreMacros/src
diff options
context:
space:
mode:
authorJack Koenig2018-02-23 15:42:43 -0800
committerGitHub2018-02-23 15:42:43 -0800
commit3ff19716174e9abee20726096ecf7fb4d252ce63 (patch)
treec06f7793c4ddca77f5f73793ef1f685bece66ef9 /coreMacros/src
parent01f623d01ccbf038be6124632432e0d9aef84d6e (diff)
Add companion objects to macro classes (#787)
Add companion objects to macro classes Workaround for unconditional invalidation of macro classes in incremental recompilation
Diffstat (limited to 'coreMacros/src')
-rw-r--r--coreMacros/src/main/scala/chisel3/internal/RangeTransform.scala2
-rw-r--r--coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala3
-rw-r--r--coreMacros/src/main/scala/chisel3/internal/sourceinfo/NamingAnnotations.scala4
-rw-r--r--coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala20
4 files changed, 26 insertions, 3 deletions
diff --git a/coreMacros/src/main/scala/chisel3/internal/RangeTransform.scala b/coreMacros/src/main/scala/chisel3/internal/RangeTransform.scala
index f431341d..2f16083e 100644
--- a/coreMacros/src/main/scala/chisel3/internal/RangeTransform.scala
+++ b/coreMacros/src/main/scala/chisel3/internal/RangeTransform.scala
@@ -9,6 +9,8 @@ import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
import scala.reflect.macros.whitebox
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object RangeTransform
class RangeTransform(val c: Context) {
import c.universe._
def apply(args: c.Tree*): c.Tree = {
diff --git a/coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala b/coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala
index baf5b746..570e5383 100644
--- a/coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala
+++ b/coreMacros/src/main/scala/chisel3/internal/RuntimeDeprecationTransform.scala
@@ -7,7 +7,8 @@ import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.annotation.compileTimeOnly
-
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object RuntimeDeprecatedTransform
class RuntimeDeprecatedTransform(val c: Context) {
import c.universe._
diff --git a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/NamingAnnotations.scala b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/NamingAnnotations.scala
index 952e9f91..29b27b9e 100644
--- a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/NamingAnnotations.scala
+++ b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/NamingAnnotations.scala
@@ -17,6 +17,8 @@ import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
import scala.annotation.compileTimeOnly
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object DebugTransforms
class DebugTransforms(val c: Context) {
import c.universe._
@@ -45,6 +47,8 @@ class DebugTransforms(val c: Context) {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object NamingTransforms
class NamingTransforms(val c: Context) {
import c.universe._
import Flag._
diff --git a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
index 9f3ac88d..aa474cb6 100644
--- a/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
+++ b/coreMacros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
@@ -27,6 +27,8 @@ trait SourceInfoTransformMacro {
def implicitCompileOptions = q"implicitly[_root_.chisel3.core.CompileOptions]"
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object UIntTransform
class UIntTransform(val c: Context) extends SourceInfoTransformMacro {
import c.universe._
def bitset(off: c.Tree, dat: c.Tree): c.Tree = {
@@ -34,6 +36,8 @@ class UIntTransform(val c: Context) extends SourceInfoTransformMacro {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object InstTransform
// Module instantiation transform
class InstTransform(val c: Context) extends SourceInfoTransformMacro {
import c.universe._
@@ -42,6 +46,8 @@ class InstTransform(val c: Context) extends SourceInfoTransformMacro {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object MemTransform
class MemTransform(val c: Context) extends SourceInfoTransformMacro {
import c.universe._
def apply[T: c.WeakTypeTag](size: c.Tree, t: c.Tree): c.Tree = {
@@ -49,6 +55,8 @@ class MemTransform(val c: Context) extends SourceInfoTransformMacro {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object MuxTransform
class MuxTransform(val c: Context) extends SourceInfoTransformMacro {
import c.universe._
def apply[T: c.WeakTypeTag](cond: c.Tree, con: c.Tree, alt: c.Tree): c.Tree = {
@@ -57,6 +65,8 @@ class MuxTransform(val c: Context) extends SourceInfoTransformMacro {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object VecTransform
class VecTransform(val c: Context) extends SourceInfoTransformMacro {
import c.universe._
def apply_elts(elts: c.Tree): c.Tree = {
@@ -93,6 +103,8 @@ abstract class AutoSourceTransform extends SourceInfoTransformMacro {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object SourceInfoTransform
class SourceInfoTransform(val c: Context) extends AutoSourceTransform {
import c.universe._
@@ -129,6 +141,8 @@ class SourceInfoTransform(val c: Context) extends AutoSourceTransform {
}
}
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object CompileOptionsTransform
class CompileOptionsTransform(val c: Context) extends AutoSourceTransform {
import c.universe._
@@ -145,8 +159,10 @@ class CompileOptionsTransform(val c: Context) extends AutoSourceTransform {
}
}
-/** Special whitebox version of the blackbox SourceInfoTransform, used when fun things need to happen to satisfy the
- * type system while preventing the use of macro overrides.
+// Workaround for https://github.com/sbt/sbt/issues/3966
+object SourceInfoWhiteboxTransform
+/** Special whitebox version of the blackbox SourceInfoTransform, used when fun things need to
+ * happen to satisfy the type system while preventing the use of macro overrides.
*/
class SourceInfoWhiteboxTransform(val c: whitebox.Context) extends AutoSourceTransform {
import c.universe._