Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
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
clean-and-itasks
clean-ide
Commits
97ed2178
Commit
97ed2178
authored
Feb 06, 2019
by
John van Groningen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Add support for bytecode generation to cpm and IDE See merge request
!9
parents
ee702065
936b9ba7
Pipeline
#18420
passed with stage
in 47 seconds
Changes
23
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
463 additions
and
44 deletions
+463
-44
BatchBuild/IdeState.dcl
BatchBuild/IdeState.dcl
+4
-0
BatchBuild/IdeState.icl
BatchBuild/IdeState.icl
+20
-0
Ide/IdeState.dcl
Ide/IdeState.dcl
+4
-0
Ide/IdeState.icl
Ide/IdeState.icl
+20
-0
Ide/PmDialogues.icl
Ide/PmDialogues.icl
+33
-5
Ide/targetui.icl
Ide/targetui.icl
+68
-17
MacOSX/PmCleanSystem.dcl
MacOSX/PmCleanSystem.dcl
+2
-0
MacOSX/PmCleanSystem.icl
MacOSX/PmCleanSystem.icl
+55
-0
Pm/PmDriver.icl
Pm/PmDriver.icl
+82
-2
Pm/PmEnvironment.dcl
Pm/PmEnvironment.dcl
+4
-0
Pm/PmEnvironment.icl
Pm/PmEnvironment.icl
+17
-1
Pm/PmFileInfo.dcl
Pm/PmFileInfo.dcl
+1
-0
Pm/PmFileInfo.icl
Pm/PmFileInfo.icl
+5
-0
Pm/PmFiles.dcl
Pm/PmFiles.dcl
+1
-0
Pm/PmFiles.icl
Pm/PmFiles.icl
+9
-4
Pm/PmProject.dcl
Pm/PmProject.dcl
+3
-0
Pm/PmProject.icl
Pm/PmProject.icl
+15
-2
Pm/PmTypes.dcl
Pm/PmTypes.dcl
+8
-4
Pm/PmTypes.icl
Pm/PmTypes.icl
+16
-8
Unix/PmCleanSystem.dcl
Unix/PmCleanSystem.dcl
+2
-0
Unix/PmCleanSystem.icl
Unix/PmCleanSystem.icl
+55
-0
Win/PmCleanSystem.dcl
Win/PmCleanSystem.dcl
+2
-0
Win/PmCleanSystem.icl
Win/PmCleanSystem.icl
+37
-1
No files found.
BatchBuild/IdeState.dcl
View file @
97ed2178
...
...
@@ -63,6 +63,10 @@ getCurrentSlibs :: !*GeneralSt -> (!(List String),!*GeneralSt)
getCurrentObjts
::
!*
GeneralSt
->
(!(
List
String
),!*
GeneralSt
)
getCurrentComp
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentCgen
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentAbcOpt
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCgen
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBClink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCstrip
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentLink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentDynl
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentVers
::
!*
GeneralSt
->
(!
Int
,!*
GeneralSt
)
...
...
BatchBuild/IdeState.icl
View file @
97ed2178
...
...
@@ -178,6 +178,26 @@ getCurrentCgen ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_cgen
,
ps
)
getCurrentAbcOpt
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentAbcOpt
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_abcopt
,
ps
)
getCurrentBCgen
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCgen
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcgen
,
ps
)
getCurrentBClink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBClink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bclink
,
ps
)
getCurrentBCstrip
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentBCstrip
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcstrip
,
ps
)
getCurrentLink
::
!*
GeneralSt
->
(!
String
,!*
GeneralSt
)
getCurrentLink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
...
...
Ide/IdeState.dcl
View file @
97ed2178
...
...
@@ -179,6 +179,10 @@ getCurrentObjts :: !*(PSt *General) -> (!(List String),!*PSt *General)
getCurrentComp
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentCgen
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentAbcOpt
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCgen
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBClink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCstrip
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentLink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentDynl
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentVers
::
!*(
PSt
*
General
)
->
(!
Int
,!*
PSt
*
General
)
...
...
Ide/IdeState.icl
View file @
97ed2178
...
...
@@ -440,6 +440,26 @@ getCurrentCgen ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_cgen
,
ps
)
getCurrentAbcOpt
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentAbcOpt
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_abcopt
,
ps
)
getCurrentBCgen
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCgen
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcgen
,
ps
)
getCurrentBClink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBClink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bclink
,
ps
)
getCurrentBCstrip
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentBCstrip
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
=
(
ct
.
target_bcstrip
,
ps
)
getCurrentLink
::
!*(
PSt
*
General
)
->
(!
String
,!*
PSt
*
General
)
getCurrentLink
ps
#
(
ct
,
ps
)
=
accPLoc
(\
p
=:{
pm_targets
,
pm_curtarg
}->(
pm_targets
!!
pm_curtarg
,
p
))
ps
...
...
Ide/PmDialogues.icl
View file @
97ed2178
...
...
@@ -14,6 +14,7 @@ from projwin import pm_update_project_window
,
paths
::
!
List
String
,
lo
::
!
LinkOptions
,
xp
::
!
String
// exepath
,
bytecodepath
::
!
String
,
sl
::
!
StaticLibInfo
,
post_link
::
!
Maybe
String
}
...
...
@@ -42,6 +43,7 @@ projectDialog actualProject ps`
#
(
appPath
,
ps
)
=
getStup
ps
#
prjPath
=
PR_GetRootDir
prj
#
prj
=
PR_SetExecPath
ret
.
xp
prj
#
prj
=
PR_SetByteCodePath
ret
.
bytecodepath
prj
#
prj
=
PR_SetStaticLibsInfo
ret
.
sl
prj
#
(
xxId
,
ps
)
=
getPWX
ps
#
ps
=
setFlexTexts
[(
xxId
,
ret
.
xp
)]
ps
...
...
@@ -75,8 +77,8 @@ where
])
ps
// actualProject
(
project
,
ps0
)
=
getProject
ps`
([
okId
,
cancelId
,
dlogId
,
hsId
,
ssId
,
emId
,
hmId
,
ihId
,
mhId
,
c1id
,
r1id
,
c2id
,
c3id
,
c4id
,
xpId
,
rsrcsId
,
symbolsId
,
post_link_id
:_],
ps1
)
=
openIds
1
8
ps0
([
okId
,
cancelId
,
dlogId
,
hsId
,
ssId
,
emId
,
hmId
,
ihId
,
mhId
,
c1id
,
r1id
,
c2id
,
c3id
,
c4id
,
xpId
,
bytecodepathId
,
rsrcsId
,
symbolsId
,
post_link_id
:_],
ps1
)
=
openIds
1
9
ps0
(
lbpadId
,
ps2
)
=
openExtListBoxId
ps1
(
lbobjId
,
ps3
)
=
openExtListBoxId
ps2
(
lbdlibId
,
ps4
)
=
openExtListBoxId
ps3
...
...
@@ -110,7 +112,7 @@ where
sl
=
PR_GetStaticLibsInfo
project
root_path
=
PR_GetRootModuleDir
project
(
post_link
,_)
=
PR_GetPostlink
project
inils
=
{
ao
=
ao
,
cgo
=
cgo
,
paths
=
paths
,
lo
=
lo
,
xp
=
fulexepath
,
sl
=
sl
,
post_link
=
post_link
}
inils
=
{
ao
=
ao
,
cgo
=
cgo
,
paths
=
paths
,
lo
=
lo
,
xp
=
fulexepath
,
bytecodepath
=
fulbcpath
,
sl
=
sl
,
post_link
=
post_link
}
// generic...
panesOptions
=
TabControl
...
...
@@ -164,8 +166,10 @@ where
cancelfun
(
ls
,
ps
)
=
(
inils
,
closeWindow
dlogId
ps
)
fulexepath
=
PR_GetExecPath
project
symexepath
=
symPath
ap
pp
fulexepath
fulexepath
=
PR_GetExecPath
project
symexepath
=
symPath
ap
pp
fulexepath
fulbcpath
=
PR_GetByteCodePath
project
bytecodepath
=
symPath
ap
pp
fulbcpath
setexe
(
ls
,
ps
)
#
(
prjPath
,
ps
)
=
getProjectFilePath
ps
...
...
@@ -183,6 +187,22 @@ where
#
ps
=
appPIO
(
setControlText
xpId
(
"Executable produced as: "
+++
exename
))
ps
=
(
ls
,
ps
)
setbytecodepath
(
ls
,
ps
)
#
(
prjPath
,
ps
)
=
getProjectFilePath
ps
#
prjName
=
RemoveSuffix
(
RemovePath
prjPath
)
#
prjPath
=
pp
#
(
bcname
,
ps
)
=
PlatformDependant
(
selectOutputFile`
"Bytecode"
"*.bc"
"Set"
ps
)
// win
(
selectOutputFile
"Bytecode"
prjName
ps
)
// mac
|
isNothing
bcname
=
(
ls
,
ps
)
#
bcname
=
fromJust
bcname
#
(
appPath
,
ps
)
=
getStup
ps
#
bcname
=
symPath
appPath
prjPath
bcname
#
ls
=
{
ls
&
bytecodepath
=
bcname
}
#
ps
=
appPIO
(
setControlText
bytecodepathId
(
"Bytecode produced as: "
+++
bcname
))
ps
=
(
ls
,
ps
)
applicationPane
=
Pane
"Application"
// heap size
(
TextControl
"Application Options"
[]
...
...
@@ -300,6 +320,14 @@ where
:+:
CheckControl
[(
"Generate descriptors and export labels"
,
Nothing
,
toMark
ao
.
desc_exl
,
noPS
(\
l
->{
l
&
ao
.
desc_exl
=
not
l
.
ao
.
desc_exl
}))]
(
Columns
1
)
[
ControlPos
(
Left
,
zero
)]
:+:
CheckControl
[(
"Optimise ABC"
,
Nothing
,
toMark
cgo
.
optimise_abc
,
noPS
(\
l
->{
l
&
cgo
.
optimise_abc
=
not
l
.
cgo
.
optimise_abc
}))]
(
Columns
1
)
[
ControlPos
(
Left
,
zero
)]
:+:
CheckControl
[(
"Generate bytecode"
,
Nothing
,
toMark
cgo
.
generate_bytecode
,
noPS
(\
l
->{
l
&
cgo
.
generate_bytecode
=
not
l
.
cgo
.
generate_bytecode
}))]
(
Columns
1
)
[
ControlPos
(
Left
,
zero
)]
:+:
TextControl
(
"Bytecode produced as: "
+++
bytecodepath
)
[
ControlId
bytecodepathId
,
ControlPos
(
Left
,
zero
):
if
actualProject
[]
[
ControlHide
]]
:+:
ButtonControl
"Set bytecode file..."
[
ControlFunction
setbytecodepath
,
ControlPos
(
Left
,
zero
):
if
actualProject
[]
[
ControlHide
]]
)
diagnosticsPane
=
Pane
"Diagnostics"
(
TextControl
"Diagnostics Options"
[]
...
...
Ide/targetui.icl
View file @
97ed2178
...
...
@@ -413,6 +413,20 @@ editTargets getTs setTs ps
,
lbpadId
::
!
ExtListBoxId
ps
}
::
EnvironmentSettingsIds
=
{
compId
::
!
Id
// compiler
,
cgenId
::
!
Id
// code generator
,
linkId
::
!
Id
// linker
,
dynlId
::
!
Id
// dynamic linker
,
versId
::
!
Id
// ABC version
,
methId
::
!
Id
// compilation method
,
abcOptId
::
!
Id
// ABC optimiser
,
bcGenId
::
!
Id
// bytecode generator
,
bcLinkId
::
!
Id
// bytecode linker
,
bcStripId
::
!
Id
// bytecode stripper
}
envDialog
ap
pp
ts
ct
getTs
setTs
ps
#
(
wid
,
ps
)
=
openId
ps
#
(
okId
,
ps
)
=
openId
ps
...
...
@@ -469,12 +483,19 @@ envDialog ap pp ts ct getTs setTs ps
)
// selection update function
lbsllId
[
ControlViewSize
{
h
=
siz
.
Size
.
h
,
w
=
300
}]
#
(
compId
,
ps
)
=
openId
ps
#
(
cgenId
,
ps
)
=
openId
ps
#
(
linkId
,
ps
)
=
openId
ps
#
(
dynlId
,
ps
)
=
openId
ps
#
(
versId
,
ps
)
=
openId
ps
#
(
methId
,
ps
)
=
openId
ps
#
([
compId
,
cgenId
,
linkId
,
dynlId
,
versId
,
methId
,
abcOptId
,
bcGenId
,
bcLinkId
,
bcStripId
:_],
ps
)
=
openIds
10
ps
#
environmentSettingsIds
=
{
compId
=
compId
,
cgenId
=
cgenId
,
linkId
=
linkId
,
dynlId
=
dynlId
,
versId
=
versId
,
methId
=
methId
,
abcOptId
=
abcOptId
,
bcGenId
=
bcGenId
,
bcLinkId
=
bcLinkId
,
bcStripId
=
bcStripId
}
#
(
c1id
,
ps
)
=
openId
ps
#
(
c2id
,
ps
)
=
openId
ps
#
(
c3id
,
ps
)
=
openId
ps
...
...
@@ -495,7 +516,7 @@ envDialog ap pp ts ct getTs setTs ps
}
#
(_,
ps
)
=
openModalDialog
iniLS
(
ddef
wid
okId
cancelId
lbobj
lbobjId
lblib
lblibId
(
path_size
.
Size
.
h
)
lbpadId
lbsll
lbsllId
siz
compId
cgenId
linkId
dynlId
versId
methId
c1id
c2id
c3id
c4id
lbsllId
siz
environmentSettingsIds
c1id
c2id
c3id
c4id
r1id
r2id
r3id
r4id
)
ps
=
ps
...
...
@@ -503,22 +524,22 @@ where
tg
=
ts
!!
ct
inifull
=
False
ddef
wid
okId
cancelId
lbobj
lbobjId
lblib
lblibId
height
lbpadId
lbsll
lbsllId
siz
compId
cgenId
linkId
dynlId
versId
methId
c1id
c2id
c3id
c4id
r1id
r2id
r3id
r4id
ddef
wid
okId
cancelId
lbobj
lbobjId
lblib
lblibId
height
lbpadId
lbsll
lbsllId
siz
environmentSettingsIds
c1id
c2id
c3id
c4id
r1id
r2id
r3id
r4id
=
Dialog
(
"Environment: "
+++
tg
.
target_name
)
(
title
:+:
panes
:+:
buttons`
)
[
WindowId
wid
,
WindowOk
okId
,
WindowClose
(
noLS
(
closeWindow
wid
)),
WindowCancel
cancelId
]
where
buttons`
=
buttons
wid
okId
cancelId
getTs
setTs
ct
ts
compId
cgenId
linkId
dynlId
versId
methId
buttons`
=
buttons
wid
okId
cancelId
getTs
setTs
ct
ts
environmentSettingsIds
panes
=
TabControl
(
Pane
"Tools"
(
toolpane
tg
compId
cgenId
linkId
dynlId
versId
methId
)
(
Pane
"Tools"
(
toolpane
tg
environmentSettingsIds
)
:+:
Pane
"Paths"
(
pathpane
ap
pp
tg
.
target_path
inifull
height
lbpadId
c1id
r1id
)
:+:
Pane
"Dynamic Libraries"
(
dlibpane
inifull
lblib
c2id
r2id
)
:+:
Pane
"Static Libraries"
(
slibpane
inifull
lbsll
c3id
r3id
)
:+:
Pane
"Object Modules"
(
objmpane
inifull
lbobj
c4id
r4id
)
)
[
ControlPos
(
Left
,
zero
)]
buttons
wid
okId
cancelId
getTs
setTs
ct
ts
compId
cgenId
linkId
dynlId
versId
methId
buttons
wid
okId
cancelId
getTs
setTs
ct
ts
{
compId
,
cgenId
,
linkId
,
dynlId
,
versId
,
methId
,
abcOptId
,
bcGenId
,
bcLinkId
,
bcStripId
}
=
ButtonControl
"Done"
[
ControlFunction
savefun
,
ControlId
okId
,
ControlPos
(
Right
,
zero
)
...
...
@@ -568,12 +589,14 @@ where
|
isNothing
wdef
=
abort
"Fatal error in environment dialog: window has disappeared."
#
wdef
=
fromJust
wdef
#
[(
ok1
,
comp
),(
ok2
,
cgen
),(
ok3
,
link
),(
ok4
,
dynl
),(
ok5
,
vers
),(
ok6
,
mnum
):_]
=
getControlTexts
[
compId
,
cgenId
,
linkId
,
dynlId
,
versId
,
methId
]
wdef
|
not
(
ok1
&&
ok2
&&
ok3
&&
ok4
&&
ok5
&&
ok6
)
#
[(
ok1
,
comp
),(
ok2
,
cgen
),(
ok3
,
link
),(
ok4
,
dynl
),(
ok5
,
vers
),(
ok6
,
mnum
),
(
ok7
,
abcopt
),(
ok8
,
bcgen
),(
ok9
,
bclink
),(
ok10
,
bcstrip
):_]
=
getControlTexts
[
compId
,
cgenId
,
linkId
,
dynlId
,
versId
,
methId
,
abcOptId
,
bcGenId
,
bcLinkId
,
bcStripId
]
wdef
|
not
(
ok1
&&
ok2
&&
ok3
&&
ok4
&&
ok5
&&
ok6
&&
ok7
&&
ok8
&&
ok9
&&
ok10
)
=
abort
"Fatal error in environment dialog: controls have disappeared."
|
(
isNothing
comp
)
||
(
isNothing
cgen
)
||
(
isNothing
link
)
||
(
isNothing
dynl
)
||
(
isNothing
vers
)
||
(
isNothing
mnum
)
||
isNothing
abcopt
||
isNothing
bcgen
||
isNothing
bclink
||
isNothing
bcstrip
=
abort
"Fatal error in environment dialog: controls are empty."
#
comp
=
fromJust
comp
#
cgen
=
fromJust
cgen
...
...
@@ -581,6 +604,10 @@ where
#
dynl
=
fromJust
dynl
#
vers
=
fromJust
vers
#
mnum
=
fromJust
mnum
#
abcopt
=
fromJust
abcopt
#
bcgen
=
fromJust
bcgen
#
bclink
=
fromJust
bclink
#
bcstrip
=
fromJust
bcstrip
#
ls
=
{
ls
&
tg
.
target_comp
=
comp
...
...
@@ -588,6 +615,10 @@ where
,
tg
.
target_link
=
link
,
tg
.
target_dynl
=
dynl
,
tg
.
target_vers
=
toInt
vers
,
tg
.
target_abcopt
=
abcopt
,
tg
.
target_bcgen
=
bcgen
,
tg
.
target_bclink
=
bclink
,
tg
.
target_bcstrip
=
bcstrip
}
#
ls
=
case
ls
.
tg
.
target_meth
of
(
CompileAsync
_)
->
{
ls
&
tg
.
target_meth
=
CompileAsync
(
toInt
mnum
)}
...
...
@@ -600,7 +631,7 @@ where
title
=
TextControl
"Environment Options"
[
ControlPos
(
Center
,
zero
)]
toolpane
tg
compId
cgenId
linkId
dynlId
versId
methId
toolpane
tg
{
compId
,
cgenId
,
linkId
,
dynlId
,
versId
,
methId
,
abcOptId
,
bcGenId
,
bcLinkId
,
bcStripId
}
=
TextControl
"Compiler: "
[
ControlWidth
textWidth
]
:+:
EditControl
tg
.
target_comp
(
PixelWidth
250
)
1
[
ControlId
compId
...
...
@@ -621,6 +652,26 @@ toolpane tg compId cgenId linkId dynlId versId methId
[
ControlId
dynlId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
dynlId
1
0
)))
]
:+:
TextControl
"ABC Optimiser: "
[
ControlPos
(
Left
,
zero
),
ControlWidth
textWidth
]
:+:
EditControl
tg
.
target_abcopt
(
PixelWidth
250
)
1
[
ControlId
abcOptId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
abcOptId
1
0
)))
]
:+:
TextControl
"Bytecode Generator: "
[
ControlPos
(
Left
,
zero
),
ControlWidth
textWidth
]
:+:
EditControl
tg
.
target_bcgen
(
PixelWidth
250
)
1
[
ControlId
bcGenId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
bcGenId
1
0
)))
]
:+:
TextControl
"Bytecode Linker: "
[
ControlPos
(
Left
,
zero
),
ControlWidth
textWidth
]
:+:
EditControl
tg
.
target_bclink
(
PixelWidth
250
)
1
[
ControlId
bcLinkId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
bcLinkId
1
0
)))
]
:+:
TextControl
"Bytecode Stripper: "
[
ControlPos
(
Left
,
zero
),
ControlWidth
textWidth
]
:+:
EditControl
tg
.
target_bcstrip
(
PixelWidth
250
)
1
[
ControlId
bcStripId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
bcStripId
1
0
)))
]
:+:
TextControl
"ABC version: "
[
ControlPos
(
Left
,
zero
),
ControlWidth
textWidth
]
:+:
EditControl
(
toString
tg
.
target_vers
)
(
PixelWidth
250
)
1
[
ControlId
versId
...
...
@@ -658,7 +709,7 @@ toolpane tg compId cgenId linkId dynlId versId methId
,
ControlActivate
(
noLS
(
appPIO
(
setEditControlSelection
methId
1
0
)))
]
where
textWidth
=
ContentWidth
"
Dynamic Linke
r: "
textWidth
=
ContentWidth
"
Bytecode Generato
r: "
redcfun
(
ls
,
ps
)
#
ls
=
{
ls
&
tg
.
target_redc
=
not
ls
.
tg
.
target_redc
}
...
...
MacOSX/PmCleanSystem.dcl
View file @
97ed2178
...
...
@@ -92,3 +92,5 @@ ClearCompilerCaches :: .a
SendRepeatResult
::
.
a
StartCodeGenerator
::
.
a
Execute`
::
.
a
RunExternalCommand
::
!
String
![
String
]
!
String
!*
GeneralSt
->
*(!
Int
,
![
String
],
!*
GeneralSt
)
MacOSX/PmCleanSystem.icl
View file @
97ed2178
...
...
@@ -981,6 +981,61 @@ StartCodeGenerator = abort "StartCodeGenerator\n"
Execute`
::
.
a
Execute`
=
abort
"Execute`
\n
"
RunExternalCommand
::
!
String
![
String
]
!
String
!*
GeneralSt
->
*(!
Int
,
![
String
],
!*
GeneralSt
)
RunExternalCommand
cmd
args
startupdir
ps
#
temp_dir
=
temp_dir_path
startupdir
errors_file_name
=
errors_file_path
temp_dir
0
#
stderr_fd
=
creat
(
errors_file_name
+++
"
\0
"
)
0644
|
stderr_fd
==
(
-1
)
=
abort
"creat failed
\n
"
#
(
argv
,
args_memory
)
=
make_argv
[
cmd
:
args
]
#
pid
=
fork
|
pid
<
0
=
abort
"fork failed
\n
"
|
pid
==
0
#
r
=
dup2
stderr_fd
2
|
r
==
(
-1
)
=
abort
"dup2 failed
\n
"
|
execv
(
cmd
+++
"
\0
"
)
argv
<
0
=
abort
"execv failed
\n
"
=
abort
"execution continued after execv
\n
"
|
free
args_memory
<
0
=
abort
"free failed
\n
"
#
(
w_pid
,
status
)
=
wait_pid
pid
0
|
w_pid
<>
-1
&&
w_pid
<>
pid
=
abort
"waitpid failed
\n
"
#
result
=
(
status
bitand
0xff00
)
>>
8
#
wtermsig
=
status
bitand
0x7f
|
wtermsig
<>
0
=
abort
"external command exited abnormally
\n
"
#
r
=
close
stderr_fd
|
r
==(
-1
)
=
abort
"close failed
\n
"
#
(
out
,
ps
)
=
accFiles
(
readFileLines
errors_file_name
)
ps
=
(
result
,
out
,
ps
)
where
readFileLines
::
!
String
!*
Files
->
*(![
String
],
!*
Files
)
readFileLines
path
env
#
(
ok
,
f
,
env
)
=
fopen
path
FReadText
env
|
not
ok
=
([],
env
)
#
(
out
,
f
)
=
read
[]
f
#
(_,
env
)
=
fclose
f
env
=
(
out
,
env
)
where
read
::
![
String
]
!*
File
->
*(![
String
],
!*
File
)
read
acc
f
#
(
e
,
f
)
=
fend
f
|
e
=
(
reverse
acc
,
f
)
#
(
line
,
f
)
=
freadline
f
#!
line
=
strip_newlines
line
=
read
[
line
:
acc
]
f
wait_pid
::
!
Int
!
Int
->
(!
Int
,!
Int
)
wait_pid
pid
options
#
status_a
=
createArray
1
0
...
...
Pm/PmDriver.icl
View file @
97ed2178
implementation
module
PmDriver
import
StdArray
,
StdBool
,
StdList
,
StdMisc
,
StdEnum
,
StdStrictLists
import
StdArray
,
StdBool
,
StdList
,
StdMisc
,
StdEnum
,
StdStrictLists
,
StdTuple
from
StdOverloadedList
import
Foldr
,++|,
Hd
,
Any
import
UtilNewlinesFile
,
UtilIO
...
...
@@ -813,6 +813,13 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
#
ps
=
showInfo
line
ps
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
#
(
ok
,
ps
)
=
if
(
PR_GetByteCodePath
project
<>
""
)
(
ByteCodeLink
fileinfo
project
ps
)
(
True
,
ps
)
|
not
ok
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
#
(
ok
,
ps
)
=
if
(
lo
.
strip_bytecode
&&
PR_GetByteCodePath
project
<>
""
)
(
ByteCodeStrip
fileinfo
project
ps
)
(
True
,
ps
)
|
not
ok
=
continue
False
newpaths
False
fileinfo
libsinfo
modpaths
project
intr
(
abccache
,
ps
)
#
execpath
=
PR_GetExecPath
project
#
prj_path`
=
PR_GetRootDir
project
#
execpath
=
fulPath
app_path
prj_path`
execpath
...
...
@@ -1461,7 +1468,12 @@ GenCodeTheProjectModule :: !Bool !Bool !CodeGenerateAsmOrCode !ModuleDirAndName
GenCodeTheProjectModule
outofdate
sys
genAsmOrCode
mdn
abc_path
abccache
fileinfo
project
ps
#
module_name
=
mdn
.
mdn_name
#
(
proc
,
ps
)
=
getCurrentProc
ps
#
cgo
=
PR_GetCodeGenOptions
project
#
((
info
,
abccache
,
fileinfo
),
ps
)
=
FI_GetFileInfo
proc
mdn
abccache
fileinfo
ps
#
(
ok
,
ps
)
=
if
cgo
.
optimise_abc
(
OptimiseABC
mdn
abc_path
ps
)
(
True
,
ps
)
|
not
ok
=
(
ps
,
abccache
,
fileinfo
,
project
,
ok
,
info
.
objpath
)
#
(
ok
,
ps
)
=
if
cgo
.
generate_bytecode
(
ByteCodeGen
cgo
.
optimise_abc
mdn
abc_path
ps
)
(
True
,
ps
)
|
not
ok
=
(
ps
,
abccache
,
fileinfo
,
project
,
ok
,
info
.
objpath
)
|
not
outofdate
=
(
ps
,
abccache
,
fileinfo
,
project
,
True
,
info
.
objpath
)
#
ps
=
showInfo
(
Level2
(
"Generating code for '"
+++
module_name
+++
"'."
))
ps
...
...
@@ -1472,7 +1484,6 @@ GenCodeTheProjectModule outofdate sys genAsmOrCode mdn abc_path abccache fileinf
ao
=
PR_GetApplicationOptions
project
timeprofile
=
ao
.
profiling
&&
(
not
neverTimeProfile
)
obj_path
=
ModuleDirAndNameToObjSystemPathname
proc
mdn
cgo
=
PR_GetCodeGenOptions
project
#
(
obj_path
,
res
,
compiler_process_ids
,
ps
)
=
CodeGen
cgen
use_compiler_process_ids
updateErrorWindow
genAsmOrCode
abc_path
obj_path
timeprofile
cgo
proc
ao
startupdir
compiler_process_ids
ps
#
ps
=
setCompilerProcessIds
compiler_process_ids
ps
|
genAsmOrCode
==
CodeGeneration
&&
res
...
...
@@ -1652,3 +1663,72 @@ where
#
(
startupdir
,
ps
)
=
getStup
ps
#
(_,
ps
)
=
ClearCompilerCache
ccstring
startupdir
ps
->
ps
//-- Bytecode generation and linking
OptimiseABC
::
!
ModuleDirAndName
!
Pathname
!*
GeneralSt
->
*(!
Bool
,
!*
GeneralSt
)
OptimiseABC
mdn
abc_path
ps
#
(
startupdir
,
ps
)
=
getStup
ps
(
abcopt
,
ps
)
=
getCurrentAbcOpt
ps
abcopt
=
startupdir
+++
DirSeparatorString
+++
abcopt
#
abcopt_path
=
abc_path
%
(
0
,
size
abc_path
-4
)
+++
"opt.abc"
#
ps
=
showInfo
(
Level2
(
"Optimising ABC for '"
+++
mdn
.
mdn_name
+++
"'."
))
ps
#
(
exitcode
,
err
,
ps
)
=
RunExternalCommand
abcopt
[
abc_path
,
"-o"
,
abcopt_path
]
startupdir
ps
#
err
=
if
(
exitcode
==
0
)
err
(
err
++
[
"ABC optimiser failed for "
+++
mdn
.
mdn_name
+++
" (exit code: "
+++
toString
exitcode
+++
")"
])
#
ps
=
updateErrorWindow
err
ps
=
(
exitcode
==
0
,
ps
)
ByteCodeGen
::
!
Bool
!
ModuleDirAndName
!
Pathname
!*
GeneralSt
->
*(!
Bool
,
!*
GeneralSt
)
ByteCodeGen
use_optimised_abc
mdn
abc_path
ps
#
(
startupdir
,
ps
)
=
getStup
ps
(
bcgen
,
ps
)
=
getCurrentBCgen
ps
bcgen
=
startupdir
+++
DirSeparatorString
+++
bcgen
#
abcopt_path
=
abc_path
%
(
0
,
size
abc_path
-4
)
+++
"opt.abc"
bc_path
=
abc_path
%
(
0
,
size
abc_path
-4
)
+++
"bc"
#
ps
=
showInfo
(
Level2
(
"Generating bytecode for '"
+++
mdn
.
mdn_name
+++
"'."
))
ps
#
(
exitcode
,
err
,
ps
)
=
RunExternalCommand
bcgen
[
if
use_optimised_abc
abcopt_path
abc_path
,
"-o"
,
bc_path
]
startupdir
ps
#
err
=
if
(
exitcode
==
0
)
err
(
err
++
[
"Bytecode generator failed for "
+++
mdn
.
mdn_name
+++
" (exit code: "
+++
toString
exitcode
+++
")"
])
#
ps
=
updateErrorWindow
err
ps
=
(
exitcode
==
0
,
ps
)
ByteCodeLink
::
!
FileInfoCache
!
Project
!*
GeneralSt
->
*(!
Bool
,
!*
GeneralSt
)
ByteCodeLink
fileinfo
project
ps
#
(
startupdir
,
ps
)
=
getStup
ps
(
bclink
,
ps
)
=
getCurrentBClink
ps
bclink
=
startupdir
+++
DirSeparatorString
+++
bclink
#
bcpath
=
fulPath
startupdir
(
PR_GetRootDir
project
)
(
PR_GetByteCodePath
project
)
(
abcpaths
,
fileinfo
)
=
FI_GetAbcFiles
fileinfo
abcpaths
=
[
p
%
(
0
,
size
p
-4
)
+++
"bc"
\\
p
<|-
abcpaths
]
#
(
root_mdn
,
project
)
=
PR_GetRootModuleDirAndName
project
root
=
ModuleDirAndNameToABCSystemPathname
root_mdn
root
=
root
%
(
0
,
size
root
-4
)
+++
"bc"
abcpaths
=
[
root
:
removeMember
root
abcpaths
]
#
ps
=
showInfo
(
Level2
(
"Linking bytecode for '"
+++
RemovePath
bcpath
+++
"'"
))
ps
#
(
exitcode
,
err
,
ps
)
=
RunExternalCommand
bclink
(
abcpaths
++
[
"-o"
,
bcpath
])
startupdir
ps
#
err
=
if
(
exitcode
==
0
)
err
(
err
++
[
"Bytecode linker failed (exit code: "
+++
toString
exitcode
+++
")"
])
#
ps
=
updateErrorWindow
err
ps
=
(
exitcode
==
0
,
ps
)
ByteCodeStrip
::
!
FileInfoCache
!
Project
!*
GeneralSt
->
*(!
Bool
,
!*
GeneralSt
)
ByteCodeStrip
fileinfo
project
ps
#
(
startupdir
,
ps
)
=
getStup
ps
(
bcstrip
,
ps
)
=
getCurrentBCstrip
ps
bcstrip
=
startupdir
+++
DirSeparatorString
+++
bcstrip
#
bcpath
=
fulPath
startupdir
(
PR_GetRootDir
project
)
(
PR_GetByteCodePath
project
)
#
ps
=
showInfo
(
Level2
(
"Stripping bytecode for '"
+++
RemovePath
bcpath
+++
"'"
))
ps
#
(
exitcode
,
err
,
ps
)
=
RunExternalCommand
bcstrip
[
bcpath
,
"-o"
,
bcpath
]
startupdir
ps
#
err
=
if
(
exitcode
==
0
)
err
(
err
++
[
"Bytecode stripper failed (exit code: "
+++
toString
exitcode
+++
")"
])
#
ps
=
updateErrorWindow
err
ps
=
(
exitcode
==
0
,
ps
)
Pm/PmEnvironment.dcl
View file @
97ed2178
...
...
@@ -14,6 +14,10 @@ EnvsFileName :== "IDEEnvs"
,
target_stat
::
!
List
String
// static libraries
,
target_comp
::
!
String
// compiler
,
target_cgen
::
!
String
// code generator
,
target_abcopt
::
!
String
// abc optimiser
,
target_bcgen
::
!
String
// bytecode generator
,
target_bclink
::
!
String
// bytecode linker
,
target_bcstrip
::
!
String
// bytecode stripper
,
target_link
::
!
String
// static/eager linker
,
target_dynl
::
!
String
// dynamic linker
,
target_vers
::
!
Int
// abc version
...
...
Pm/PmEnvironment.icl
View file @
97ed2178
...
...
@@ -27,6 +27,10 @@ t_StdEnv
,
target_stat
::
!
List
String
// static libraries
,
target_comp
::
!
String
// compiler
,
target_cgen
::
!
String
// code generator
,
target_abcopt
::
!
String
// abc optimiser
,
target_bcgen
::
!
String
// bytecode generator
,
target_bclink
::
!
String
// bytecode linker
,
target_bcstrip
::
!
String
// bytecode stripper
,
target_link
::
!
String
// static/eager linker
,
target_dynl
::
!
String
// dynamic linker
,
target_vers
::
!
Int
// abc version
...
...
@@ -129,6 +133,10 @@ emptyTarget =
,
target_stat
=
Nil
,
target_comp
=
""
,
target_cgen
=
""
,
target_abcopt
=
""
,
target_bcgen
=
""
,
target_bclink
=
""
,
target_bcstrip
=
""
,
target_link
=
""
,
target_dynl
=
""
,
target_vers
=
42
...
...
@@ -159,6 +167,10 @@ TargetTable =
,
ListOption
"EnvironmentStaticLibs"
(
PathOption
)
""
(\
a
->
a
.
target_stat
)
(\
v
a
->{
a
&
target_stat
=
v
})
,
SimpleOption
"EnvironmentCompiler"
(\
a
->
a
.
target_comp
)
(\
v
a
->{
a
&
target_comp
=
v
})
,
SimpleOption
"EnvironmentCodeGen"
(\
a
->
a
.
target_cgen
)
(\
v
a
->{
a
&
target_cgen
=
v
})
,
SimpleOption
"EnvironmentABCOptimise"
(\
a
->
a
.
target_abcopt
)
(\
v
a
->{
a
&
target_abcopt
=
v
})
,
SimpleOption
"EnvironmentByteCodeGen"
(\
a
->
a
.
target_bcgen
)
(\
v
a
->{
a
&
target_bcgen
=
v
})
,
SimpleOption
"EnvironmentByteCodeLink"
(\
a
->
a
.
target_bclink
)
(\
v
a
->{
a
&
target_bclink
=
v
})
,
SimpleOption
"EnvironmentByteCodeStrip"
(\
a
->
a
.
target_bcstrip
)
(\
v
a
->{
a
&
target_bcstrip
=
v
})
,
SimpleOption
"EnvironmentLinker"
(\
a
->
a
.
target_link
)
(\
v
a
->{
a
&
target_link
=
v
})
,
SimpleOption
"EnvironmentDynLink"
(\
a
->
a
.
target_dynl
)
(\
v
a
->{
a
&
target_dynl
=
v
})
,
SimpleOption
"EnvironmentVersion"
(\
a
->
toString
a
.
target_vers
)
(\
v
a
->{
a
&
target_vers
=
toInt
v
})
...
...
@@ -196,6 +208,10 @@ t_StdEnv20
,
target_stat
=
Nil
,
target_comp
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"CleanCompiler.exe"
"cocl"
,
target_cgen
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"CodeGenerator.exe"
"cg"
,
target_abcopt
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ABCOptimiser.exe"
"abcopt"
,
target_bcgen
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeGenerator.exe"
"bcgen"
,
target_bclink
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeLinker.exe"
"bclink"
,
target_bcstrip
=
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"ByteCodeStripper.exe"
"bcstrip"
,
target_link
=
IF_MACOSX
"/usr/bin/gcc"
(
compiler_and_linker_directory
+++
DirSeparatorString
+++
IF_WINDOWS
"StaticLinker.exe"
"linker"
)
,
target_dynl
=
"Tools"
+++
DirSeparatorString
+++
"Dynamics"
+++
DirSeparatorString
+++
"DynamicLinker.exe"
,
target_vers
=
920
...
...
@@ -234,4 +250,4 @@ where
libs`
=
symAppPaths
stup
libs