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

Refactor dialect macro input #655

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

raviqqe
Copy link
Member

@raviqqe raviqqe commented Jan 6, 2025

This PR refactors dialect macro input.

References

@edg-l
Copy link
Member

edg-l commented Jan 7, 2025

I published a new version of tblgen v0.5.0

This reverts commit 53668df.
parser = parser.add_source(
&input
.files()
.map(|path| format!(r#"include "{path}""#))
Copy link
Member Author

@raviqqe raviqqe Jan 8, 2025

Choose a reason for hiding this comment

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

I noticed that the llvm::SourceMgr class doens't actually handle "multiple files" but there is only one main file and other complementary files in there. So we didn't have to fix the TableGenParser::add_source_file. method...

For now, we fall back to the original approach of defining the main file on the fly with a bunch of include statements.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, now I wonder if we should expose the add_source and add_source_file methods of TableGenParser in the current way because it's confusing and only the first call of the method makes sense in most cases.

@raviqqe raviqqe marked this pull request as ready for review January 8, 2025 11:14
@raviqqe raviqqe requested a review from edg-l January 8, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants