From 72964542c99ae86d412698694820fcad8a3c284a Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 8 Oct 2001 13:24:53 +0000 Subject: [PATCH] [project @ 2001-10-08 13:24:53 by simonmar] Don't panic when an out-of-range optimisation level is requested. --- ghc/compiler/main/DriverFlags.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index d86d595..461a70d 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,7 +1,7 @@ {-# OPTIONS -#include "hschooks.h" #-} ----------------------------------------------------------------------------- --- $Id: DriverFlags.hs,v 1.73 2001/10/01 13:57:13 rrt Exp $ +-- $Id: DriverFlags.hs,v 1.74 2001/10/08 13:24:53 simonmar Exp $ -- -- Driver flags -- @@ -463,7 +463,8 @@ buildStaticHscOpts = do 0 -> hsc_minusNoO_flags 1 -> hsc_minusO_flags 2 -> hsc_minusO2_flags - _ -> error "unknown opt level" + n -> throwDyn (CmdLineError ("unknown optimisation level: " + ++ show n)) -- ToDo: -Ofile -- take into account -fno-* flags by removing the equivalent -f* -- 1.7.10.4