aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap8.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-28 18:53:20 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-28 18:53:20 +0200
commitb2e6d5df3bd55b51214bcc4c8458cab2561b97bf (patch)
tree724bd1feceeb9f839ac74f777bd940120915e7b3 /src/vhdl/translate/trans-chap8.adb
parent57612b1e15ceef2c7b2a43e2262493d010199d6b (diff)
downloadghdl-b2e6d5df3bd55b51214bcc4c8458cab2561b97bf.tar.gz
ghdl-b2e6d5df3bd55b51214bcc4c8458cab2561b97bf.tar.bz2
ghdl-b2e6d5df3bd55b51214bcc4c8458cab2561b97bf.zip
trans-chap8: reverse_range returns false for is_for_loop_iterator_stable.
Fix #828
Diffstat (limited to 'src/vhdl/translate/trans-chap8.adb')
-rw-r--r--src/vhdl/translate/trans-chap8.adb43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 83cfb0935..8fbd8d105 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -450,28 +450,31 @@ package body Trans.Chap8 is
Constraint : constant Iir := Get_Range_Constraint (Iter_Type);
Name : Iir;
begin
- -- A constraint is either a range expression or a range attribute name.
- pragma Assert (Get_Kind (Constraint) in Iir_Kinds_Range_Attribute);
-
- Name := Get_Prefix (Constraint);
- Name := Get_Base_Name (Name);
-
- case Get_Kind (Name) is
- when Iir_Kind_Implicit_Dereference
- | Iir_Kind_Dereference =>
+ case Iir_Kinds_Range_Attribute (Get_Kind (Constraint)) is
+ when Iir_Kind_Reverse_Range_Array_Attribute =>
+ -- Need to create a reversed range...
return False;
- when Iir_Kind_Function_Call =>
- if not Is_Fully_Constrained_Type (Get_Type (Name)) then
- return False;
- end if;
- when Iir_Kinds_Object_Declaration =>
- null;
- when Iir_Kind_Subtype_Declaration =>
- null;
- when others =>
- Error_Kind ("is_for_loop_iterator_stable(2)", Name);
+ when Iir_Kind_Range_Array_Attribute =>
+ Name := Get_Prefix (Constraint);
+ Name := Get_Base_Name (Name);
+
+ case Get_Kind (Name) is
+ when Iir_Kind_Implicit_Dereference
+ | Iir_Kind_Dereference =>
+ return False;
+ when Iir_Kind_Function_Call =>
+ if not Is_Fully_Constrained_Type (Get_Type (Name)) then
+ return False;
+ end if;
+ when Iir_Kinds_Object_Declaration =>
+ null;
+ when Iir_Kind_Subtype_Declaration =>
+ null;
+ when others =>
+ Error_Kind ("is_for_loop_iterator_stable(2)", Name);
+ end case;
+ return True;
end case;
- return True;
end Is_For_Loop_Iterator_Stable;
function Get_Iterator_Range_Var (Iterator : Iir) return Mnode