Skip to content

Commit

Permalink
remove ugly workaround for a bug. filed as issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
kavon committed Sep 20, 2018
1 parent 0aa8a73 commit 2c0e72e
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/tools/mc/driver/main-fn.sml
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,6 @@ functor MainFn (
else err "error compiling generated assembly code\n"
end

(* MLRISC is incorrectly naming some of the 8-bit registers, so as a simple
* workaround, we are just going to find/replace them in the output text file
*)
fun replace8BitRegisters asmFile = let
val cmd = "sed -i \"s/%ah/%spl/g; s/%ch/%bpl/g; s/%dh/%sil/g; s/%bh/%dil/g\" " ^ asmFile
in
ignore (OS.Process.system cmd)
end

fun codegen (verbose, outFile, cfg) = let
val outStrm = TextIO.openOut outFile
fun doit () = if (Controls.get BasicControl.llvm)
Expand All @@ -174,10 +165,7 @@ functor MainFn (
in
AsmStream.withStream outStrm doit ();
TextIO.closeOut outStrm;
if not (Controls.get BasicControl.llvm)
then (replace8BitRegisters outFile)
else ();
buildExe (verbose, outFile)
buildExe (verbose, outFile)
end (* compile *)

fun runPreproc (dir', cmd, args) = let
Expand Down

0 comments on commit 2c0e72e

Please sign in to comment.