Mercurial > projects > ldc
comparison gen/toir.cpp @ 172:68a7dd38c03c trunk
[svn r188] Fixed using a dereferenced pointer argument as both l- and r-value. fixes tango.io.FileRoots.
Reorganized the tangotests dir a bit.
author | lindquist |
---|---|
date | Tue, 06 May 2008 07:26:27 +0200 |
parents | 6476da35a0fe |
children | db9890b3fb64 |
comparison
equal
deleted
inserted
replaced
171:95f07e3f8bb9 | 172:68a7dd38c03c |
---|---|
209 return new DVarValue(vd, DtoNestedVariable(vd), true); | 209 return new DVarValue(vd, DtoNestedVariable(vd), true); |
210 } | 210 } |
211 // function parameter | 211 // function parameter |
212 else if (vd->isParameter()) { | 212 else if (vd->isParameter()) { |
213 Logger::println("function param"); | 213 Logger::println("function param"); |
214 if (!gIR->irDsymbol[vd].getIrValue()) { | |
215 assert(0); // should be fixed now | |
216 // TODO: determine this properly | |
217 // this happens when the DMD frontend generates by pointer wrappers for struct opEquals(S) and opCmp(S) | |
218 gIR->irDsymbol[vd].getIrValue() = &p->func()->func->getArgumentList().back(); | |
219 } | |
220 if (vd->isRef() || vd->isOut() || DtoIsPassedByRef(vd->type) || llvm::isa<llvm::AllocaInst>(gIR->irDsymbol[vd].getIrValue())) { | 214 if (vd->isRef() || vd->isOut() || DtoIsPassedByRef(vd->type) || llvm::isa<llvm::AllocaInst>(gIR->irDsymbol[vd].getIrValue())) { |
221 return new DVarValue(vd, gIR->irDsymbol[vd].getIrValue(), true); | 215 return new DVarValue(vd, gIR->irDsymbol[vd].getIrValue(), true); |
222 } | 216 } |
223 else if (llvm::isa<llvm::Argument>(gIR->irDsymbol[vd].getIrValue())) { | 217 else if (llvm::isa<llvm::Argument>(gIR->irDsymbol[vd].getIrValue())) { |
224 return new DImValue(type, gIR->irDsymbol[vd].getIrValue()); | 218 return new DImValue(type, gIR->irDsymbol[vd].getIrValue()); |
1369 DValue* l = e1->toElem(p); | 1363 DValue* l = e1->toElem(p); |
1370 | 1364 |
1371 Type* t = DtoDType(type); | 1365 Type* t = DtoDType(type); |
1372 Type* e1type = DtoDType(e1->type); | 1366 Type* e1type = DtoDType(e1->type); |
1373 | 1367 |
1374 //Logger::print("e1type=%s\n", e1type->toChars()); | 1368 //Logger::println("e1type=%s", e1type->toChars()); |
1369 //Logger::cout() << *DtoType(e1type) << '\n'; | |
1375 | 1370 |
1376 if (VarDeclaration* vd = var->isVarDeclaration()) { | 1371 if (VarDeclaration* vd = var->isVarDeclaration()) { |
1377 llvm::Value* arrptr; | 1372 llvm::Value* arrptr; |
1378 if (e1type->ty == Tpointer) { | 1373 if (e1type->ty == Tpointer) { |
1379 assert(e1type->next->ty == Tstruct); | 1374 assert(e1type->next->ty == Tstruct); |