Mercurial > projects > ldc
comparison gen/functions.cpp @ 399:0e6b4d65d3f8
Give error messages for invalid casts.
This required passing Loc information to certain functions.
Fixes nocompile/b/bug_cgcs_354_A/B.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 26 Jul 2008 17:19:16 +0200 |
parents | d632801b15f0 |
children | 8b7cee241e91 |
comparison
equal
deleted
inserted
replaced
398:811f82dfddbd | 399:0e6b4d65d3f8 |
---|---|
791 // byval arg, but expr has no storage yet | 791 // byval arg, but expr has no storage yet |
792 else if (DtoIsPassedByRef(argexp->type) && (arg->isSlice() || arg->isComplex() || arg->isNull())) | 792 else if (DtoIsPassedByRef(argexp->type) && (arg->isSlice() || arg->isComplex() || arg->isNull())) |
793 { | 793 { |
794 LLValue* alloc = new llvm::AllocaInst(DtoType(argexp->type), "tmpparam", gIR->topallocapoint()); | 794 LLValue* alloc = new llvm::AllocaInst(DtoType(argexp->type), "tmpparam", gIR->topallocapoint()); |
795 DVarValue* vv = new DVarValue(argexp->type, alloc, true); | 795 DVarValue* vv = new DVarValue(argexp->type, alloc, true); |
796 DtoAssign(vv, arg); | 796 DtoAssign(argexp->loc, vv, arg); |
797 arg = vv; | 797 arg = vv; |
798 } | 798 } |
799 | 799 |
800 return arg; | 800 return arg; |
801 } | 801 } |
805 void DtoVariadicArgument(Expression* argexp, LLValue* dst) | 805 void DtoVariadicArgument(Expression* argexp, LLValue* dst) |
806 { | 806 { |
807 Logger::println("DtoVariadicArgument"); | 807 Logger::println("DtoVariadicArgument"); |
808 LOG_SCOPE; | 808 LOG_SCOPE; |
809 DVarValue vv(argexp->type, dst, true); | 809 DVarValue vv(argexp->type, dst, true); |
810 DtoAssign(&vv, argexp->toElem(gIR)); | 810 DtoAssign(argexp->loc, &vv, argexp->toElem(gIR)); |
811 } | 811 } |
812 | 812 |
813 ////////////////////////////////////////////////////////////////////////////////////////// | 813 ////////////////////////////////////////////////////////////////////////////////////////// |