Mercurial > projects > ldc
comparison ir/irclass.cpp @ 1452:638d16625da2
LDC 2 compiles again.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 30 May 2009 17:23:32 +0100 |
parents | e5c5d354c649 |
children | f35a9a77d256 |
comparison
equal
deleted
inserted
replaced
1423:42bd767ec5a4 | 1452:638d16625da2 |
---|---|
109 size_t n = type->irtype->isClass()->getNumInterfaceVtbls(); | 109 size_t n = type->irtype->isClass()->getNumInterfaceVtbls(); |
110 assert(n > 0 && "getting ClassInfo.interfaces storage symbol, but we " | 110 assert(n > 0 && "getting ClassInfo.interfaces storage symbol, but we " |
111 "don't implement any interfaces"); | 111 "don't implement any interfaces"); |
112 | 112 |
113 VarDeclarationIter idx(ClassDeclaration::classinfo->fields, 3); | 113 VarDeclarationIter idx(ClassDeclaration::classinfo->fields, 3); |
114 #if DMDV2 | |
115 const llvm::Type* InterfaceTy = DtoType(idx->type->nextOf()); | |
116 #else | |
114 const llvm::Type* InterfaceTy = DtoType(idx->type->next); | 117 const llvm::Type* InterfaceTy = DtoType(idx->type->next); |
118 #endif | |
115 | 119 |
116 // create Interface[N] | 120 // create Interface[N] |
117 const llvm::ArrayType* array_type = llvm::ArrayType::get(InterfaceTy,n); | 121 const llvm::ArrayType* array_type = llvm::ArrayType::get(InterfaceTy,n); |
118 | 122 |
119 // put it in a global | 123 // put it in a global |
326 std::vector<llvm::Constant*> constants; | 330 std::vector<llvm::Constant*> constants; |
327 constants.reserve(vtbl_array.dim); | 331 constants.reserve(vtbl_array.dim); |
328 | 332 |
329 // start with the interface info | 333 // start with the interface info |
330 VarDeclarationIter interfaces_idx(ClassDeclaration::classinfo->fields, 3); | 334 VarDeclarationIter interfaces_idx(ClassDeclaration::classinfo->fields, 3); |
335 #if DMDV2 | |
336 Type* first = interfaces_idx->type->nextOf()->pointerTo(); | |
337 #else | |
331 Type* first = interfaces_idx->type->next->pointerTo(); | 338 Type* first = interfaces_idx->type->next->pointerTo(); |
339 #endif | |
332 | 340 |
333 // index into the interfaces array | 341 // index into the interfaces array |
334 llvm::Constant* idxs[2] = { | 342 llvm::Constant* idxs[2] = { |
335 DtoConstSize_t(0), | 343 DtoConstSize_t(0), |
336 DtoConstSize_t(interfaces_index) | 344 DtoConstSize_t(interfaces_index) |