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

[WIP] tools: move verification and parsing command-line arguments from xDSLOptMain to CommandLineTool #3915

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

compor
Copy link
Collaborator

@compor compor commented Feb 14, 2025

This PR:

  • moves verification and parsing command-line arguments from xDSLOptMain to CommandLineTool

as also discussed in #3866

@compor compor added the tool label Feb 14, 2025
@compor compor self-assigned this Feb 14, 2025
Copy link
Collaborator

@alexarice alexarice left a comment

Choose a reason for hiding this comment

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

I think my preference is still for these checks to happen once in xDSLOptMain.run, instead of being scattered

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (f0a3aac) to head (e28e098).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3915   +/-   ##
=======================================
  Coverage   91.28%   91.28%           
=======================================
  Files         466      466           
  Lines       57985    57985           
  Branches     5566     5566           
=======================================
  Hits        52929    52929           
  Misses       3629     3629           
  Partials     1427     1427           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@compor
Copy link
Collaborator Author

compor commented Feb 14, 2025

I think my preference is still for these checks to happen once in xDSLOptMain.run, instead of being scattered

How do you do it downstream? Do you inherit xDSLOptMain then?
I know xdsl-smt does that, but not sure if that's the recommended practice or what the needs downstream might be.

@superlopuh
Copy link
Member

Why this change? It doesn't make sense for xdsl-run to have parser diagnostics

@compor
Copy link
Collaborator Author

compor commented Feb 14, 2025

Why this change? It doesn't make sense for xdsl-run to have parser diagnostics

True, I'm going to move them back and deal with the parse_chunk diagnostics exception now that #3915 is in

@superlopuh
Copy link
Member

Let's close this in the meantime?

@compor
Copy link
Collaborator Author

compor commented Feb 24, 2025

can't I reuse it to flip things around?

@superlopuh
Copy link
Member

What's the benefit of having it open?

@compor compor marked this pull request as draft February 24, 2025 10:13
@compor compor changed the title tools: move verification and parsing command-line arguments from xDSLOptMain to CommandLineTool [WIP] tools: move verification and parsing command-line arguments from xDSLOptMain to CommandLineTool Feb 24, 2025
@compor
Copy link
Collaborator Author

compor commented Feb 24, 2025

I've moved it to WIP

@alexarice
Copy link
Collaborator

I think my preference is still for these checks to happen once in xDSLOptMain.run, instead of being scattered

How do you do it downstream? Do you inherit xDSLOptMain then?

Sorry, I missed this, I inherit from xDSLOptMain:

class QuoptMain(xDSLOptMain):
    def register_all_dialects(self):
        for name, dialect in get_all_dialects().items():
            self.ctx.register_dialect(name, dialect)

    def register_all_passes(self):
        for name, pass_ in get_all_passes().items():
            self.register_pass(name, pass_)

    def register_all_targets(self):
        super().register_all_targets()

@compor
Copy link
Collaborator Author

compor commented Feb 24, 2025

I think my preference is still for these checks to happen once in xDSLOptMain.run, instead of being scattered

How do you do it downstream? Do you inherit xDSLOptMain then?

Sorry, I missed this, I inherit from xDSLOptMain:

class QuoptMain(xDSLOptMain):
    def register_all_dialects(self):
        for name, dialect in get_all_dialects().items():
            self.ctx.register_dialect(name, dialect)

    def register_all_passes(self):
        for name, pass_ in get_all_passes().items():
            self.register_pass(name, pass_)

    def register_all_targets(self):
        super().register_all_targets()

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants