diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-11-29 21:16:30 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-11-30 01:27:25 +1100 |
commit | 77ef6ca06d401eda2aeb51d22d5ce033db667161 (patch) | |
tree | 21dd2e159a9b7ec568147b6c27e74dc9da954492 /compiler/main/StaticFlagParser.hs | |
parent | 086d7c54f5bddbc9e5d94a9ae9c4b5aeeab53a35 (diff) | |
download | haskell-77ef6ca06d401eda2aeb51d22d5ce033db667161.tar.gz |
Replace all uses of ghcError with throwGhcException and purge ghcError.
Diffstat (limited to 'compiler/main/StaticFlagParser.hs')
-rw-r--r-- | compiler/main/StaticFlagParser.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/main/StaticFlagParser.hs b/compiler/main/StaticFlagParser.hs index e2414f7f34..76454bdfa5 100644 --- a/compiler/main/StaticFlagParser.hs +++ b/compiler/main/StaticFlagParser.hs @@ -57,10 +57,10 @@ parseStaticFlagsFull :: [Flag IO] -> [Located String] -> IO ([Located String], [Located String]) parseStaticFlagsFull flagsAvailable args = do ready <- readIORef v_opt_C_ready - when ready $ ghcError (ProgramError "Too late for parseStaticFlags: call it before newSession") + when ready $ throwGhcException (ProgramError "Too late for parseStaticFlags: call it before newSession") (leftover, errs, warns) <- processArgs flagsAvailable args - when (not (null errs)) $ ghcError $ errorsToGhcException errs + when (not (null errs)) $ throwGhcException $ errorsToGhcException errs -- see sanity code in staticOpts writeIORef v_opt_C_ready True @@ -129,7 +129,7 @@ decodeSize str | c == "K" || c == "k" = truncate (n * 1000) | c == "M" || c == "m" = truncate (n * 1000 * 1000) | c == "G" || c == "g" = truncate (n * 1000 * 1000 * 1000) - | otherwise = ghcError (CmdLineError ("can't decode size: " ++ str)) + | otherwise = throwGhcException (CmdLineError ("can't decode size: " ++ str)) where (m, c) = span pred str n = readRational m pred c = isDigit c || c == '.' |