-
Notifications
You must be signed in to change notification settings - Fork 40
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
base: main
Are you sure you want to change the base?
Conversation
I published a new version of tblgen v0.5.0 |
This reverts commit 53668df.
macro/src/dialect.rs
Outdated
parser = parser.add_source( | ||
&input | ||
.files() | ||
.map(|path| format!(r#"include "{path}""#)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This PR refactors dialect macro input.
References
AddIncludeFile
method tblgen-rs-alt#18