diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-01-08 04:22:40 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-01-08 04:22:40 +0100 |
commit | 19211ffc421560405aee966ee742ae849c73a31c (patch) | |
tree | 1036f20b80fd8133c94fccb8e4ff6a9cc226818d /sem_assocs.adb | |
parent | 429a5e4a2d7714915b45b33869f06f954c29a316 (diff) | |
download | ghdl-19211ffc421560405aee966ee742ae849c73a31c.tar.gz ghdl-19211ffc421560405aee966ee742ae849c73a31c.tar.bz2 ghdl-19211ffc421560405aee966ee742ae849c73a31c.zip |
Rework literal typing (and initial work for condition operator).
Diffstat (limited to 'sem_assocs.adb')
-rw-r--r-- | sem_assocs.adb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sem_assocs.adb b/sem_assocs.adb index c4a9bce74..178bf6d2c 100644 --- a/sem_assocs.adb +++ b/sem_assocs.adb @@ -1204,7 +1204,6 @@ package body Sem_Assocs is Formal : Iir; Formal_Type : Iir; Actual: Iir; - Actual_Types : Iir; Out_Conv, In_Conv : Iir; Expr : Iir; Res_Type : Iir; @@ -1267,12 +1266,7 @@ package body Sem_Assocs is -- Extract conversion from actual. Actual := Get_Actual (Assoc); - Actual_Types := Get_Type (Actual); In_Conv := Null_Iir; - if Actual_Types = Null_Iir then - Match := False; - return; - end if; if Get_Kind (Inter) /= Iir_Kind_Constant_Interface_Declaration then case Get_Kind (Actual) is when Iir_Kind_Function_Call => @@ -1289,7 +1283,6 @@ package body Sem_Assocs is when others => null; end case; - Actual_Types := Get_Type (Actual); end if; -- 4 cases: F:out_conv, G:in_conv. @@ -1298,16 +1291,16 @@ package body Sem_Assocs is -- A => G(B) type of A = type of G -- F(A) => G(B) type of B = type of F, type of A = type of G if Out_Conv = Null_Iir and then In_Conv = Null_Iir then - Match := Compatibility_Types (Formal_Type, Actual_Types); + Match := Is_Expr_Compatible (Formal_Type, Actual); else Match := True; if In_Conv /= Null_Iir then - if not Compatibility_Types (Formal_Type, Get_Type (In_Conv)) then + if not Is_Expr_Compatible (Formal_Type, In_Conv) then Match := False; end if; end if; if Out_Conv /= Null_Iir then - if not Compatibility_Types (Get_Type (Out_Conv), Actual_Types) then + if not Is_Expr_Compatible (Get_Type (Out_Conv), Actual) then Match := False; end if; end if; @@ -1337,9 +1330,9 @@ package body Sem_Assocs is else if Out_Conv /= Null_Iir then Res_Type := Search_Compatible_Type (Get_Type (Out_Conv), - Actual_Types); + Get_Type (Actual)); else - Res_Type := Actual_Types; + Res_Type := Get_Type (Actual); end if; if In_Conv /= Null_Iir then |