From: simonmar Date: Mon, 8 Oct 2001 13:24:53 +0000 (+0000) Subject: [project @ 2001-10-08 13:24:53 by simonmar] X-Git-Tag: Approximately_9120_patches~856 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=72964542c99ae86d412698694820fcad8a3c284a;hp=1f5a36d0a924ae056240b8e3e5c18607558dc9e2;p=ghc-hetmet.git [project @ 2001-10-08 13:24:53 by simonmar] Don't panic when an out-of-range optimisation level is requested. --- 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*