summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPipeline.hs
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2011-12-29 16:45:30 -0800
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2011-12-29 16:45:30 -0800
commit896d20fabdf0087e8dd33cc419a377b7a9adee88 (patch)
tree6acfc745bb5d75ccc921af6521e5294d2d69da3f /compiler/main/DriverPipeline.hs
parent42186dd64c22f23bbdb15a27e608cb52ba7d617f (diff)
parentb0c0205e3c0dfefc3ffbd49d22160ad5d624ee1f (diff)
downloadhaskell-896d20fabdf0087e8dd33cc419a377b7a9adee88.tar.gz
Merge branch 'master' into type-nats
Conflicts: compiler/typecheck/TcCanonical.lhs compiler/typecheck/TcSMonad.lhs
Diffstat (limited to 'compiler/main/DriverPipeline.hs')
-rw-r--r--compiler/main/DriverPipeline.hs15
1 files changed, 4 insertions, 11 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 2230f3fa40..0e8990777b 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -137,10 +137,7 @@ compile' (nothingCompiler, interactiveCompiler, batchCompiler)
-- We add the directory in which the .hs files resides) to the import path.
-- This is needed when we try to compile the .hc file later, if it
-- imports a _stub.h file that we created here.
- let current_dir = case takeDirectory basename of
- "" -> "." -- XXX Hack required for filepath-1.1 and earlier
- -- (GHC 6.12 and earlier)
- d -> d
+ let current_dir = takeDirectory basename
old_paths = includePaths dflags0
dflags = dflags0 { includePaths = current_dir : old_paths }
hsc_env = hsc_env0 {hsc_dflags = dflags}
@@ -598,8 +595,8 @@ getPipeEnv = P $ \env state -> return (state, env)
getPipeState :: CompPipeline PipeState
getPipeState = P $ \_env state -> return (state, state)
-getDynFlags :: CompPipeline DynFlags
-getDynFlags = P $ \_env state -> return (state, hsc_dflags (hsc_env state))
+instance HasDynFlags CompPipeline where
+ getDynFlags = P $ \_env state -> return (state, hsc_dflags (hsc_env state))
setDynFlags :: DynFlags -> CompPipeline ()
setDynFlags dflags = P $ \_env state ->
@@ -849,11 +846,7 @@ runPhase (Hsc src_flavour) input_fn dflags0
-- we add the current directory (i.e. the directory in which
-- the .hs files resides) to the include path, since this is
-- what gcc does, and it's probably what you want.
- let current_dir = case takeDirectory basename of
- "" -> "." -- XXX Hack required for filepath-1.1 and earlier
- -- (GHC 6.12 and earlier)
- d -> d
-
+ let current_dir = takeDirectory basename
paths = includePaths dflags0
dflags = dflags0 { includePaths = current_dir : paths }