Mercurial > projects > ldc
comparison gen/statements.cpp @ 121:9c79b61fb638 trunk
[svn r125] Renamed/moved a few backend member inside DMD structures for consistency.
Unit tests are now implemented.
author | lindquist |
---|---|
date | Tue, 27 Nov 2007 03:09:36 +0100 |
parents | 5ab8e92611f9 |
children | 36ab367572df |
comparison
equal
deleted
inserted
replaced
120:5ce8ab11e75a | 121:9c79b61fb638 |
---|---|
55 Type* exptype = DtoDType(exp->type); | 55 Type* exptype = DtoDType(exp->type); |
56 TY expty = exptype->ty; | 56 TY expty = exptype->ty; |
57 if (p->topfunc()->getReturnType() == llvm::Type::VoidTy) { | 57 if (p->topfunc()->getReturnType() == llvm::Type::VoidTy) { |
58 assert(DtoIsPassedByRef(exptype)); | 58 assert(DtoIsPassedByRef(exptype)); |
59 | 59 |
60 TypeFunction* f = p->topfunctype(); | 60 IRFunction* f = p->func(); |
61 assert(f->llvmRetInPtr && f->llvmRetArg); | 61 assert(f->type->llvmRetInPtr); |
62 assert(f->decl->llvmRetArg); | |
62 | 63 |
63 if (global.params.symdebug) DtoDwarfStopPoint(loc.linnum); | 64 if (global.params.symdebug) DtoDwarfStopPoint(loc.linnum); |
64 | 65 |
65 DValue* rvar = new DVarValue(f->next, f->llvmRetArg, true); | 66 DValue* rvar = new DVarValue(f->type->next, f->decl->llvmRetArg, true); |
66 | 67 |
67 p->exps.push_back(IRExp(NULL,exp,rvar)); | 68 p->exps.push_back(IRExp(NULL,exp,rvar)); |
68 DValue* e = exp->toElem(p); | 69 DValue* e = exp->toElem(p); |
69 p->exps.pop_back(); | 70 p->exps.pop_back(); |
70 | 71 |
71 if (!e->inPlace()) | 72 if (!e->inPlace()) |
72 DtoAssign(rvar, e); | 73 DtoAssign(rvar, e); |
73 | 74 |
74 IRFunction::FinallyVec& fin = p->func()->finallys; | 75 IRFunction::FinallyVec& fin = f->finallys; |
75 if (fin.empty()) { | 76 if (fin.empty()) { |
76 if (global.params.symdebug) DtoDwarfFuncEnd(p->func()->decl); | 77 if (global.params.symdebug) DtoDwarfFuncEnd(f->decl); |
77 new llvm::ReturnInst(p->scopebb()); | 78 new llvm::ReturnInst(p->scopebb()); |
78 } | 79 } |
79 else { | 80 else { |
80 new llvm::BranchInst(fin.back().retbb, p->scopebb()); | 81 new llvm::BranchInst(fin.back().retbb, p->scopebb()); |
81 } | 82 } |