# HG changeset patch # User Anders Johnsen # Date 1210102085 -7200 # Node ID 198ad05f3ace0e6940ea2cf16b7444cfb7e5dcb5 # Parent 438e6ed4cda127d99cd34d45011daf808251d8a3 "-c" as argument now generates out.o (only works on linux now) diff -r 438e6ed4cda1 -r 198ad05f3ace dang/compiler.d --- a/dang/compiler.d Tue May 06 18:51:08 2008 +0200 +++ b/dang/compiler.d Tue May 06 21:28:05 2008 +0200 @@ -28,6 +28,8 @@ sema.ScopeCheck, sema.TypeCheck; +import tango.stdc.posix.unistd; + import Opt = dang.OptParse; void checkFiles(char[][] *files) @@ -152,8 +154,18 @@ (Module m, SourceManager sm) { StopWatch w; w.start; auto llvmGen = new CodeGen(); - auto llc = new Process("llc"); - llvmGen.gen(m, llc.stdin.fileHandle, optimize, inline); + auto llc = new Process("llc","-o=-"); + auto gcc = new Process("gcc","-c","-o","out.o","-x","assembler","-"); + llc.execute(); + int i = dup(llc.stdin.fileHandle); + llc.stdin.detach; + llvmGen.gen(m, i, optimize, inline); + llc.wait(); + gcc.execute(); + gcc.stdin.copy(llc.stdout); + gcc.stdin.detach; + gcc.wait(); + timings ~= Measurement("Generating assemble bytecode", w.stop); }); else if (what == "dot")