Mercurial > projects > ldc
comparison ir/irclass.cpp @ 1463:a5526b7a5ae6
D2:
Applied function type from D1 frontend that got removed in D2, it's critical for member function type to be correct.
Fixed a bunch of type discrepancies in druntime object.di vs. genobj.d .
Disabled (#if 0) some potentally very large type dumps for -vv .
Updated classinfo and typeinfo generation for D2, almost complete now.
Added finer grained checks for vtbl type mismatching, aids debugging.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Wed, 03 Jun 2009 02:28:48 +0200 |
parents | ed70675862c8 |
children | ad7f2f1862d6 |
comparison
equal
deleted
inserted
replaced
1462:f0423003caa6 | 1463:a5526b7a5ae6 |
---|---|
176 | 176 |
177 #if 0 | 177 #if 0 |
178 IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl; | 178 IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl; |
179 IF_LOG Logger::cout() << "vtbl type: " << *type->irtype->isClass()->getVtbl() << std::endl; | 179 IF_LOG Logger::cout() << "vtbl type: " << *type->irtype->isClass()->getVtbl() << std::endl; |
180 #endif | 180 #endif |
181 | |
182 #if 1 | |
183 | |
184 size_t nc = constants.size(); | |
185 const LLType* vtblTy = type->irtype->isClass()->getVtbl(); | |
186 for (size_t i = 0; i < nc; ++i) | |
187 { | |
188 if (constVtbl->getOperand(i)->getType() != vtblTy->getContainedType(i)) | |
189 { | |
190 Logger::cout() << "type mismatch for entry # " << i << " in vtbl initializer" << std::endl; | |
191 | |
192 constVtbl->getOperand(i)->dump(); | |
193 vtblTy->getContainedType(i)->dump(gIR->module); | |
194 } | |
195 } | |
196 | |
197 #endif | |
198 | |
181 assert(constVtbl->getType() == type->irtype->isClass()->getVtbl() && | 199 assert(constVtbl->getType() == type->irtype->isClass()->getVtbl() && |
182 "vtbl initializer type mismatch"); | 200 "vtbl initializer type mismatch"); |
183 | 201 |
184 return constVtbl; | 202 return constVtbl; |
185 } | 203 } |