comparison gen/CodeGen.d @ 195:4e1a7265d620

Made a BuildTypes pass, to give all exp's a type.
author Anders Johnsen <skabet@gmail.com>
date Tue, 29 Jul 2008 15:50:24 +0200
parents fda35d57847e
children
comparison
equal deleted inserted replaced
194:08f68d684047 195:4e1a7265d620
342 return RValue(target.getAddress()); 342 return RValue(target.getAddress());
343 case ExpType.AssignExp: 343 case ExpType.AssignExp:
344 auto AE = cast(AssignExp)exp; 344 auto AE = cast(AssignExp)exp;
345 LValue dst = genLValue(AE.identifier); 345 LValue dst = genLValue(AE.identifier);
346 RValue src = genExpression(AE.exp); 346 RValue src = genExpression(AE.exp);
347 storeThroughLValue(dst, src, AE.exp.type()); 347 storeThroughLValue(dst, src, AE.exp.type);
348 return src; 348 return src;
349 case ExpType.Index: 349 case ExpType.Index:
350 auto indexExp = cast(IndexExp)exp; 350 auto indexExp = cast(IndexExp)exp;
351 return loadLValue(genLValue(exp)); 351 return loadLValue(genLValue(exp));
352 case ExpType.NewExp: 352 case ExpType.NewExp:
353 auto newExp = cast(NewExp)exp; 353 auto newExp = cast(NewExp)exp;
354 DClass type = newExp.newType.type().asClass(); 354 DClass type = newExp.newType.type.asClass();
355 auto llvm_type = cast(PointerType)llvm(type); 355 auto llvm_type = cast(PointerType)llvm(type);
356 auto pointer = b.buildMalloc(llvm_type.elementType(), "new"); 356 auto pointer = b.buildMalloc(llvm_type.elementType(), "new");
357 scope args = new Value[newExp.c_args.length]; 357 scope args = new Value[newExp.c_args.length];
358 foreach (i, arg; newExp.c_args) 358 foreach (i, arg; newExp.c_args)
359 args[i] = genExpression(arg).value; 359 args[i] = genExpression(arg).value;