I was implementing the same enum support in broadcom's gen_pack_header.py,
and did this same simplification there.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
self.instruction = None
self.structs = {}
- self.enums = {}
+ # Set of enum names we've seen.
+ self.enums = set()
self.registers = {}
def gen_prefix(self, name):
elif name == "enum":
self.values = []
self.enum = safe_name(attrs["name"])
- self.enums[attrs["name"]] = 1
+ self.enums.add(attrs["name"])
if "prefix" in attrs:
self.prefix = safe_name(attrs["prefix"])
else: