comparison ir/irtypeclass.cpp @ 1245:465a77c904d4

Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Fri, 17 Apr 2009 14:38:29 +0200
parents 212ec2d9d176
children 752bed475b75
comparison
equal deleted inserted replaced
1244:e1b0c5c74c58 1245:465a77c904d4
107 defaultTypes.push_back(llvm::PointerType::get(ivtbl_type, 0)); 107 defaultTypes.push_back(llvm::PointerType::get(ivtbl_type, 0));
108 108
109 offset += PTRSIZE; 109 offset += PTRSIZE;
110 110
111 // add to the interface map 111 // add to the interface map
112 // FIXME: and all it's baseinterfaces 112 addInterfaceToMap(b->base, field_index);
113 if (interfaceMap.find(b->base) == interfaceMap.end())
114 interfaceMap.insert(std::make_pair(b->base, field_index));
115 field_index++; 113 field_index++;
116 114
117 // inc count 115 // inc count
118 num_interface_vtbls++; 116 num_interface_vtbls++;
119 } 117 }
250 return ~0; 248 return ~0;
251 return it->second; 249 return it->second;
252 } 250 }
253 251
254 ////////////////////////////////////////////////////////////////////////////// 252 //////////////////////////////////////////////////////////////////////////////
253
254 void IrTypeClass::addInterfaceToMap(ClassDeclaration * inter, size_t index)
255 {
256 // don't duplicate work or overwrite indices
257 if (interfaceMap.find(inter) != interfaceMap.end())
258 return;
259
260 // add this interface
261 interfaceMap.insert(std::make_pair(inter, index));
262
263 // add all its base interfaces recursively
264 for (size_t i = 0; i < inter->interfaces_dim; i++)
265 {
266 BaseClass* b = inter->interfaces[i];
267 addInterfaceToMap(b->base, index);
268 }
269 }
270
271 //////////////////////////////////////////////////////////////////////////////