Fixed weird struct problem from downs, see mini/compile_structs1.d

Rewrote DtoIndexStruct/Class , the old implementation were way too complex for what we really need now - since the DotVar changes.
This commit is contained in:
Tomas Lindquist Olsen
2008-10-14 15:35:49 +02:00
parent 180487b614
commit 379bd9c330
8 changed files with 56 additions and 168 deletions
-14
View File
@@ -389,20 +389,6 @@ LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* var, llvm::B
//////////////////////////////////////////////////////////////////////////////////////////
LLValue* DtoGEPi(LLValue* ptr, const DStructIndexVector& src, const char* var, llvm::BasicBlock* bb)
{
size_t n = src.size();
LLSmallVector<LLValue*, 3> dst(n);
size_t j=0;
for (DStructIndexVector::const_iterator i=src.begin(); i!=src.end(); ++i)
dst[j++] = DtoConstUint(*i);
return llvm::GetElementPtrInst::Create(ptr, dst.begin(), dst.end(), var?var:"tmp", bb?bb:gIR->scopebb());
}
//////////////////////////////////////////////////////////////////////////////////////////
LLValue* DtoGEPi1(LLValue* ptr, unsigned i, const char* var, llvm::BasicBlock* bb)
{
return llvm::GetElementPtrInst::Create(ptr, DtoConstUint(i), var?var:"tmp", bb?bb:gIR->scopebb());