summaryrefslogtreecommitdiff
path: root/macros/src/main/scala/chisel3
diff options
context:
space:
mode:
authorJared Barocsi2021-10-05 12:33:23 -0700
committerGitHub2021-10-05 19:33:23 +0000
commit110705eeace4f9165dc6377e55c86a599f37a465 (patch)
tree4e6ed88311fd1ce08cebc0225868d2d103c6fae7 /macros/src/main/scala/chisel3
parentce15ad50a5c175db06c3bba5e3bf46b6c5466c47 (diff)
Deprecate auto-application of empty argument lists to parameterless functions (#2124)
* Migrate nullary funcs to parameterless versions * Make deprecation message and dummy arguments clear and consistent Co-authored-by: Megan Wachs <megan@sifive.com>
Diffstat (limited to 'macros/src/main/scala/chisel3')
-rw-r--r--macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala14
1 files changed, 12 insertions, 2 deletions
diff --git a/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala b/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
index a8a7e8d5..ac3e236c 100644
--- a/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
+++ b/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala
@@ -165,7 +165,12 @@ object SourceInfoTransform
class SourceInfoTransform(val c: Context) extends AutoSourceTransform {
import c.universe._
- def noArg(): c.Tree = {
+ def noArg: c.Tree = {
+ q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)"
+ }
+
+ /** Necessary for dummy methods to auto-apply their arguments to this macro */
+ def noArgDummy(dummy: c.Tree*): c.Tree = {
q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)"
}
@@ -224,7 +229,12 @@ object SourceInfoWhiteboxTransform
class SourceInfoWhiteboxTransform(val c: whitebox.Context) extends AutoSourceTransform {
import c.universe._
- def noArg(): c.Tree = {
+ def noArg: c.Tree = {
+ q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)"
+ }
+
+ /** Necessary for dummy methods to auto-apply their arguments to this macro */
+ def noArgDummy(dummy: c.Tree*): c.Tree = {
q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)"
}