aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/python/libghdl/thinutils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vhdl/python/libghdl/thinutils.py b/src/vhdl/python/libghdl/thinutils.py
index be2957512..1e8ee417d 100644
--- a/src/vhdl/python/libghdl/thinutils.py
+++ b/src/vhdl/python/libghdl/thinutils.py
@@ -50,6 +50,17 @@ def attr_image(a):
return _attr_image[a]
+def leftest_location(n):
+ while True:
+ if n == Null_Iir:
+ return No_Location
+ k = iirs.Get_Kind(n)
+ if k == iirs.Iir_Kind.Array_Subtype_Definition:
+ n = iirs.Get_Subtype_Type_Mark(n)
+ else:
+ return iirs.Get_Location(n)
+
+
def fields_iter(n):
"""Iterate on fields of node n"""
if n == Null_Iir: