llvm / llvm/circt

Errors should fail passes/tools, how to best make this easy to always happen?

Open
#4,553 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

If we emit an error, the pass (/tool) should fail, otherwise it should be a warning.
(this isn't meant to be a controversial claim)

This isn't the case all the time presently, and isn't enforced/checked by test cases checking diagnostics. It would be good if we could check this at least for tests explicitly verifying error conditions (`-verify-diagnostics` tweak?), or through some support work regarding how errors are emitted.

For errors emitted from passes this should already happen and should be checked during review (+perhaps an audit of what we have now).

Sometimes errors are emitted from helpers or other locations and don't have "good" ways to report failure back upwards (and may not be invoked from a pass). It may not be possible to reach everywhere, but those should be the exceptions (and maybe try to avoid this in new code).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the -verify-diagnostics behavior and the pass/tool diagnostic emission paths described in the issue. Define how diagnostic tests should enforce that emitted errors fail their pass or tool, and document or test the exceptional helper cases where failure cannot be propagated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.