Mercurial > projects > ldc
comparison gen/toir.cpp @ 169:2df270e1ba59 trunk
[svn r185] Fixed broken nested classes with data members, did DMD change the class layout? tango.text.Regex now compiles.
Commented some of the *very* verbose logging for -vv option.
author | lindquist |
---|---|
date | Tue, 06 May 2008 03:07:21 +0200 |
parents | adca7f32fb6d |
children | 6476da35a0fe |
comparison
equal
deleted
inserted
replaced
168:08cfde5f70d3 | 169:2df270e1ba59 |
---|---|
539 p->topexp()->v = l; | 539 p->topexp()->v = l; |
540 DValue* r = e2->toElem(p); | 540 DValue* r = e2->toElem(p); |
541 | 541 |
542 p->exps.pop_back(); | 542 p->exps.pop_back(); |
543 | 543 |
544 Logger::println("performing assignment"); | |
545 | |
544 DImValue* im = r->isIm(); | 546 DImValue* im = r->isIm(); |
545 if (!im || !im->inPlace()) { | 547 if (!im || !im->inPlace()) { |
546 Logger::println("assignment not inplace"); | 548 Logger::println("assignment not inplace"); |
547 if (l->isArrayLen()) | 549 if (l->isArrayLen()) |
548 DtoResizeDynArray(l->getLVal(), r->getRVal()); | 550 DtoResizeDynArray(l->getLVal(), r->getRVal()); |
1005 ++argiter; | 1007 ++argiter; |
1006 } | 1008 } |
1007 | 1009 |
1008 // this arguments | 1010 // this arguments |
1009 if (dfn && dfn->vthis) { | 1011 if (dfn && dfn->vthis) { |
1010 Logger::cout() << "This Call func val:" << *funcval << '\n'; | 1012 Logger::cout() << "This Call" << '\n';// func val:" << *funcval << '\n'; |
1011 if (dfn->vthis->getType() != argiter->get()) { | 1013 if (dfn->vthis->getType() != argiter->get()) { |
1012 //Logger::cout() << "value: " << *dfn->vthis << " totype: " << *argiter->get() << '\n'; | 1014 //Logger::cout() << "value: " << *dfn->vthis << " totype: " << *argiter->get() << '\n'; |
1013 llargs[j] = DtoBitCast(dfn->vthis, argiter->get()); | 1015 llargs[j] = DtoBitCast(dfn->vthis, argiter->get()); |
1014 } | 1016 } |
1015 else { | 1017 else { |
1153 } | 1155 } |
1154 } | 1156 } |
1155 } | 1157 } |
1156 } | 1158 } |
1157 | 1159 |
1158 #if 1 | 1160 #if 0 |
1159 Logger::println("%d params passed", n); | 1161 Logger::println("%d params passed", n); |
1160 for (int i=0; i<llargs.size(); ++i) { | 1162 for (int i=0; i<llargs.size(); ++i) { |
1161 assert(llargs[i]); | 1163 assert(llargs[i]); |
1162 Logger::cout() << "arg["<<i<<"] = " << *llargs[i] << '\n'; | 1164 Logger::cout() << "arg["<<i<<"] = " << *llargs[i] << '\n'; |
1163 } | 1165 } |
1166 // void returns cannot not be named | 1168 // void returns cannot not be named |
1167 const char* varname = ""; | 1169 const char* varname = ""; |
1168 if (llfnty->getReturnType() != llvm::Type::VoidTy) | 1170 if (llfnty->getReturnType() != llvm::Type::VoidTy) |
1169 varname = "tmp"; | 1171 varname = "tmp"; |
1170 | 1172 |
1171 Logger::cout() << "Calling: " << *funcval << '\n'; | 1173 //Logger::cout() << "Calling: " << *funcval << '\n'; |
1172 | 1174 |
1173 // call the function | 1175 // call the function |
1174 llvm::CallInst* call = new llvm::CallInst(funcval, llargs.begin(), llargs.end(), varname, p->scopebb()); | 1176 llvm::CallInst* call = new llvm::CallInst(funcval, llargs.begin(), llargs.end(), varname, p->scopebb()); |
1175 llvm::Value* retllval = (retinptr) ? llargs[0] : call; | 1177 llvm::Value* retllval = (retinptr) ? llargs[0] : call; |
1176 | 1178 |
1892 assert(!allocator && "custom allocators not yet supported"); | 1894 assert(!allocator && "custom allocators not yet supported"); |
1893 | 1895 |
1894 Type* ntype = DtoDType(newtype); | 1896 Type* ntype = DtoDType(newtype); |
1895 | 1897 |
1896 if (ntype->ty == Tclass) { | 1898 if (ntype->ty == Tclass) { |
1899 Logger::println("new class"); | |
1897 return DtoNewClass((TypeClass*)ntype, this); | 1900 return DtoNewClass((TypeClass*)ntype, this); |
1898 } | 1901 } |
1899 | 1902 |
1900 const llvm::Type* t = DtoType(ntype); | 1903 const llvm::Type* t = DtoType(ntype); |
1901 | 1904 |