-
Notifications
You must be signed in to change notification settings - Fork 319
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
Allow adding comments to generated IR #963
Conversation
As titled.
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.
Looks good. A few tiny nitpicks and one question:
does this need a documentation update?
llvmlite/tests/test_ir.py
Outdated
block = self.block(name='my_block') | ||
builder = ir.IRBuilder(block) | ||
with self.assertRaises(AssertionError): | ||
builder.comment("so\nmany\nlines") |
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.
Please use only a single \n
here to ensure the test works with only a single new line.
llvmlite/tests/test_ir.py
Outdated
builder = ir.IRBuilder(block) | ||
with self.assertRaises(AssertionError): | ||
builder.comment("so\nmany\nlines") | ||
builder.comment("yo!") |
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.
builder.comment("yo!") | |
builder.comment("my comment") |
I would appreciate if you could use slightly less "street" style vernacular here.
llvmlite/tests/test_ir.py
Outdated
builder.ret_void() | ||
self.check_block(block, """\ | ||
my_block: | ||
; yo! |
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.
; yo! | |
; my comment |
As titled.
What documentation would need updating? |
The documentation for llvmlite isn't generated automatically, so I think this will need an entry for the https://llvmlite.readthedocs.io/en/latest/user-guide/ir/ir-builder.html#miscellaneous |
I have made an issue to track that the llvmlite docs should be moved to use |
@apmasell this looks good. One last request: can you synchronise the docstring in the code-base and the text in the RST based documentation? I.e. such that they have the same verbatim text. That would save some time when we move to |
As titled.
Okay. Synchronized. |
Great, waiting for CI and will then merge! |
As titled.
@apmasell looks like flake8 is reporting some tabs and space mixing:
|
Fixed. |
As titled.
Closes #962