diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-06-24 22:07:30 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-06-25 18:12:07 +0200 |
commit | cd012609781465b65bbe3b1ef8e1fe4fa9c8398d (patch) | |
tree | 3ad4716784b36ec3a990524bc0a530440c8a3d76 /src/ghdldrv/ghdlcomp.adb | |
parent | 2cc51506353d819639dcfce2d4e9bb9407a67a6d (diff) | |
download | ghdl-cd012609781465b65bbe3b1ef8e1fe4fa9c8398d.tar.gz ghdl-cd012609781465b65bbe3b1ef8e1fe4fa9c8398d.tar.bz2 ghdl-cd012609781465b65bbe3b1ef8e1fe4fa9c8398d.zip |
Error_Msg_Option: do not raise exception.
Diffstat (limited to 'src/ghdldrv/ghdlcomp.adb')
-rw-r--r-- | src/ghdldrv/ghdlcomp.adb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/ghdldrv/ghdlcomp.adb b/src/ghdldrv/ghdlcomp.adb index 619d1afb0..0282736d5 100644 --- a/src/ghdldrv/ghdlcomp.adb +++ b/src/ghdldrv/ghdlcomp.adb @@ -17,6 +17,7 @@ -- 02111-1307, USA. with Ghdlmain; use Ghdlmain; with Ghdllocal; use Ghdllocal; +with Options; use Options; with Ada.Command_Line; @@ -42,13 +43,13 @@ package body Ghdlcomp is procedure Decode_Option (Cmd : in out Command_Comp; Option : String; Arg : String; - Res : out Option_Res); + Res : out Option_State); procedure Disp_Long_Help (Cmd : Command_Comp); procedure Decode_Option (Cmd : in out Command_Comp; Option : String; Arg : String; - Res : out Option_Res) + Res : out Option_State) is pragma Assert (Option'First = 1); begin @@ -159,7 +160,7 @@ package body Ghdlcomp is procedure Decode_Option (Cmd : in out Command_Compile; Option : String; Arg : String; - Res : out Option_Res); + Res : out Option_State); procedure Perform_Action (Cmd : Command_Compile; Args : Argument_List); @@ -182,7 +183,7 @@ package body Ghdlcomp is procedure Decode_Option (Cmd : in out Command_Compile; Option : String; Arg : String; - Res : out Option_Res) + Res : out Option_State) is begin if Option = "-r" or else Option = "-e" then @@ -348,6 +349,7 @@ package body Ghdlcomp is else if Run_Arg <= Args'Last then Error_Msg_Option ("options after unit are ignored"); + raise Option_Error; end if; end if; end Perform_Action; @@ -492,7 +494,7 @@ package body Ghdlcomp is procedure Decode_Option (Cmd : in out Command_Elab; Option : String; Arg : String; - Res : out Option_Res); + Res : out Option_State); procedure Perform_Action (Cmd : Command_Elab; Args : Argument_List); @@ -515,7 +517,7 @@ package body Ghdlcomp is procedure Decode_Option (Cmd : in out Command_Elab; Option : String; Arg : String; - Res : out Option_Res) + Res : out Option_State) is pragma Assert (Option'First = 1); begin @@ -529,10 +531,11 @@ package body Ghdlcomp is -- Silently accepted. Res := Option_Arg; end if; - elsif Option'Length >= 4 - and then Option (1 .. 4) = "-Wl," then + elsif Option'Length >= 4 and then Option (1 .. 4) = "-Wl," + then Error_Msg_Option ("option -Wl is not available when ghdl " & "is not configured with gcc or llvm"); + Res := Option_Err; else Decode_Option (Command_Lib (Cmd), Option, Arg, Res); end if; @@ -553,6 +556,7 @@ package body Ghdlcomp is Hooks.Compile_Elab.all ("-e", Args, Run_Arg); if Run_Arg <= Args'Last then Error_Msg_Option ("options after unit are ignored"); + raise Option_Error; end if; if Flag_Expect_Failure then raise Compilation_Error; @@ -611,7 +615,7 @@ package body Ghdlcomp is begin if Args'Length /= 0 then Error ("--disp-config does not accept any argument"); - raise Errorout.Option_Error; + raise Option_Error; end if; Put_Line ("command_name: " & Ada.Command_Line.Command_Name); |