Skip to content

[mlir] Make StringRefParameter roundtrippable #65813

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

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

zero9178
Copy link
Member

@zero9178 zero9178 commented Sep 8, 2023

The current printer of StringRefParameter simply prints out the content of the string as is without escaping it any way. This leads to it generating invalid syntax, causing parser errors when read in again.

This PR fixes that by adding printString to AsmPrinter, allowing one to print a string that can be parsed with parseString, using the same escaping syntax as StringAttr.

The current printer of `StringRefParameter` simply prints out the content of the string as is without escaping it any way. This leads to it generating invalid syntax, causing parser errors when read in again.

This PR fixes that by adding ´printString` to `AsmPrinter`, allowing one to print a string that can be parsed with `parseString`, using the same escaping syntax as `StringAttr`.
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.

2 participants