Mercurial > projects > ldc
comparison ir/irclass.cpp @ 1457:ed70675862c8
Remove some unnecessary `#if`s. The D1 frontend has a Type::nextOf() which just
returns `next`.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Tue, 02 Jun 2009 18:41:10 +0200 |
parents | f35a9a77d256 |
children | a5526b7a5ae6 |
comparison
equal
deleted
inserted
replaced
1456:7b218ec1044f | 1457:ed70675862c8 |
---|---|
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()); | 114 const llvm::Type* InterfaceTy = DtoType(idx->type->nextOf()); |
116 #else | |
117 const llvm::Type* InterfaceTy = DtoType(idx->type->next); | |
118 #endif | |
119 | 115 |
120 // create Interface[N] | 116 // create Interface[N] |
121 const llvm::ArrayType* array_type = llvm::ArrayType::get(InterfaceTy,n); | 117 const llvm::ArrayType* array_type = llvm::ArrayType::get(InterfaceTy,n); |
122 | 118 |
123 // put it in a global | 119 // put it in a global |
328 std::vector<llvm::Constant*> constants; | 324 std::vector<llvm::Constant*> constants; |
329 constants.reserve(vtbl_array.dim); | 325 constants.reserve(vtbl_array.dim); |
330 | 326 |
331 // start with the interface info | 327 // start with the interface info |
332 VarDeclarationIter interfaces_idx(ClassDeclaration::classinfo->fields, 3); | 328 VarDeclarationIter interfaces_idx(ClassDeclaration::classinfo->fields, 3); |
333 #if DMDV2 | |
334 Type* first = interfaces_idx->type->nextOf()->pointerTo(); | 329 Type* first = interfaces_idx->type->nextOf()->pointerTo(); |
335 #else | |
336 Type* first = interfaces_idx->type->next->pointerTo(); | |
337 #endif | |
338 | 330 |
339 // index into the interfaces array | 331 // index into the interfaces array |
340 llvm::Constant* idxs[2] = { | 332 llvm::Constant* idxs[2] = { |
341 DtoConstSize_t(0), | 333 DtoConstSize_t(0), |
342 DtoConstSize_t(interfaces_index) | 334 DtoConstSize_t(interfaces_index) |