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
core: Rename typ
properties to type
#1240
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1240 +/- ##
=======================================
Coverage 88.93% 88.94%
=======================================
Files 175 175
Lines 23642 23590 -52
Branches 3587 3568 -19
=======================================
- Hits 21026 20981 -45
+ Misses 2044 2042 -2
+ Partials 572 567 -5
☔ View full report in Codecov by Sentry. |
I'm curious why this PR also re-orders all imports, are you running a custom formatting script? It would help immensely with reviewing if we only had relevant changes in the diff! |
I'll look at it once the imports changes are removed, but otherwise it looks good to me! |
typ
properties to type
typ
properties to type
The import changes issue is addressed in #1243. Now the only changes should be the apis. |
Let me repeat my recent comment on the issue here:
|
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.
If we want to be consistent, you should also rename all the stray variable names containing typ
or typs
, not sure I catched all of them in my review but you should take a look at this.
@@ -230,7 +230,7 @@ def verify_(self): | |||
raise VerifyException("Expected last op of FuncOp to be a ReturnOp") | |||
|
|||
operand = last_op.input | |||
operand_typ = None if operand is None else operand.typ | |||
operand_typ = None if operand is None else operand.type |
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.
should be named operand_type
here
@@ -86,7 +86,7 @@ def test_llvm_getelementptr_op_invalid_construction(): | |||
def test_llvm_getelementptr_op(): | |||
size = arith.Constant.from_int_and_width(1, 32) | |||
ptr = llvm.AllocaOp.get(size, builtin.i32) | |||
ptr_typ = llvm.LLVMPointerType.typed(ptr.res.typ) | |||
ptr_typ = llvm.LLVMPointerType.typed(ptr.res.type) |
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.
should be named ptr_type
here
assert isinstance(self.result.typ, memref.MemRefType) | ||
typ: memref.MemRefType[Attribute] = self.result.typ | ||
assert isinstance(self.result.type, memref.MemRefType) | ||
typ: memref.MemRefType[Attribute] = self.result.type | ||
ndyn_typ = len([i for i in typ.shape.data if i.value.data == -1]) |
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.
should be named ndyn_type
here
@@ -230,7 +230,7 @@ def verify_(self): | |||
raise VerifyException("Expected last op of FuncOp to be a ReturnOp") | |||
|
|||
operand = last_op.input | |||
operand_typ = None if operand is None else operand.typ | |||
operand_typ = None if operand is None else operand.type | |||
|
|||
return_typs = self.function_type.outputs.data |
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.
should be named return_types
here
|
I personally think that we should use |
Okay, sure. I think my point still stands though. I feel that we will run into cases where this will get annoying, so I would try to circumvent it and do |
I am thinking about the scope of this PR. I think having a class field named |
I think that's exacly @michel-steuwer point here. I believe class fields should be named |
I can do a |
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 closed the issue before seeing this PR, and I actually think that the diff is a strict improvement. I don't feel very strongly about this, but I think we should merge this PR.
This is a follow up to a previous PR #1240 .
Address #1174