[PyCDE] Fix two minor issues after merging latest PRs.

First, some code that attempted to store into an instance variable
that no longer exists. This should have been included in the last PR.

Second, flush the stderr stream in the new struct fields test. This
may not have been necessary on its own before, but in my testing with
both PRs integrated, I was observing the struct fields showing up
after the other output, and FileCheck failing.

After these two minor fixes, the tests pass.
This commit is contained in:
Mike Urbach 2021-07-05 21:58:08 -06:00
parent 26acd29cb6
commit 70e7402caf
2 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,6 @@ class _Types:
if len(type_scopes) == 0: if len(type_scopes) == 0:
with mlir.ir.InsertionPoint.at_block_begin(mod.body): with mlir.ir.InsertionPoint.at_block_begin(mod.body):
type_scopes.append(hw.TypeScopeOp.create(self.TYPE_SCOPE)) type_scopes.append(hw.TypeScopeOp.create(self.TYPE_SCOPE))
self.declared_aliases[mod] = set([])
assert len(type_scopes) == 1 assert len(type_scopes) == 1
type_scope = type_scopes[0] type_scope = type_scopes[0]

View File

@ -8,6 +8,7 @@ import sys
st1 = types.struct({"foo": types.i1, "bar": types.i13}) st1 = types.struct({"foo": types.i1, "bar": types.i13})
fields = st1.get_fields() fields = st1.get_fields()
sys.stderr.write(str(fields) + "\n") sys.stderr.write(str(fields) + "\n")
sys.stderr.flush()
st1.get_field("foo").dump() st1.get_field("foo").dump()
print() print()