aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/errorout.ads4
-rw-r--r--src/vhdl/vhdl-sem_assocs.adb19
-rw-r--r--src/vhdl/vhdl-sem_assocs.ads8
-rw-r--r--src/vhdl/vhdl-sem_specs.adb4
4 files changed, 26 insertions, 9 deletions
diff --git a/src/errorout.ads b/src/errorout.ads
index f6735c8b5..8cda8e69d 100644
--- a/src/errorout.ads
+++ b/src/errorout.ads
@@ -122,6 +122,9 @@ package Errorout is
-- be triggered.
Warnid_Useless,
+ -- Missing association for a formal.
+ Warnid_No_Assoc,
+
-- Violation of staticness rules
Warnid_Static,
@@ -324,6 +327,7 @@ private
| Warnid_Others | Warnid_Reserved_Word | Warnid_Directive
| Warnid_Parenthesis | Warnid_Delayed_Checks | Warnid_Default_Binding
| Warnid_Vital_Generic | Warnid_Missing_Xref
+ | Warnid_No_Assoc
| Warnid_Unused => (Enabled => False, Error => False));
-- Compute the column from Error_Record E.
diff --git a/src/vhdl/vhdl-sem_assocs.adb b/src/vhdl/vhdl-sem_assocs.adb
index a667345a2..7af5ecca6 100644
--- a/src/vhdl/vhdl-sem_assocs.adb
+++ b/src/vhdl/vhdl-sem_assocs.adb
@@ -2724,7 +2724,8 @@ package body Vhdl.Sem_Assocs is
Pos := 0;
while Inter /= Null_Iir loop
if Inter_Matched (Pos) <= Open then
- if Sem_Check_Missing_Association (Inter, Missing, Finish, Loc)
+ if Sem_Check_Missing_Association
+ (Inter, Missing, Finish, Inter_Matched (Pos) = Open, Loc)
then
Match := Not_Compatible;
if not Finish then
@@ -2738,9 +2739,11 @@ package body Vhdl.Sem_Assocs is
end loop;
end Sem_Association_Chain;
- function Sem_Check_Missing_Association
- (Inter : Iir; Missing : Missing_Type; Finish : Boolean; Loc : Iir)
- return Boolean
+ function Sem_Check_Missing_Association (Inter : Iir;
+ Missing : Missing_Type;
+ Finish : Boolean;
+ Is_Open : Boolean;
+ Loc : Iir) return Boolean
is
Err : Boolean;
begin
@@ -2770,6 +2773,10 @@ package body Vhdl.Sem_Assocs is
Error_Msg_Sem
(+Loc, "%n of mode IN must be connected", +Inter);
Err := True;
+ elsif not Is_Open then
+ Warning_Msg_Sem
+ (Warnid_No_Assoc, +Loc,
+ "%n of mode IN is not connected", +Inter);
end if;
when Iir_Out_Mode
| Iir_Linkage_Mode
@@ -2783,6 +2790,10 @@ package body Vhdl.Sem_Assocs is
(+Loc,
"unconstrained %n must be connected", +Inter);
Err := True;
+ elsif not Is_Open then
+ Warning_Msg_Sem
+ (Warnid_No_Assoc, +Loc,
+ "%n of mode OUT is not connected", +Inter);
end if;
when Iir_Unknown_Mode =>
raise Internal_Error;
diff --git a/src/vhdl/vhdl-sem_assocs.ads b/src/vhdl/vhdl-sem_assocs.ads
index f59ecb3d3..fc334d828 100644
--- a/src/vhdl/vhdl-sem_assocs.ads
+++ b/src/vhdl/vhdl-sem_assocs.ads
@@ -98,7 +98,9 @@ package Vhdl.Sem_Assocs is
-- INTER is an interface that is known not to be associated.
-- Report an error according to MISSING iff FINISH is true.
-- Return True iff not associating INTER is an error.
- function Sem_Check_Missing_Association
- (Inter : Iir; Missing : Missing_Type; Finish : Boolean; Loc : Iir)
- return Boolean;
+ function Sem_Check_Missing_Association (Inter : Iir;
+ Missing : Missing_Type;
+ Finish : Boolean;
+ Is_Open : Boolean;
+ Loc : Iir) return Boolean;
end Vhdl.Sem_Assocs;
diff --git a/src/vhdl/vhdl-sem_specs.adb b/src/vhdl/vhdl-sem_specs.adb
index 38a808440..9418fb9de 100644
--- a/src/vhdl/vhdl-sem_specs.adb
+++ b/src/vhdl/vhdl-sem_specs.adb
@@ -1350,7 +1350,7 @@ package body Vhdl.Sem_Specs is
end Sem_Entity_Aspect;
procedure Sem_Check_Missing_Generic_Association
- (Inter_Chain : Iir; Assoc1 : Iir; Assoc2 : Iir; Loc : Iir)
+ (Inter_Chain : Iir; Assoc1 : Iir; Assoc2 : Iir; Loc : Iir)
is
Inter : Iir;
Inter_Iter : Iir;
@@ -1389,7 +1389,7 @@ package body Vhdl.Sem_Specs is
if Get_Open_Flag (Inter) then
Set_Open_Flag (Inter, False);
Err := Sem_Check_Missing_Association
- (Inter, Missing_Generic, True, Loc);
+ (Inter, Missing_Generic, True, False, Loc);
end if;
Inter := Get_Chain (Inter);
end loop;