When the pipeline just copies the file, prepend a LINE pragma
authorSimon Marlow <simonmar@microsoft.com>
Thu, 15 Feb 2007 11:58:52 +0000 (11:58 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 15 Feb 2007 11:58:52 +0000 (11:58 +0000)
commitcf411c9ae5d61d6e5baa5e5e6b0ad9803b041236
treea7dc996c5446c23cf1270cacd03e6201b23d711b
parent4564c1125761e50897d7542aeb7a5a296965d71e
When the pipeline just copies the file, prepend a LINE pragma
For example, "ghc -E Foo.hs -o Foo.bar" just copies Foo.hs to
Foo.bar.  This patch adds a LINE pragma to the beginning of Foo.bar so
that further processing can track the location of the original file.

The motiviation for this is bug #1044.  When generating Haddock docs,
we preprocess the .hs to a .raw-hs, sometimes this doesn't involve any
actual preprocessing and in those cases we lose track of the original
filename.
compiler/main/DriverPipeline.hs
compiler/main/SysTools.lhs