Commit 546c3fe6 authored by Diederik van Arkel's avatar Diederik van Arkel

move processor setting from codegen opts to environment;

imporoved error messages so that crashes are recognised as errors;
put macintosh temp files in temp dir;
processor dependant object names;
parent f3bdef18
...@@ -169,6 +169,7 @@ getCurrentLink :: !*(PSt *General) -> (!String,!*PSt *General) ...@@ -169,6 +169,7 @@ getCurrentLink :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General) getCurrentDynl :: !*(PSt *General) -> (!String,!*PSt *General)
getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General) getCurrentVers :: !*(PSt *General) -> (!Int,!*PSt *General)
getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General) getCurrentRedc :: !*(PSt *General) -> (!Bool,!*PSt *General)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General) getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
//-- error window stuff //-- error window stuff
......
...@@ -447,6 +447,11 @@ getCurrentRedc ps ...@@ -447,6 +447,11 @@ getCurrentRedc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps # (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.target_redc,ps) = (ct.target_redc,ps)
getCurrentProc :: !*(PSt *General) -> (!Processor,!*PSt *General)
getCurrentProc ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
= (ct.target_proc,ps)
getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General) getCurrentMeth :: !*(PSt *General) -> (!CompileMethod,!*PSt *General)
getCurrentMeth ps getCurrentMeth ps
# (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps # (ct,ps) = accPLoc (\p=:{pm_targets,pm_curtarg}->(pm_targets!!pm_curtarg,p)) ps
......
...@@ -619,7 +619,12 @@ toolpane tg compId cgenId linkId dynlId versId methId ...@@ -619,7 +619,12 @@ toolpane tg compId cgenId linkId dynlId versId methId
[ ControlId versId [ ControlId versId
, ControlActivate (noLS (appPIO (setEditControlSelection versId 1 0))) , ControlActivate (noLS (appPIO (setEditControlSelection versId 1 0)))
] ]
:+: CheckControl [("Console in IDE",Nothing,toMark tg.target_redc,redcfun)] (Columns 1) [ControlPos (Left,zero)] :+: PlatformDependant
( CheckControl [("Console in IDE",Nothing,toMark tg.target_redc,redcfun)] (Columns 1) [ControlPos (Left,zero)])
( TextControl "Processor: " [ControlPos (Left,zero), ControlWidth textWidth]
:+: PopUpControl
[(toString p,procfun p) \\ p <- PlatformProcessors]
(proc2idx tg.target_proc) [])
:+: RadioControl :+: RadioControl
[("Sync",Nothing,methfun 1) [("Sync",Nothing,methfun 1)
,("Async",Nothing,methfun 2) ,("Async",Nothing,methfun 2)
...@@ -651,6 +656,15 @@ where ...@@ -651,6 +656,15 @@ where
# ls = {ls & tg.target_redc = not ls.tg.target_redc} # ls = {ls & tg.target_redc = not ls.tg.target_redc}
= (ls,ps) = (ls,ps)
procfun proc (ls,ps)
# ls = {ls & tg.target_proc = proc}
= (ls,ps)
proc2idx proc
= case [x \\ p <- PlatformProcessors & x <- [1..] | p == proc] of
[] -> proc2idx DefaultProcessor
[x:_] -> x
methfun 1 (ls,ps) methfun 1 (ls,ps)
# ps = appPIO (disableControl methId) ps # ps = appPIO (disableControl methId) ps
# ls = {ls & tg.target_meth = CompileSync} # ls = {ls & tg.target_meth = CompileSync}
......
...@@ -70,6 +70,7 @@ CodeGen :: // Generates code for the given file: ...@@ -70,6 +70,7 @@ CodeGen :: // Generates code for the given file:
!Pathname // full .abc pathname of module to be compiled !Pathname // full .abc pathname of module to be compiled
!Bool // timeprofiling option !Bool // timeprofiling option
!CodeGenOptions // code generator options !CodeGenOptions // code generator options
!Processor // target processor
!ApplicationOptions // application options !ApplicationOptions // application options
!Pathname // startup directory !Pathname // startup directory
!*(PSt .l) // state !*(PSt .l) // state
...@@ -82,7 +83,23 @@ CodeGen :: // Generates code for the given file: ...@@ -82,7 +83,23 @@ CodeGen :: // Generates code for the given file:
, !Bool // success status , !Bool // success status
) )
StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) -> (!Bool,!Pathname,!*(PSt .l)) StartCodeGenerator ::
!String
!(WindowFun *(PSt .l))
!CodeGenerateAsmOrCode
!Pathname
!Int
!Bool
!CodeGenOptions
!Processor
!ApplicationOptions
!Pathname
!*(PSt .l)
->
( !Bool
, !Pathname
, !*(PSt .l)
)
Link :: // Links the given file: Link :: // Links the given file:
!String // linker exe name !String // linker exe name
...@@ -103,6 +120,7 @@ Link :: // Links the given file: ...@@ -103,6 +120,7 @@ Link :: // Links the given file:
!Bool // generate dll? !Bool // generate dll?
!String // name of file containing symbols to be exported from dll !String // name of file containing symbols to be exported from dll
!Pathname // startup directory !Pathname // startup directory
!String // dynamic linker name
!Bool // add 'carb' 0 resource? !Bool // add 'carb' 0 resource?
!*(PSt .l) // state !*(PSt .l) // state
-> ->
......
...@@ -64,6 +64,7 @@ standardObjectFiles stack_traces profiling processor ...@@ -64,6 +64,7 @@ standardObjectFiles stack_traces profiling processor
= ( MakeObjPathname processor "_startupTrace" :! rest) = ( MakeObjPathname processor "_startupTrace" :! rest)
| profiling | profiling
= ( MakeObjPathname processor "_startupProfile" :! rest) = ( MakeObjPathname processor "_startupProfile" :! rest)
// otherwise
= ( MakeObjPathname processor "_startup" :! rest) = ( MakeObjPathname processor "_startup" :! rest)
where where
rest rest
...@@ -73,6 +74,7 @@ where ...@@ -73,6 +74,7 @@ where
:! MakeObjPathname processor "_system" :! MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library" :! MakeObjPathname processor "_library"
:! Nil :! Nil
// otherwise
= MakeObjPathname processor "_system" = MakeObjPathname processor "_system"
:! MakeObjPathname processor "_library" :! MakeObjPathname processor "_library"
:! Nil :! Nil
...@@ -150,11 +152,13 @@ where ...@@ -150,11 +152,13 @@ where
out_file_path :: String Int -> String out_file_path :: String Int -> String
out_file_path startupdir slot out_file_path startupdir slot
= file_path startupdir "out" slot // = file_path startupdir "out" slot
= file_path TempDir "out" slot
errors_file_path :: String Int -> String errors_file_path :: String Int -> String
errors_file_path startupdir slot errors_file_path startupdir slot
= file_path startupdir "errors" slot // = file_path startupdir "errors" slot
= file_path TempDir "errors" slot
file_path :: String String Int -> String file_path :: String String Int -> String
file_path startupdir base_name slot file_path startupdir base_name slot
...@@ -179,7 +183,7 @@ Compile cocl` write_module_times errwin typewin compileOrCheckSyntax path paths ...@@ -179,7 +183,7 @@ Compile cocl` write_module_times errwin typewin compileOrCheckSyntax path paths
// # name = CleanCompilerName // XOXOXOX // # name = CleanCompilerName // XOXOXOX
# (error_code,error_n,ss) = send_command_to_clean_compiler_cc signature name command Wait # (error_code,error_n,ss) = send_command_to_clean_compiler_cc signature name command Wait
| error_code <> 0 = | error_code <> 0 =
( errwin ( [ "Unable to run compiler: "+++cocl ( errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code +++ "; "+++ toString error_code
+++ "; "+++ toString error_n +++ "; "+++ toString error_n
+++ "; "+++ ss +++ "; "+++ ss
...@@ -372,9 +376,9 @@ SwitchDebugMachO tp symbolic_machO normal :== case toString tp of ...@@ -372,9 +376,9 @@ SwitchDebugMachO tp symbolic_machO normal :== case toString tp of
// "PowerPC_MachO" -> symbolic_machO // "PowerPC_MachO" -> symbolic_machO
_ -> normal _ -> normal
CodeGen :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) CodeGen :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Bool !CodeGenOptions !Processor !ApplicationOptions !Pathname !*(PSt .l)
-> (!*(PSt .l), !Pathname, !Bool) -> (!*(PSt .l), !Pathname, !Bool)
CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps CodeGen cgen` wf genAsmOrCode path timeprofile cgo tp ao startupdir ps
# genAsmOrCode` = SwitchDebugMachO tp AsmGeneration genAsmOrCode # genAsmOrCode` = SwitchDebugMachO tp AsmGeneration genAsmOrCode
# (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir # (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir
...@@ -384,14 +388,18 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -384,14 +388,18 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
# objpath = MakeObjSystemPathname tp path # objpath = MakeObjSystemPathname tp path
path_without_suffix = RemoveSuffix path path_without_suffix = RemoveSuffix path
out_file_name
= out_file_path startupdir 0
errors_file_name
= errors_file_path startupdir 0
command = cgen +++ MakeCodeGenOptionsString genAsmOrCode` timeprofile cgo command = cgen +++ MakeCodeGenOptionsString genAsmOrCode` timeprofile cgo
+++ " " +++ (quoted_string path_without_suffix) +++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors" +++ " > " +++ quoted_string out_file_name
errorsfilename = startupdir +++ toString dirseparator +++ "errors" +++ " \xb3 " +++ quoted_string errors_file_name
# (error_code,error_n,output_string) # (error_code,error_n,output_string)
= send_command_to_clean_compiler_cg signature name command Wait = send_command_to_clean_compiler_cg signature name command Wait
| error_code <> 0 | error_code <> 0
= ( wf ( [ "Unable to run code generator: "+++toString error_code = ( wf ( [ "Error: Unable to run code generator: "+++toString error_code
]) ps ]) ps
, objpath , objpath
, False , False
...@@ -405,7 +413,7 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -405,7 +413,7 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
) )
| error_n <> 0 | error_n <> 0
= ( wf ( [ "Code generator: "+++toString error_n = ( wf ( [ "Error: Code generator: "+++toString error_n
]) ps ]) ps
, objpath , objpath
, False , False
...@@ -429,28 +437,31 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps ...@@ -429,28 +437,31 @@ CodeGen cgen` wf genAsmOrCode path timeprofile cgo=:{tp} ao startupdir ps
) )
(ps,objpath,True) (ps,objpath,True)
StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !ApplicationOptions !Pathname !*(PSt .l) StartCodeGenerator :: !String !(WindowFun *(PSt .l)) !CodeGenerateAsmOrCode !Pathname !Int !Bool !CodeGenOptions !Processor !ApplicationOptions !Pathname !*(PSt .l)
-> (!Bool,!Pathname,!*(PSt .l)) -> (!Bool,!Pathname,!*(PSt .l))
StartCodeGenerator cgen` wf genAsmOrCode path slot timeprofile cgo=:{tp} ao startupdir ps StartCodeGenerator cgen` wf genAsmOrCode path slot timeprofile cgo tp ao startupdir ps
# (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir # (cgen_ok,cgen,name,signature) = mangleGenerator cgen` startupdir
| not cgen_ok | not cgen_ok
# ps = wf [cgen] ps # ps = wf [cgen] ps
= (False, "", ps) = (False, "", ps)
// # (objpath,ps) = accFiles (MakeObjSystemPathname tp path) ps
# objpath = MakeObjSystemPathname tp path # objpath = MakeObjSystemPathname tp path
path_without_suffix = RemoveSuffix path path_without_suffix = RemoveSuffix path
// errorsfilename = errors_file_path startupdir slot out_file_name
= out_file_path startupdir 0
errors_file_name
= errors_file_path startupdir 0
command = /*cgen*/ "cg" command = /*cgen*/ "cg"
+++" -id "+++toString slot +++" -id "+++toString slot
+++ MakeCodeGenOptionsString genAsmOrCode /*False*/timeprofile cgo +++ MakeCodeGenOptionsString genAsmOrCode /*False*/timeprofile cgo
+++ " " +++ (quoted_string path_without_suffix) +++ " " +++ (quoted_string path_without_suffix)
+++ " > out \xb3 errors" +++ " > " +++ quoted_string out_file_name
+++ " \xb3 " +++ quoted_string errors_file_name
name = CleanCompilerName name = CleanCompilerName
signature = clean_compiler_signature slot signature = clean_compiler_signature slot
(error_code,error_n,output_string) = send_command_to_clean_compiler signature name command NoWait (error_code,error_n,output_string) = send_command_to_clean_compiler signature name command NoWait
| error_code<>0 | error_code<>0
# ps = wf ["Unable to run code generator: "+++toString error_code] ps # ps = wf ["Error: Unable to run code generator: "+++toString error_code] ps
= (False,objpath,ps) = (False,objpath,ps)
| size output_string <> 0 | size output_string <> 0
# ps = wf [output_string] ps # ps = wf [output_string] ps
...@@ -472,13 +483,13 @@ where ...@@ -472,13 +483,13 @@ where
Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions Link :: !String !(WindowFun *(PSt .l)) !Pathname !ApplicationOptions
!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool
!Bool !Bool !Bool !String !Bool !String !Pathname !Bool !*(PSt .l) !Bool !Bool !Bool !String !Bool !String !Pathname !String !Bool !*(PSt .l)
-> (!*(PSt .l),!Bool) -> (!*(PSt .l),!Bool)
Link linker` winfun path Link linker` winfun path
applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap} applicationOptions=:{fs,fn,em,ss,hs,initial_heap_size,profiling,heap_size_multiple,o,memoryProfilingMinimumHeapSize=minheap}
optionspathname library_file_names object_file_names optionspathname library_file_names object_file_names
static_libraries static gen_relocs gen_linkmap static_libraries static gen_relocs gen_linkmap
link_resources resource_path gen_dll dll_names startupdir add_carb_resource ps link_resources resource_path gen_dll dll_names startupdir dynlinker add_carb_resource ps
# (ok,linker) = mangleLinker linker` startupdir # (ok,linker) = mangleLinker linker` startupdir
| not ok | not ok
# ps = winfun [linker] ps # ps = winfun [linker] ps
...@@ -980,7 +991,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path pat ...@@ -980,7 +991,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path pat
# signature = clean_compiler_signature slot # signature = clean_compiler_signature slot
# (error_code,error_n,ss) = trace_n command send_command_to_clean_compiler signature name command NoWait # (error_code,error_n,ss) = trace_n command send_command_to_clean_compiler signature name command NoWait
| error_code <> 0 | error_code <> 0
= ( False, errwin ( [ "Unable to run compiler: "+++cocl = ( False, errwin ( [ "Error: Unable to run compiler: "+++cocl
+++ "; "+++ toString error_code +++ "; "+++ toString error_code
+++ "; "+++ toString error_n +++ "; "+++ toString error_n
+++ "; "+++ ss +++ "; "+++ ss
...@@ -1088,7 +1099,7 @@ CompilePersistent :: ...@@ -1088,7 +1099,7 @@ CompilePersistent ::
| FileEnv env | FileEnv env
CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling projectTimeProfiling CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling projectTimeProfiling
projectEagerOrDynamic compileroptions startupdir state env projectEagerOrDynamic compileroptions startupdir state env
= (state,(errwin ["Persistent not supported."] env,"",SyntaxError)) = (state,(errwin ["Error: Persistent not supported."] env,"",SyntaxError))
// ... JVG // ... JVG
//-- //--
...@@ -1110,8 +1121,8 @@ mangleCompiler ccstring startupdir ...@@ -1110,8 +1121,8 @@ mangleCompiler ccstring startupdir
# (name,rest) = sSplit ';' ccstring # (name,rest) = sSplit ';' ccstring
# (sign,cocl) = sSplit ';' rest # (sign,cocl) = sSplit ';' rest
# name = case name of # name = case name of
"" -> "Clean Compiler"//\0" "" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> n n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of # sign = case sign of
"" -> "ClCo"//\0" "" -> "ClCo"//\0"
s -> s s -> s
...@@ -1133,8 +1144,8 @@ mangleGenerator cgstring startupdir ...@@ -1133,8 +1144,8 @@ mangleGenerator cgstring startupdir
# (name,rest) = sSplit ';' cgstring # (name,rest) = sSplit ';' cgstring
# (sign,cgen) = sSplit ';' rest # (sign,cgen) = sSplit ';' rest
# name = case name of # name = case name of
"" -> "Clean Compiler"//\0" "" -> startupdir +++ toString dirseparator +++ "Clean Compiler"//\0"
n -> n n -> startupdir +++ toString dirseparator +++ n
# sign = case sign of # sign = case sign of
"" -> "ClCo"//\0" "" -> "ClCo"//\0"
s -> s s -> s
......
This diff is collapsed.
...@@ -2,6 +2,7 @@ definition module PmEnvironment ...@@ -2,6 +2,7 @@ definition module PmEnvironment
import StdFile,StdString,StdMaybe import StdFile,StdString,StdMaybe
import UtilStrictLists import UtilStrictLists
from PmTypes import ::Processor
EnvsFileName :== "IDEEnvs" EnvsFileName :== "IDEEnvs"
...@@ -18,6 +19,7 @@ EnvsFileName :== "IDEEnvs" ...@@ -18,6 +19,7 @@ EnvsFileName :== "IDEEnvs"
, target_vers :: !Int // abc version , target_vers :: !Int // abc version
, target_redc :: !Bool // redirect console? , target_redc :: !Bool // redirect console?
, target_meth :: !CompileMethod // compile strategy , target_meth :: !CompileMethod // compile strategy
, target_proc :: !Processor // object type
} }
:: CompileMethod :: CompileMethod
......
...@@ -7,6 +7,7 @@ import UtilStrictLists ...@@ -7,6 +7,7 @@ import UtilStrictLists
import PmPath import PmPath
import StdMaybe import StdMaybe
import Platform import Platform
import PmTypes
EnvsFileName :== "IDEEnvs" EnvsFileName :== "IDEEnvs"
...@@ -32,6 +33,7 @@ t_StdEnv ...@@ -32,6 +33,7 @@ t_StdEnv
, target_vers :: !Int // abc version , target_vers :: !Int // abc version
, target_redc :: !Bool // redirect console? , target_redc :: !Bool // redirect console?
, target_meth :: !CompileMethod // compile strategy , target_meth :: !CompileMethod // compile strategy
, target_proc :: !Processor // object type
} }
:: CompileMethod :: CompileMethod
...@@ -130,6 +132,7 @@ emptyTarget = ...@@ -130,6 +132,7 @@ emptyTarget =
, target_vers = 42 , target_vers = 42
, target_redc = False , target_redc = False
, target_meth = CompileSync , target_meth = CompileSync
, target_proc = DefaultProcessor
} }
WEO prefs WEO prefs
...@@ -158,6 +161,7 @@ TargetTable = ...@@ -158,6 +161,7 @@ TargetTable =
, SimpleOption "EnvironmentVersion" (\a->toString a.target_vers) (\v a->{a & target_vers=toInt v}) , SimpleOption "EnvironmentVersion" (\a->toString a.target_vers) (\v a->{a & target_vers=toInt v})
, SimpleOption "EnvironmentRedirect" (\a->b2s a.target_redc) (\v a->{a & target_redc=s2b v}) , SimpleOption "EnvironmentRedirect" (\a->b2s a.target_redc) (\v a->{a & target_redc=s2b v})
, SimpleOption "EnvironmentCompileMethod" (\a->m2s a.target_meth) (\v a->{a & target_meth=s2m v}) , SimpleOption "EnvironmentCompileMethod" (\a->m2s a.target_meth) (\v a->{a & target_meth=s2m v})
, SimpleOption "EnvironmentProcessor" (\a->toString a.target_proc) (\v a->{a & target_proc=fromString v})
} }
where where
b2s True = "True" b2s True = "True"
...@@ -202,6 +206,7 @@ t_StdEnv13 = ...@@ -202,6 +206,7 @@ t_StdEnv13 =
, target_vers = 918 , target_vers = 918
, target_redc = False , target_redc = False
, target_meth = CompileSync , target_meth = CompileSync
, target_proc = DefaultProcessor
} }
t_StdIO13 = t_StdIO13 =
...@@ -228,6 +233,7 @@ t_StdIO13 = ...@@ -228,6 +233,7 @@ t_StdIO13 =
, target_vers = 918 , target_vers = 918
, target_redc = False , target_redc = False
, target_meth = CompileSync , target_meth = CompileSync
, target_proc = DefaultProcessor
} }
t_StdEnv20 :: Target t_StdEnv20 :: Target
...@@ -249,6 +255,7 @@ t_StdEnv20 = ...@@ -249,6 +255,7 @@ t_StdEnv20 =
, target_vers = 916 , target_vers = 916
, target_redc = False , target_redc = False
, target_meth = CompilePers , target_meth = CompilePers
, target_proc = DefaultProcessor
} }
t_StdIO20 = t_StdIO20 =
......
...@@ -193,9 +193,9 @@ CodeGenOptionsTable :: OptionsTable CodeGenOptions ...@@ -193,9 +193,9 @@ CodeGenOptionsTable :: OptionsTable CodeGenOptions
CodeGenOptionsTable = CodeGenOptionsTable =
{ {
SimpleOption "CheckStacks" (\a->a.cs) (\v a->{a & cs=v}), SimpleOption "CheckStacks" (\a->a.cs) (\v a->{a & cs=v}),
SimpleOption "CheckIndexes" (\a->a.ci) (\v a->{a & ci=v}), SimpleOption "CheckIndexes" (\a->a.ci) (\v a->{a & ci=v})
// SimpleOption "KeepABC" (\a->a.kaf) (\v a->{a & kaf=v}), // SimpleOption "KeepABC" (\a->a.kaf) (\v a->{a & kaf=v}),
SimpleOption "TargetProcessor" (\a->a.tp) (\v a->{a & tp=v}) // SimpleOption "TargetProcessor" (\a->a.tp) (\v a->{a & tp=v})
} }
instance fromString Int instance fromString Int
......
...@@ -60,7 +60,7 @@ PR_SetApplicationOptions :: !ApplicationOptions !Project -> Project ...@@ -60,7 +60,7 @@ PR_SetApplicationOptions :: !ApplicationOptions !Project -> Project
PR_SetPaths :: !Bool !(List String) !(List String) !Project -> Project PR_SetPaths :: !Bool !(List String) !(List String) !Project -> Project
PR_GetCodeGenOptions :: !Project -> CodeGenOptions PR_GetCodeGenOptions :: !Project -> CodeGenOptions
PR_GetProcessor :: !Project -> Processor //PR_GetProcessor :: !Project -> Processor
PR_GetApplicationOptions :: !Project -> ApplicationOptions PR_GetApplicationOptions :: !Project -> ApplicationOptions
PR_GetPaths :: !Project -> List String PR_GetPaths :: !Project -> List String
PR_GetRootModuleName :: !Project -> String PR_GetRootModuleName :: !Project -> String
......
...@@ -384,8 +384,8 @@ PR_SetPaths def defs new project=:{Project | built,inflist=infl=:((root=:{InfLis ...@@ -384,8 +384,8 @@ PR_SetPaths def defs new project=:{Project | built,inflist=infl=:((root=:{InfLis
PR_GetCodeGenOptions :: !Project -> CodeGenOptions; PR_GetCodeGenOptions :: !Project -> CodeGenOptions;
PR_GetCodeGenOptions project=:{codegenopt} = codegenopt; PR_GetCodeGenOptions project=:{codegenopt} = codegenopt;
PR_GetProcessor :: !Project -> Processor; //PR_GetProcessor :: !Project -> Processor;
PR_GetProcessor project=:{codegenopt={tp}} = tp; //PR_GetProcessor project=:{codegenopt={tp}} = tp;
PR_GetApplicationOptions :: !Project -> ApplicationOptions; PR_GetApplicationOptions :: !Project -> ApplicationOptions;
PR_GetApplicationOptions project=:{applicationopt} = applicationopt; PR_GetApplicationOptions project=:{applicationopt} = applicationopt;
......
...@@ -11,6 +11,8 @@ import UtilDate ...@@ -11,6 +11,8 @@ import UtilDate
:: Modulename :== String :: Modulename :== String
:: Processor //= CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881 :: Processor //= CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881
DefaultProcessor :: Processor
PlatformProcessors :: [Processor]
ProcessorSuffix :: !Processor -> String ProcessorSuffix :: !Processor -> String
instance == Processor instance == Processor
...@@ -90,7 +92,7 @@ instance == EditOptions ...@@ -90,7 +92,7 @@ instance == EditOptions
{ cs :: !Bool // generate stack checks { cs :: !Bool // generate stack checks
, ci :: !Bool // generate index checks , ci :: !Bool // generate index checks
// , kaf :: !Bool // keep abc-files // , kaf :: !Bool // keep abc-files
, tp :: !Processor // , tp :: !Processor
} }
instance == CodeGenOptions instance == CodeGenOptions
......
...@@ -42,7 +42,13 @@ UnexpectedConstructor typeName string defaultValue ...@@ -42,7 +42,13 @@ UnexpectedConstructor typeName string defaultValue
| PowerPC_MachO | PowerPC_MachO
| I386 | I386
DefaultProcessor :== PlatformDependant I386 PowerPC_Carbon DefaultProcessor :: Processor
DefaultProcessor = PlatformDependant I386 PowerPC_Carbon
PlatformProcessors :: [Processor]
PlatformProcessors = PlatformDependant
[I386]
[PowerPC_Classic,PowerPC_Carbon,PowerPC_MachO]
ProcessorSuffix :: !Processor -> String ProcessorSuffix :: !Processor -> String
ProcessorSuffix CurrentProcessor = ProcessorSuffix DefaultProcessor ProcessorSuffix CurrentProcessor = ProcessorSuffix DefaultProcessor
...@@ -262,7 +268,7 @@ where ...@@ -262,7 +268,7 @@ where
{ cs :: !Bool { cs :: !Bool
, ci :: !Bool , ci :: !Bool
// , kaf :: !Bool // , kaf :: !Bool
, tp :: !Processor // , tp :: !Processor
} }
instance == CodeGenOptions instance == CodeGenOptions
...@@ -270,14 +276,12 @@ where ...@@ -270,14 +276,12 @@ where
(==) :: !CodeGenOptions !CodeGenOptions -> Bool (==) :: !CodeGenOptions !CodeGenOptions -> Bool
(==) cg1 cg2 (==) cg1 cg2
= cg1.cs == cg2.cs && = cg1.cs == cg2.cs &&
cg1.ci == cg2.ci && cg1.ci == cg2.ci
cg1.tp == cg2.tp
DefCodeGenOptions :: CodeGenOptions; DefCodeGenOptions :: CodeGenOptions;
DefCodeGenOptions = DefCodeGenOptions =
{ cs = False { cs = False
, ci = True , ci = True
, tp = CurrentProcessor
} }
// The Application Options: default settings for the application. // The Application Options: default settings for the application.
......
...@@ -156,7 +156,7 @@ Compile ...@@ -156,7 +156,7 @@ Compile
(didit, exitcode, os4) = CallProcess command [] cocldir "" "" "" 99 (didit, exitcode, os4) = CallProcess command [] cocldir "" "" "" 99
diditall = if (os4 == 99) didit didit diditall = if (os4 == 99) didit didit
| not diditall | not diditall
# ps = errwin (["Unable to run compiler: "+++cocl +++ " :"+++toString exitcode]) ps # ps = errwin (["Error: Unable to run compiler: "+++cocl +++ " :"+++toString exitcode]) ps
= (ps,"",SyntaxError) = (ps,"",SyntaxError)