diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
commit | b6123d25d202d3cbe1f12d24dec129a90d5051ec (patch) | |
tree | 5537d58d7dba623127804b35813d7c0ec673f8b9 /src/compiler.sml | |
parent | 6314b4c27a14576b356258dad74607168135cb51 (diff) |
Optimizing 'case' in Mono_reduce
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index eadb58d7..2be17762 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -422,6 +422,19 @@ fun testCjrize job = handle CjrEnv.UnboundNamed n => print ("Unbound named " ^ Int.toString n ^ "\n") +fun compileC {cname, oname, ename} = + let + val compile = "gcc -O3 -I include -c " ^ cname ^ " -o " ^ oname + val link = "gcc -pthread -O3 clib/lacweb.o " ^ oname ^ " clib/driver.o -o " ^ ename + in + if not (OS.Process.isSuccess (OS.Process.system compile)) then + print "C compilation failed\n" + else if not (OS.Process.isSuccess (OS.Process.system link)) then + print "C linking failed\n" + else + print "Success\n" + end + fun compile job = case cjrize job of NONE => print "Laconic compilation failed\n" @@ -431,21 +444,13 @@ fun compile job = val oname = "/tmp/lacweb.o" val ename = "/tmp/webapp" - val compile = "gcc -O3 -I include -c " ^ cname ^ " -o " ^ oname - val link = "gcc -pthread -O3 clib/lacweb.o " ^ oname ^ " clib/driver.o -o " ^ ename - val outf = TextIO.openOut cname val s = TextIOPP.openOut {dst = outf, wid = 80} in Print.fprint s (CjrPrint.p_file CjrEnv.empty file); TextIO.closeOut outf; - if not (OS.Process.isSuccess (OS.Process.system compile)) then - print "C compilation failed\n" - else if not (OS.Process.isSuccess (OS.Process.system link)) then - print "C linking failed\n" - else - print "Success\n" + compileC {cname = cname, oname = oname, ename = ename} end end |