Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Artem Pyanykh
GHC
Commits
0a4c03a8
Commit
0a4c03a8
authored
18 years ago
by
David Himmelstrup
Browse files
Options
Downloads
Patches
Plain Diff
Add a C++ phase. Fixes bug #800
parent
55b21ce8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/main/DriverPhases.hs
+7
-3
7 additions, 3 deletions
compiler/main/DriverPhases.hs
compiler/main/DriverPipeline.hs
+3
-2
3 additions, 2 deletions
compiler/main/DriverPipeline.hs
with
10 additions
and
5 deletions
compiler/main/DriverPhases.hs
+
7
−
3
View file @
0a4c03a8
...
...
@@ -71,6 +71,7 @@ data Phase
|
Cpp
HscSource
|
HsPp
HscSource
|
Hsc
HscSource
|
Ccpp
|
Cc
|
HCc
-- Haskellised C (as opposed to vanilla C) compilation
|
Mangle
-- assembly mangling, now done by a separate script.
...
...
@@ -99,6 +100,7 @@ eqPhase (Unlit _) (Unlit _) = True
eqPhase
(
Cpp
_
)
(
Cpp
_
)
=
True
eqPhase
(
HsPp
_
)
(
HsPp
_
)
=
True
eqPhase
(
Hsc
_
)
(
Hsc
_
)
=
True
eqPhase
Ccpp
Ccpp
=
True
eqPhase
Cc
Cc
=
True
eqPhase
HCc
HCc
=
True
eqPhase
Mangle
Mangle
=
True
...
...
@@ -129,6 +131,7 @@ nextPhase Mangle = SplitMangle
nextPhase
SplitMangle
=
As
nextPhase
As
=
SplitAs
nextPhase
SplitAs
=
StopLn
nextPhase
Ccpp
=
As
nextPhase
Cc
=
As
nextPhase
CmmCpp
=
Cmm
nextPhase
Cmm
=
HCc
...
...
@@ -145,10 +148,10 @@ startPhase "hspp" = Hsc HsSrcFile
startPhase
"hcr"
=
Hsc
ExtCoreFile
startPhase
"hc"
=
HCc
startPhase
"c"
=
Cc
startPhase
"cpp"
=
Cc
startPhase
"cpp"
=
Cc
pp
startPhase
"C"
=
Cc
startPhase
"cc"
=
Cc
startPhase
"cxx"
=
Cc
startPhase
"cc"
=
Cc
pp
startPhase
"cxx"
=
Cc
pp
startPhase
"raw_s"
=
Mangle
startPhase
"split_s"
=
SplitMangle
startPhase
"s"
=
As
...
...
@@ -171,6 +174,7 @@ phaseInputExt (Hsc _) = "hspp" -- intermediate only
-- because runPipeline uses the StopBefore phase to pick the
-- output filename. That could be fixed, but watch out.
phaseInputExt
HCc
=
"hc"
phaseInputExt
Ccpp
=
"cpp"
phaseInputExt
Cc
=
"c"
phaseInputExt
Mangle
=
"raw_s"
phaseInputExt
SplitMangle
=
"split_s"
-- not really generated
...
...
This diff is collapsed.
Click to expand it.
compiler/main/DriverPipeline.hs
+
3
−
2
View file @
0a4c03a8
...
...
@@ -789,7 +789,7 @@ runPhase Cmm stop dflags basename suff input_fn get_output_fn maybe_loc
-- way too many hacks, and I can't say I've ever used it anyway.
runPhase
cc_phase
stop
dflags
basename
suff
input_fn
get_output_fn
maybe_loc
|
cc_phase
`
eqPhase
`
Cc
||
cc_phase
`
eqPhase
`
HCc
|
cc_phase
`
eqPhase
`
Cc
||
cc_phase
`
eqPhase
`
Ccpp
||
cc_phase
`
eqPhase
`
HCc
=
do
let
cc_opts
=
getOpts
dflags
opt_c
hcc
=
cc_phase
`
eqPhase
`
HCc
...
...
@@ -851,7 +851,8 @@ runPhase cc_phase stop dflags basename suff input_fn get_output_fn maybe_loc
-- compiling .hc files, by adding the -x c option.
-- Also useful for plain .c files, just in case GHC saw a
-- -x c option.
[
SysTools
.
Option
"-x"
,
SysTools
.
Option
"c"
]
++
[
SysTools
.
Option
"-x"
,
if
cc_phase
`
eqPhase
`
Ccpp
then
SysTools
.
Option
"c++"
else
SysTools
.
Option
"c"
]
++
[
SysTools
.
FileOption
""
input_fn
,
SysTools
.
Option
"-o"
,
SysTools
.
FileOption
""
output_fn
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment