changeset 98:7f9240d4ddc1 new_gen

Fixed tests - forgot some stuff in codegen.
author Anders Johnsen <skabet@gmail.com>
date Tue, 06 May 2008 21:55:29 +0200
parents 198ad05f3ace
children 857f0d530789
files ast/Exp.d gen/CodeGen.d
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ast/Exp.d	Tue May 06 21:28:05 2008 +0200
+++ b/ast/Exp.d	Tue May 06 21:55:29 2008 +0200
@@ -511,7 +511,7 @@
         DType t = type;
 
         if(name == "main")
-            return "_Dmain";
+            return "main";
 
         return "_D"~name~t.mangle;
     }
--- a/gen/CodeGen.d	Tue May 06 21:28:05 2008 +0200
+++ b/gen/CodeGen.d	Tue May 06 21:55:29 2008 +0200
@@ -321,8 +321,8 @@
                 }
                 // BUG: doesn't do implicit type-conversion
                 if(callExp.sret)
-                    return b.buildCall(m.getNamedFunction(id.get), args, "");
-                return b.buildCall(m.getNamedFunction(id.get), args, ".call");
+                    return b.buildCall(m.getNamedFunction(id.getMangled), args, "");
+                return b.buildCall(m.getNamedFunction(id.getMangled), args, ".call");
             case ExpType.CastExp:
                 auto castExp = cast(CastExp)exp;
                 auto value = genExpression(castExp.exp);
@@ -409,7 +409,7 @@
                     Value False = ConstantInt.GetS(cond.type, 0);
                     cond = b.buildICmp(IntPredicate.NE, cond, False, ".cond");
                 }
-                auto func_name = stmt.env.parentFunction().identifier.get;
+                auto func_name = stmt.env.parentFunction().identifier.getMangled;
                 Function func = m.getNamedFunction(func_name);
                 bool has_else = (ifStmt.else_body !is null);