diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-06-13 12:25:01 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-06-13 16:47:59 +0200 |
commit | e0ca8bf0b0d8049c7e9f7fe53f7ed942fac61453 (patch) | |
tree | b4477194e58e9ca5b0c296caa24da39e5a2e845a /src/vhdl | |
parent | 8eb418a695000718920c2ef5294c185a2ef40cca (diff) | |
download | ghdl-e0ca8bf0b0d8049c7e9f7fe53f7ed942fac61453.tar.gz ghdl-e0ca8bf0b0d8049c7e9f7fe53f7ed942fac61453.tar.bz2 ghdl-e0ca8bf0b0d8049c7e9f7fe53f7ed942fac61453.zip |
vhdl: --std93c is now an alias for --std=93 -frelaxed
This simplifies the definition of --std=93c
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-errors.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-parse.adb | 8 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_assocs.adb | 18 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_decls.adb | 5 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_expr.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_names.adb | 4 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_specs.adb | 10 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_stmts.adb | 6 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_types.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_utils.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-std_package.adb | 12 |
12 files changed, 39 insertions, 34 deletions
diff --git a/src/vhdl/vhdl-errors.adb b/src/vhdl/vhdl-errors.adb index 4e693e932..9806595ac 100644 --- a/src/vhdl/vhdl-errors.adb +++ b/src/vhdl/vhdl-errors.adb @@ -120,7 +120,7 @@ package body Vhdl.Errors is is Level : Msgid_Type; begin - if Flag_Relaxed_Rules or Vhdl_Std = Vhdl_93c then + if Flag_Relaxed_Rules then if not Is_Warning_Enabled (Id) then return; end if; diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb index 9e4a930a9..820594579 100644 --- a/src/vhdl/vhdl-parse.adb +++ b/src/vhdl/vhdl-parse.adb @@ -4200,7 +4200,9 @@ package body Vhdl.Parse is case Current_Token is when Tok_In | Tok_Out | Tok_Inout => - if Flags.Vhdl_Std >= Vhdl_93 then + if Flags.Vhdl_Std /= Vhdl_87 + and then not Flags.Flag_Relaxed_Files87 + then Error_Msg_Parse ("mode allowed only in vhdl 87"); end if; Mode := Parse_Mode; @@ -7478,7 +7480,7 @@ package body Vhdl.Parse is Expect_Scan (Tok_End); Expect_Scan (Tok_Case); - if Flags.Vhdl_Std >= Vhdl_93c then + if Flags.Vhdl_Std >= Vhdl_93 then Check_End_Name (Stmt); end if; @@ -7782,7 +7784,7 @@ package body Vhdl.Parse is Stmt := Parse_If_Statement (Parent); Set_Label (Stmt, Label); Set_Location (Stmt, Loc); - if Flags.Vhdl_Std >= Vhdl_93c then + if Flags.Vhdl_Std >= Vhdl_93 then Check_End_Name (Stmt); end if; when Tok_Case => diff --git a/src/vhdl/vhdl-sem.adb b/src/vhdl/vhdl-sem.adb index 107aa918f..8311e816f 100644 --- a/src/vhdl/vhdl-sem.adb +++ b/src/vhdl/vhdl-sem.adb @@ -560,7 +560,7 @@ package body Vhdl.Sem is Set_Collapse_Signal_Flag (Assoc, False); pragma Assert (Is_Null (Get_Actual_Conversion (Assoc))); - if Flags.Vhdl_Std >= Vhdl_93c then + if Flags.Vhdl_Std >= Vhdl_93 then -- LRM93 1.1.1.2 Ports -- Moreover, the ports of a block may be associated -- with an expression, in order to provide these ports diff --git a/src/vhdl/vhdl-sem_assocs.adb b/src/vhdl/vhdl-sem_assocs.adb index d1e52b646..4a5ccd1e8 100644 --- a/src/vhdl/vhdl-sem_assocs.adb +++ b/src/vhdl/vhdl-sem_assocs.adb @@ -353,7 +353,9 @@ package body Vhdl.Sem_Assocs is -- LRM87 4.3.1.4 -- Such an object is a member of the variable -- class of objects; - if Flags.Vhdl_Std >= Vhdl_93 then + if Flags.Vhdl_Std >= Vhdl_93 + and then not Flags.Flag_Relaxed_Files87 + then Error_Msg_Sem (+Assoc, "variable parameter cannot be a " & "file (vhdl93)"); @@ -372,9 +374,12 @@ package body Vhdl.Sem_Assocs is null; when Iir_Kind_Variable_Declaration | Iir_Kind_Interface_Variable_Declaration => - if Flags.Vhdl_Std >= Vhdl_93 then - Error_Msg_Sem (+Assoc, "file parameter " - & "must be a file (vhdl93)"); + if Flags.Vhdl_Std >= Vhdl_93 + and then not Flags.Flag_Relaxed_Files87 + then + Error_Msg_Sem + (+Assoc, + "file parameter must be a file (vhdl93)"); end if; when others => Error_Msg_Sem @@ -492,7 +497,7 @@ package body Vhdl.Sem_Assocs is pragma Assert (Amode /= Iir_Unknown_Mode); case Flags.Vhdl_Std is - when Vhdl_87 | Vhdl_93c | Vhdl_93 | Vhdl_00 => + when Vhdl_87 | Vhdl_93 | Vhdl_00 => if Vhdl93_Assocs_Map (Fmode, Amode) then return True; end if; @@ -544,9 +549,8 @@ package body Vhdl.Sem_Assocs is -- (during elaboration). -- In vhdl08, the subtypes must be compatible. Use the that rule - -- for 93c and relaxed rules. + -- for relaxed rules. if Vhdl_Std >= Vhdl_08 - or else Vhdl_Std = Vhdl_93c or else Flag_Relaxed_Rules then return Eval_Is_Range_In_Bound (Src, Dest, True); diff --git a/src/vhdl/vhdl-sem_decls.adb b/src/vhdl/vhdl-sem_decls.adb index 84354c2da..c7bd4ce43 100644 --- a/src/vhdl/vhdl-sem_decls.adb +++ b/src/vhdl/vhdl-sem_decls.adb @@ -279,6 +279,7 @@ package body Vhdl.Sem_Decls is -- parameter includes the reserved word BUS. if Flags.Vhdl_Std >= Vhdl_93 and then Interface_Kind in Parameter_Interface_List + and then not Flags.Flag_Relaxed_Rules then Error_Msg_Sem (+Inter, "signal parameter can't be of kind bus"); @@ -307,7 +308,9 @@ package body Vhdl.Sem_Decls is when Iir_Kind_Interface_Variable_Declaration => case Get_Kind (Get_Base_Type (A_Type)) is when Iir_Kind_File_Type_Definition => - if Flags.Vhdl_Std >= Vhdl_93 then + if Flags.Vhdl_Std >= Vhdl_93 + and then not Flags.Flag_Relaxed_Rules + then Error_Msg_Sem (+Inter, "variable formal can't be a file (vhdl 93)"); diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index f80a8bc2e..b7560904f 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -842,7 +842,7 @@ package body Vhdl.Sem_Expr is -- predefined type INTEGER is assumed if the type of both bounds -- (prior the implicit conversion) is the type universal_integer. null; - elsif Vhdl_Std = Vhdl_93c or else Flag_Relaxed_Rules then + elsif Flag_Relaxed_Rules then null; elsif Vhdl_Std /= Vhdl_93 then -- GHDL: this is not allowed, however often used: diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index c34e7a958..657eea53d 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -4035,9 +4035,7 @@ package body Vhdl.Sem_Names is -- and whose suffix is one of the predefined attributes 'DELAYED, -- 'STABLE, 'QUIET or 'TRANSACTION. -- According to LRM 6.1, attributes are not static names. - if Flags.Vhdl_Std = Vhdl_93c or Flag_Relaxed_Rules - or Flags.Vhdl_Std >= Vhdl_02 - then + if Flag_Relaxed_Rules or Flags.Vhdl_Std >= Vhdl_02 then case Get_Kind (Res) is when Iir_Kind_Stable_Attribute | Iir_Kind_Quiet_Attribute diff --git a/src/vhdl/vhdl-sem_specs.adb b/src/vhdl/vhdl-sem_specs.adb index eca951a2b..f3fb7bf30 100644 --- a/src/vhdl/vhdl-sem_specs.adb +++ b/src/vhdl/vhdl-sem_specs.adb @@ -365,10 +365,10 @@ package body Vhdl.Sem_Specs is Set_Attribute_Value_Spec_Chain (Attr, El); -- Special handling for 'Foreign. - if (Flags.Vhdl_Std >= Vhdl_93c + if (Flags.Vhdl_Std >= Vhdl_93 and then Attr_Decl = Foreign_Attribute) or else - (Flags.Vhdl_Std <= Vhdl_93c + (Flags.Vhdl_Std <= Vhdl_93 and then Get_Identifier (Attr_Decl) = Std_Names.Name_Foreign) then -- LRM93 12.4 @@ -769,7 +769,7 @@ package body Vhdl.Sem_Specs is Inter : Name_Interpretation_Type; Decl : Iir; begin - if Flag_Relaxed_Rules or Vhdl_Std = Vhdl_93c then + if Flag_Relaxed_Rules then -- Some (clueless ?) vendors put attribute specifications in -- architectures for ports (declared in entities). This is not -- valid according to the LRM (eg: LRM02 5.1 Attribute @@ -2003,8 +2003,8 @@ package body Vhdl.Sem_Specs is -- containing the design unit in which the component C is -- declared. if Flags.Flag_Syn_Binding + or Flags.Flag_Relaxed_Rules or Flags.Vhdl_Std >= Vhdl_02 - or Flags.Vhdl_Std = Vhdl_93c then -- Find target library. Target_Lib := Comp; @@ -2077,7 +2077,7 @@ package body Vhdl.Sem_Specs is -- containing the design unit in which the component C is -- declared. if Flags.Vhdl_Std >= Vhdl_02 - or else Flags.Vhdl_Std = Vhdl_93c + or else Flags.Flag_Relaxed_Rules then Decl := Comp; while Get_Kind (Decl) /= Iir_Kind_Library_Declaration loop diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb index 829bf2d20..fbee2e756 100644 --- a/src/vhdl/vhdl-sem_stmts.adb +++ b/src/vhdl/vhdl-sem_stmts.adb @@ -1031,10 +1031,8 @@ package body Vhdl.Sem_Stmts is end if; -- GHDL: I don't understand why the indexing expressions -- must be locally static. So I don't check this in 93c. - if Flags.Vhdl_Std /= Vhdl_93c - and then - (Get_Expr_Staticness - (Get_Nth_Element (Get_Index_List (Expr), 0)) /= Locally) + if (Get_Expr_Staticness + (Get_Nth_Element (Get_Index_List (Expr), 0)) /= Locally) then Error_Msg_Sem (+Expr, "indexing expression must be locally static"); diff --git a/src/vhdl/vhdl-sem_types.adb b/src/vhdl/vhdl-sem_types.adb index 1d8bb3a33..a0b9a1c4d 100644 --- a/src/vhdl/vhdl-sem_types.adb +++ b/src/vhdl/vhdl-sem_types.adb @@ -1364,7 +1364,7 @@ package body Vhdl.Sem_Types is end if; -- LRM93 2.4 -- A resolution function must be a [pure] function; - if Flags.Vhdl_Std >= Vhdl_93 and then Get_Pure_Flag (Func) = False then + if not Flags.Flag_Relaxed_Rules and then not Get_Pure_Flag (Func) then if Atype /= Null_Iir then Error_Msg_Sem (+Atype, "resolution %n must be pure", +Func); end if; diff --git a/src/vhdl/vhdl-sem_utils.adb b/src/vhdl/vhdl-sem_utils.adb index bd4f20eef..a20aea369 100644 --- a/src/vhdl/vhdl-sem_utils.adb +++ b/src/vhdl/vhdl-sem_utils.adb @@ -147,7 +147,7 @@ package body Vhdl.Sem_Utils is Last := Decl; Loc := Get_Location (Decl); - if Flags.Vhdl_Std >= Vhdl_93c then + if Flags.Vhdl_Std >= Vhdl_93 then for I in 1 .. 2 loop -- Create the implicit file_open (form 1) declaration. -- Create the implicit file_open (form 2) declaration. diff --git a/src/vhdl/vhdl-std_package.adb b/src/vhdl/vhdl-std_package.adb index f2ba54382..1fc5fcd8a 100644 --- a/src/vhdl/vhdl-std_package.adb +++ b/src/vhdl/vhdl-std_package.adb @@ -868,7 +868,7 @@ package body Vhdl.Std_Package is Constraint : Iir_Range_Expression; begin - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then Time_Staticness := Globally; else Time_Staticness := Locally; @@ -953,7 +953,7 @@ package body Vhdl.Std_Package is -- VHDL93 -- subtype DELAY_LENGTH is TIME range 0 to TIME'HIGH - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then Delay_Length_Subtype_Definition := Create_Std_Iir (Iir_Kind_Physical_Subtype_Definition); Set_Subtype_Type_Mark @@ -1258,7 +1258,7 @@ package body Vhdl.Std_Package is -- VHDL93: -- type file_open_kind is (read_mode, write_mode, append_mode); - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then File_Open_Kind_Type_Definition := Create_Std_Iir (Iir_Kind_Enumeration_Type_Definition); Set_Base_Type (File_Open_Kind_Type_Definition, @@ -1297,7 +1297,7 @@ package body Vhdl.Std_Package is -- VHDL93: -- type file_open_status is -- (open_ok, status_error, name_error, mode_error); - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then File_Open_Status_Type_Definition := Create_Std_Iir (Iir_Kind_Enumeration_Type_Definition); Set_Base_Type (File_Open_Status_Type_Definition, @@ -1337,7 +1337,7 @@ package body Vhdl.Std_Package is -- VHDL93: -- attribute FOREIGN: string; - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then Foreign_Attribute := Create_Std_Decl (Iir_Kind_Attribute_Declaration); Set_Std_Identifier (Foreign_Attribute, Name_Foreign); Set_Type_Mark (Foreign_Attribute, @@ -1445,7 +1445,7 @@ package body Vhdl.Std_Package is Change_Unit (Get_Right_Limit (Rng), Prim); -- Adjust range of DELAY_LENGTH. - if Vhdl_Std >= Vhdl_93c then + if Vhdl_Std >= Vhdl_93 then Rng := Get_Range_Constraint (Delay_Length_Subtype_Definition); Change_Unit (Get_Left_Limit (Rng), Prim); Change_Unit (Get_Right_Limit (Rng), Prim); |