comparison gen/toir.cpp @ 1231:212ec2d9d176

Fixed some minitest regressions.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 16 Apr 2009 19:21:30 +0200
parents 79758fd2f48a
children 465a77c904d4
comparison
equal deleted inserted replaced
1230:e67c85d6e680 1231:212ec2d9d176
980 assert(type->toBasetype()->ty == Tpointer); 980 assert(type->toBasetype()->ty == Tpointer);
981 return DtoBitCast(gep, DtoType(type)); 981 return DtoBitCast(gep, DtoType(type));
982 } 982 }
983 else if (e1->op == TOKstructliteral) 983 else if (e1->op == TOKstructliteral)
984 { 984 {
985 // FIXME: is this right?
985 StructLiteralExp* slexp = (StructLiteralExp*)e1; 986 StructLiteralExp* slexp = (StructLiteralExp*)e1;
986 LLConstant* lit = slexp->toConstElem(p); 987 LLConstant* lit = slexp->toConstElem(p);
987 return lit; 988 return lit;
988 } 989 }
989 // not yet supported 990 // not yet supported
2407 inits[i] = DtoLoad(inits[i]); 2408 inits[i] = DtoLoad(inits[i]);
2408 } 2409 }
2409 } 2410 }
2410 2411
2411 // vector of values to build aggregate from 2412 // vector of values to build aggregate from
2412 std::vector<LLValue*> values;// = DtoStructLiteralValues(sd, inits); 2413 std::vector<LLValue*> values = DtoStructLiteralValues(sd, inits);
2413 assert(0 && "struct literal exp todo");
2414 2414
2415 // get the struct type from the values 2415 // get the struct type from the values
2416 size_t n = values.size(); 2416 size_t n = values.size();
2417 std::vector<const LLType*> types(n, NULL); 2417 std::vector<const LLType*> types(n, NULL);
2418 2418
2457 for (size_t i = 0; i < nexprs; i++) 2457 for (size_t i = 0; i < nexprs; i++)
2458 if (exprs[i]) 2458 if (exprs[i])
2459 inits[i] = exprs[i]->toConstElem(p); 2459 inits[i] = exprs[i]->toConstElem(p);
2460 2460
2461 // vector of values to build aggregate from 2461 // vector of values to build aggregate from
2462 std::vector<LLValue*> values;// = DtoStructLiteralValues(sd, inits); 2462 std::vector<LLValue*> values = DtoStructLiteralValues(sd, inits);
2463 assert(0 && "struct literal const exp todo");
2464 2463
2465 // we know those values are constants.. cast them 2464 // we know those values are constants.. cast them
2466 std::vector<LLConstant*> constvals(values.size(), NULL); 2465 std::vector<LLConstant*> constvals(values.size(), NULL);
2467 for (size_t i = 0; i < values.size(); ++i) 2466 for (size_t i = 0; i < values.size(); ++i)
2468 constvals[i] = llvm::cast<LLConstant>(values[i]); 2467 constvals[i] = llvm::cast<LLConstant>(values[i]);