Discussion:
[Xcb] [PATCH proto 1/1] move symboltable lookup of sumof expr to the parser
Christian Linhart
2017-01-20 13:55:55 UTC
Permalink
Set the lenfield of a sumof expression object, so that
libxcb or other generators won't need to look it up.

This object is trivially available in the parser but
needs a complex lookup in generators.

Signed-off-by: Christian Linhart <***@demorecorder.com>
---
xcbgen/expr.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index a716d34..bf46c63 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
@@ -165,11 +165,12 @@ class Expression(object):
if self.lenfield_name in fields.keys():
if p.is_case_or_bitcase:
# switch is the anchestor
self.lenfield_parent = p.parents[-1]
else:
self.lenfield_parent = p
self.lenfield_type = fields[self.lenfield_name].field_type
+ self.lenfield = fields[self.lenfield_name]
break

self.recursive_resolve_tasks(module, parents)
--
2.1.4
Christian Linhart
2017-03-11 10:28:43 UTC
Permalink
I have just pushed this patch.

This patch has had enough time for review, therefore applying review-by-crickets.

Chris
Post by Christian Linhart
Set the lenfield of a sumof expression object, so that
libxcb or other generators won't need to look it up.
This object is trivially available in the parser but
needs a complex lookup in generators.
---
xcbgen/expr.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index a716d34..bf46c63 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
# switch is the anchestor
self.lenfield_parent = p.parents[-1]
self.lenfield_parent = p
self.lenfield_type = fields[self.lenfield_name].field_type
+ self.lenfield = fields[self.lenfield_name]
break
self.recursive_resolve_tasks(module, parents)
Loading...