diff gen/CodeGen.d @ 89:a49bb982a7b0 new_gen

Using the new SourceLocation system to handle errors. Also, this is the first push for making the errors don't throw, but continue to check the source.
author Anders Johnsen <skabet@gmail.com>
date Sun, 04 May 2008 20:27:01 +0200
parents eb5b2c719a39
children 771ac63898e2
line wrap: on
line diff
--- a/gen/CodeGen.d	Sun May 04 18:13:46 2008 +0200
+++ b/gen/CodeGen.d	Sun May 04 20:27:01 2008 +0200
@@ -65,7 +65,7 @@
         b.dispose();
     }
 
-    void gen(Decl[] decls, bool optimize, bool inline)
+    void gen(Decl[] decls, uint handle, bool optimize, bool inline)
     {
         // create module
         m = new Module("main_module");
@@ -89,7 +89,7 @@
                         Type pointer = PointerType.Get(llvm(st));
                         param_types ~= pointer;
                     }
-                    if(auto ar = t.asArray)
+                    else if(auto ar = t.asArray)
                     {
                         Type pointer = PointerType.Get(llvm(ar));
                         param_types ~= pointer;
@@ -141,7 +141,7 @@
         if(optimize)
             m.optimize(inline);
 
-        m.writeBitcodeToFile("out.bc");
+        m.writeBitcodeToFileHandle(handle);
     }
 
     void genRootDecl(Decl decl)
@@ -531,7 +531,6 @@
                 else assert(0, "Can only index pointers and arrays");
             case ExpType.MemberReference:
                 auto mem = cast(MemberReference)exp;
-                Stdout(mem.target).newline;
                 switch(mem.target.expType)
                 {
                     case ExpType.Identifier: