Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement filtering of duplicate errors in SilFrontend #778

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/main/scala/viper/silver/frontend/SilFrontend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,30 @@ trait SilFrontend extends DefaultFrontend {
def finish(): Unit = {
val tRes = result.transformedResult()
val res = plugins.beforeFinish(tRes)
_verificationResult = Some(res)
res match {
val filteredRes = res match {
case Success => res
case Failure(errors) =>
Failure(errors.distinctBy(failureFilterAndGroupingCriterion))
}
_verificationResult = Some(filteredRes)
filteredRes match {
case Success =>
reporter report OverallSuccessMessage(verifier.name, getTime)
case f: Failure =>
reporter report OverallFailureMessage(verifier.name, getTime, f)
}
}

private def failureFilterAndGroupingCriterion(e: AbstractError): String = {
// apply transformers if available:
val transformedError = e match {
case e: AbstractVerificationError => e.transformedError()
case e => e
}
// create a string that identifies the given failure:
transformedError.readableMessage
}

protected def parseCommandLine(args: Seq[String]): Unit = {
_config = configureVerifier(args)
}
Expand Down
Loading