Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
1eedbc6b
Commit
1eedbc6b
authored
Nov 24, 2011
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the filename passed to unlit (see comment for details)
parent
3e8303c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
compiler/main/DriverPipeline.hs
compiler/main/DriverPipeline.hs
+14
-3
No files found.
compiler/main/DriverPipeline.hs
View file @
1eedbc6b
...
...
@@ -745,9 +745,7 @@ runPhase (Unlit sf) input_fn dflags
[
-- The -h option passes the file name for unlit to
-- put in a #line directive
SysTools
.
Option
"-h"
-- cpp interprets \b etc as escape sequences,
-- so we use / for filenames in pragmas
,
SysTools
.
Option
$
reslash
Forwards
$
normalise
input_fn
,
SysTools
.
Option
$
escape
$
normalise
input_fn
,
SysTools
.
FileOption
""
input_fn
,
SysTools
.
FileOption
""
output_fn
]
...
...
@@ -755,6 +753,19 @@ runPhase (Unlit sf) input_fn dflags
io
$
SysTools
.
runUnlit
dflags
flags
return
(
Cpp
sf
,
output_fn
)
where
-- escape the characters \, ", and ', but don't try to escape
-- Unicode or anything else (so we don't use Util.charToC
-- here). If we get this wrong, then in
-- Coverage.addTicksToBinds where we check that the filename in
-- a SrcLoc is the same as the source filenaame, the two will
-- look bogusly different. See test:
-- libraries/hpc/tests/function/subdir/tough2.lhs
escape
(
'
\\
'
:
cs
)
=
'
\\
'
:
'
\\
'
:
escape
cs
escape
(
'
\"
'
:
cs
)
=
'
\\
'
:
'
\"
'
:
escape
cs
escape
(
'
\'
'
:
cs
)
=
'
\\
'
:
'
\'
'
:
escape
cs
escape
(
c
:
cs
)
=
c
:
escape
cs
escape
[]
=
[]
-------------------------------------------------------------------------------
-- Cpp phase : (a) gets OPTIONS out of file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment