Skip to content

Conversation

@jackkoenig
Copy link
Contributor

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Feature (or new API)

Desired Merge Strategy

  • Squash

Release Notes

Users can now pass --no-source-info to suppress emission of source locators in emitted .fir.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@jackkoenig jackkoenig requested a review from seldridge October 10, 2025 21:12
@jackkoenig jackkoenig added the Feature New feature, will be included in release notes label Oct 10, 2025
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some nits. Take them or leave them.

Comment on lines 60 to 66
if (!suppressSourceInfo) {
info match {
case _: NoSourceInfo => ()
case sl: SourceLine =>
b ++= " @["; b ++= fir.FileInfo.fromUnescaped(sl.serialize).escaped; b ++= "]"
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider early return to avoid indentation.

Comment on lines 419 to 426
val argsWithFlag: Array[String] = argsWithoutFlag ++ Array("--no-source-info")

// First, generate CHIRRTL without the flag to verify source info is present
(new ChiselStage)
.execute(
argsWithoutFlag,
Seq(ChiselGeneratorAnnotation(() => new ChiselStageSpec.Foo))
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be cleaner using the non-execute formulation and not writing to disk:

ChiselStage.emitCHIRRTL(new ChiselStageSpec.Foo).fileCheck()("CHECK: @[")

Similarly, the second test is then just:

ChiselStage.emitCHIRRTL(new ChiselStageSpec.Foo, Array("--no-source-info")).fileCheck()("CHECK-NOT: @[")

Comment on lines +51 to +55
override def mimaBinaryIssueFilters = super.mimaBinaryIssueFilters() ++ Seq(
// chisel3.internal.firrtl.ir is package private
ProblemFilter.exclude[DirectMissingMethodProblem]("chisel3.internal.firrtl.ir*"),
ProblemFilter.exclude[MissingTypesProblem]("chisel3.internal.firrtl.ir*")
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I was running into this elsewhere...

@jackkoenig jackkoenig enabled auto-merge (squash) October 14, 2025 21:28
@jackkoenig jackkoenig merged commit 767b9eb into main Oct 14, 2025
16 checks passed
@jackkoenig jackkoenig deleted the jackkoenig/no-source-locators branch October 14, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature, will be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants