Mercurial > projects > ldc
comparison gen/tollvm.cpp @ 201:8f9191180c7a trunk
[svn r217] Updated: the rebuild profiles.
Fixed: way to find class data fields was too strict type wise.
Fixed: foreach resulting in an implicit delegate could fail.
author | lindquist |
---|---|
date | Mon, 12 May 2008 22:44:25 +0200 |
parents | aca17e55b7a5 |
children | e881c9b1c738 |
comparison
equal
deleted
inserted
replaced
200:e937752e4541 | 201:8f9191180c7a |
---|---|
1004 llvm::Value* l = lhs->getLVal(); | 1004 llvm::Value* l = lhs->getLVal(); |
1005 llvm::Value* r = rhs->getRVal(); | 1005 llvm::Value* r = rhs->getRVal(); |
1006 Logger::cout() << "assign\nlhs: " << *l << "rhs: " << *r << '\n'; | 1006 Logger::cout() << "assign\nlhs: " << *l << "rhs: " << *r << '\n'; |
1007 const llvm::Type* lit = l->getType()->getContainedType(0); | 1007 const llvm::Type* lit = l->getType()->getContainedType(0); |
1008 if (r->getType() != lit) { | 1008 if (r->getType() != lit) { |
1009 if (DLRValue* lr = lhs->isLRValue()) // handle lvalue cast assignments | 1009 // handle lvalue cast assignments |
1010 if (DLRValue* lr = lhs->isLRValue()) { | |
1011 Logger::println("lvalue cast!"); | |
1010 r = DtoCast(rhs, lr->getLType())->getRVal(); | 1012 r = DtoCast(rhs, lr->getLType())->getRVal(); |
1011 else | 1013 } |
1014 else { | |
1012 r = DtoCast(rhs, lhs->getType())->getRVal(); | 1015 r = DtoCast(rhs, lhs->getType())->getRVal(); |
1016 } | |
1013 Logger::cout() << "really assign\nlhs: " << *l << "rhs: " << *r << '\n'; | 1017 Logger::cout() << "really assign\nlhs: " << *l << "rhs: " << *r << '\n'; |
1018 assert(r->getType() == l->getType()->getContainedType(0)); | |
1014 } | 1019 } |
1015 gIR->ir->CreateStore(r, l); | 1020 gIR->ir->CreateStore(r, l); |
1016 } | 1021 } |
1017 } | 1022 } |
1018 | 1023 |