From bc92bb62f9f6a090e74392993e4fcfdd1f6b0676 Mon Sep 17 00:00:00 2001 From: Aditya Naik Date: Wed, 29 May 2024 17:28:22 -0700 Subject: i got 99 errors but "firrtl not found" aint one --- core/src/main/scala/chisel3/internal/MonoConnect.scala | 1 - core/src/main/scala/chisel3/internal/Namer.scala | 4 ++-- core/src/main/scala/chisel3/internal/SourceInfo.scala | 17 ----------------- 3 files changed, 2 insertions(+), 20 deletions(-) (limited to 'core/src/main/scala/chisel3/internal') diff --git a/core/src/main/scala/chisel3/internal/MonoConnect.scala b/core/src/main/scala/chisel3/internal/MonoConnect.scala index 257c543f..1389d508 100644 --- a/core/src/main/scala/chisel3/internal/MonoConnect.scala +++ b/core/src/main/scala/chisel3/internal/MonoConnect.scala @@ -7,7 +7,6 @@ import chisel3.experimental.{Analog, BaseModule, UnsafeEnum} import chisel3.internal.Builder.pushCommand import chisel3.internal.firrtl.{Connect, Converter, DefInvalid} -import scala.language.experimental.macros import chisel3.internal.sourceinfo.SourceInfo import _root_.firrtl.passes.CheckTypes import scala.annotation.tailrec diff --git a/core/src/main/scala/chisel3/internal/Namer.scala b/core/src/main/scala/chisel3/internal/Namer.scala index c36aafef..23b5b7ba 100644 --- a/core/src/main/scala/chisel3/internal/Namer.scala +++ b/core/src/main/scala/chisel3/internal/Namer.scala @@ -54,7 +54,7 @@ sealed trait NamingContextInterface { * so that actual naming calls (HasId.suggestName) can happen. * Recursively names descendants, for those whose return value have an associated name. */ - def namePrefix(prefix: String) + def namePrefix(prefix: String): String } /** Dummy implementation to allow for naming annotations in a non-Builder context. @@ -77,7 +77,7 @@ class NamingContext extends NamingContextInterface { * prefixed with the name given to the reference object, if the reference object is named in the * scope of this context. */ - def addDescendant(ref: Any, descendant: NamingContext) { + def addDescendant(ref: Any, descendant: NamingContext) = { ref match { case ref: AnyRef => // getOrElseUpdate diff --git a/core/src/main/scala/chisel3/internal/SourceInfo.scala b/core/src/main/scala/chisel3/internal/SourceInfo.scala index dc7f7fab..b4697e88 100644 --- a/core/src/main/scala/chisel3/internal/SourceInfo.scala +++ b/core/src/main/scala/chisel3/internal/SourceInfo.scala @@ -14,9 +14,6 @@ package chisel3.internal.sourceinfo -import scala.language.experimental.macros -import scala.reflect.macros.blackbox.Context - /** Abstract base class for generalized source information. */ sealed trait SourceInfo { @@ -46,17 +43,3 @@ case object DeprecatedSourceInfo extends NoSourceInfo case class SourceLine(filename: String, line: Int, col: Int) extends SourceInfo { def makeMessage(f: String => String): String = f(s"@[$filename $line:$col]") } - -/** Provides a macro that returns the source information at the invocation point. - */ -object SourceInfoMacro { - def generate_source_info(c: Context): c.Tree = { - import c.universe._ - val p = c.enclosingPosition - q"_root_.chisel3.internal.sourceinfo.SourceLine(${p.source.file.name}, ${p.line}, ${p.column})" - } -} - -object SourceInfo { - implicit def materialize: SourceInfo = macro SourceInfoMacro.generate_source_info -} -- cgit v1.2.3