Commit 51ac19ae authored by Ian Lynagh's avatar Ian Lynagh

Create the directory for dump files to be put in

Now that we don't necessarily put them in the same place as the source,
the directory may not exist.
parent 668c860b
......@@ -34,7 +34,7 @@ module ErrUtils (
#include "HsVersions.h"
import Bag ( Bag, bagToList, isEmptyBag, emptyBag )
import Util ( sortLe )
import Util
import Outputable
import SrcLoc
import DynFlags
......@@ -234,6 +234,7 @@ dumpSDoc dflags dflag hdr doc
mode = if append then AppendMode else WriteMode
when (not append) $
writeIORef gdref (Set.insert fileName gd)
createDirectoryHierarchy (takeDirectory fileName)
handle <- openFile fileName mode
hPrintDump handle doc
hClose handle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment