diff options
author | Tristan Gingold | 2014-12-30 08:56:04 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-12-30 08:56:04 +0100 |
commit | 4d285e65d71ece770de8d21b506e37b874ee0850 (patch) | |
tree | 3f8e8d7a53549998c71c363027ef337808ac4248 /src/vhdl/iirs.adb | |
parent | 17082aaf70426f2204b4259e45b1ca6e315bd439 (diff) | |
download | ghdl-4d285e65d71ece770de8d21b506e37b874ee0850.tar.gz ghdl-4d285e65d71ece770de8d21b506e37b874ee0850.tar.bz2 ghdl-4d285e65d71ece770de8d21b506e37b874ee0850.zip |
vhdl 2008: handle sized bit strings.
Diffstat (limited to 'src/vhdl/iirs.adb')
-rw-r--r-- | src/vhdl/iirs.adb | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb index 1462bb3..6864213 100644 --- a/src/vhdl/iirs.adb +++ b/src/vhdl/iirs.adb @@ -903,16 +903,58 @@ package body Iirs is begin pragma Assert (Lit /= Null_Iir); pragma Assert (Has_Bit_String_Base (Get_Kind (Lit))); - return Base_Type'Val (Get_State2 (Lit)); + return Base_Type'Val (Get_Odigit1 (Lit)); end Get_Bit_String_Base; procedure Set_Bit_String_Base (Lit : Iir; Base : Base_Type) is begin pragma Assert (Lit /= Null_Iir); pragma Assert (Has_Bit_String_Base (Get_Kind (Lit))); - Set_State2 (Lit, Base_Type'Pos (Base)); + Set_Odigit1 (Lit, Base_Type'Pos (Base)); end Set_Bit_String_Base; + function Get_Has_Signed (Lit : Iir) return Boolean is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Signed (Get_Kind (Lit))); + return Get_Flag1 (Lit); + end Get_Has_Signed; + + procedure Set_Has_Signed (Lit : Iir; Flag : Boolean) is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Signed (Get_Kind (Lit))); + Set_Flag1 (Lit, Flag); + end Set_Has_Signed; + + function Get_Has_Sign (Lit : Iir) return Boolean is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Sign (Get_Kind (Lit))); + return Get_Flag2 (Lit); + end Get_Has_Sign; + + procedure Set_Has_Sign (Lit : Iir; Flag : Boolean) is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Sign (Get_Kind (Lit))); + Set_Flag2 (Lit, Flag); + end Set_Has_Sign; + + function Get_Has_Length (Lit : Iir) return Boolean is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Length (Get_Kind (Lit))); + return Get_Flag3 (Lit); + end Get_Has_Length; + + procedure Set_Has_Length (Lit : Iir; Flag : Boolean) is + begin + pragma Assert (Lit /= Null_Iir); + pragma Assert (Has_Has_Length (Get_Kind (Lit))); + Set_Flag3 (Lit, Flag); + end Set_Has_Length; + function Get_Literal_Origin (Lit : Iir) return Iir is begin pragma Assert (Lit /= Null_Iir); |