[project @ 2005-10-25 12:48:35 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / CodeOutput.lhs
index fbda3f1..ce12d0c 100644 (file)
@@ -36,7 +36,7 @@ import ErrUtils               ( dumpIfSet_dyn, showPass, ghcExit )
 import Outputable
 import Pretty          ( Mode(..), printDoc )
 import Module          ( Module )
-import ListSetOps      ( removeDupsEq )
+import List            ( nub )
 import Maybes          ( firstJust )
 
 import Directory       ( doesFileExist )
@@ -71,7 +71,7 @@ codeOutput dflags this_mod foreign_stubs pkg_deps flat_abstractC
                ; let lints = map cmmLint flat_abstractC
                ; case firstJust lints of
                        Just err -> do { printDump err
-                                      ; ghcExit 1
+                                      ; ghcExit dflags 1
                                       }
                        Nothing  -> return ()
                }
@@ -131,7 +131,7 @@ outputC dflags filenm flat_absC
           ffi_decl_headers 
              = case foreign_stubs of
                  NoStubs                 -> []
-                 ForeignStubs _ _ fdhs _ -> map unpackFS (fst (removeDupsEq fdhs))
+                 ForeignStubs _ _ fdhs _ -> map unpackFS (nub fdhs)
                        -- Remove duplicates, because distinct foreign import decls
                        -- may cite the same #include.  Order doesn't matter.