mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 22:50:53 +03:00
remove all the "tmp" IR names
This commit is contained in:
parent
7eb001f55d
commit
6db62ee8a9
12 changed files with 142 additions and 142 deletions
|
@ -214,9 +214,9 @@ LLValue* DtoAAEquals(Loc& loc, TOK op, DValue* l, DValue* r)
|
|||
LLValue* abval = DtoBitCast(r->getRVal(), funcTy->getParamType(2));
|
||||
LLValue* aaTypeInfo = DtoTypeInfoOf(t);
|
||||
LLValue* res = gIR->CreateCallOrInvoke3(func, aaTypeInfo, aaval, abval, "aaEqRes").getInstruction();
|
||||
res = gIR->ir->CreateICmpNE(res, DtoConstInt(0), "tmp");
|
||||
res = gIR->ir->CreateICmpNE(res, DtoConstInt(0));
|
||||
if (op == TOKnotequal)
|
||||
res = gIR->ir->CreateNot(res, "tmp");
|
||||
res = gIR->ir->CreateNot(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -484,7 +484,7 @@ void initializeArrayLiteral(IRState* p, ArrayLiteralExp* ale, LLValue* dstMem)
|
|||
{
|
||||
DValue* e = toElem((*ale->elements)[i]);
|
||||
|
||||
LLValue* elemAddr = DtoGEPi(dstMem, 0, i, "tmp", p->scopebb());
|
||||
LLValue* elemAddr = DtoGEPi(dstMem, 0, i, "", p->scopebb());
|
||||
DVarValue* vv = new DVarValue(e->type, elemAddr);
|
||||
DtoAssign(ale->loc, vv, e);
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ static LLValue* get_slice_ptr(DSliceValue* e, LLValue*& sz)
|
|||
{
|
||||
assert(e->len != 0);
|
||||
LLType* t = e->ptr->getType()->getContainedType(0);
|
||||
sz = gIR->ir->CreateMul(DtoConstSize_t(getTypePaddedSize(t)), e->len, "tmp");
|
||||
sz = gIR->ir->CreateMul(DtoConstSize_t(getTypePaddedSize(t)), e->len);
|
||||
return DtoBitCast(e->ptr, getVoidPtrType());
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ void DtoArrayCopyToSlice(Loc& loc, DSliceValue* dst, DValue* src)
|
|||
|
||||
LLValue* srcarr = DtoBitCast(DtoArrayPtr(src), getVoidPtrType());
|
||||
LLType* arrayelemty = voidToI8(DtoType(src->getType()->nextOf()->toBasetype()));
|
||||
LLValue* sz2 = gIR->ir->CreateMul(DtoConstSize_t(getTypePaddedSize(arrayelemty)), DtoArrayLen(src), "tmp");
|
||||
LLValue* sz2 = gIR->ir->CreateMul(DtoConstSize_t(getTypePaddedSize(arrayelemty)), DtoArrayLen(src));
|
||||
|
||||
copySlice(loc, dstarr, sz1, srcarr, sz2);
|
||||
}
|
||||
|
@ -869,7 +869,7 @@ static LLValue* DtoArrayEqCmp_impl(Loc& loc, const char* func, DValue* l, DValue
|
|||
args.push_back(DtoBitCast(tival, fn->getFunctionType()->getParamType(2)));
|
||||
}
|
||||
|
||||
LLCallSite call = gIR->CreateCallOrInvoke(fn, args, "tmp");
|
||||
LLCallSite call = gIR->CreateCallOrInvoke(fn, args);
|
||||
|
||||
return call.getInstruction();
|
||||
}
|
||||
|
@ -878,9 +878,9 @@ static LLValue* DtoArrayEqCmp_impl(Loc& loc, const char* func, DValue* l, DValue
|
|||
LLValue* DtoArrayEquals(Loc& loc, TOK op, DValue* l, DValue* r)
|
||||
{
|
||||
LLValue* res = DtoArrayEqCmp_impl(loc, _adEq, l, r, true);
|
||||
res = gIR->ir->CreateICmpNE(res, DtoConstInt(0), "tmp");
|
||||
res = gIR->ir->CreateICmpNE(res, DtoConstInt(0));
|
||||
if (op == TOKnotequal)
|
||||
res = gIR->ir->CreateNot(res, "tmp");
|
||||
res = gIR->ir->CreateNot(res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -899,7 +899,7 @@ LLValue* DtoArrayCompare(Loc& loc, TOK op, DValue* l, DValue* r)
|
|||
res = DtoArrayEqCmp_impl(loc, "_adCmpChar", l, r, false);
|
||||
else
|
||||
res = DtoArrayEqCmp_impl(loc, _adCmp, l, r, true);
|
||||
res = gIR->ir->CreateICmp(cmpop, res, DtoConstInt(0), "tmp");
|
||||
res = gIR->ir->CreateICmp(cmpop, res, DtoConstInt(0));
|
||||
}
|
||||
|
||||
assert(res);
|
||||
|
@ -928,7 +928,7 @@ LLValue* DtoArrayCastLength(Loc& loc, LLValue* len, LLType* elemty, LLType* newe
|
|||
};
|
||||
|
||||
LLFunction* fn = LLVM_D_GetRuntimeFunction(loc, gIR->module, "_d_array_cast_len");
|
||||
return gIR->CreateCallOrInvoke(fn, args, "tmp").getInstruction();
|
||||
return gIR->CreateCallOrInvoke(fn, args).getInstruction();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -942,15 +942,15 @@ LLValue* DtoDynArrayIs(TOK op, DValue* l, DValue* r)
|
|||
// compare lengths
|
||||
len1 = DtoArrayLen(l);
|
||||
len2 = DtoArrayLen(r);
|
||||
LLValue* b1 = gIR->ir->CreateICmpEQ(len1,len2,"tmp");
|
||||
LLValue* b1 = gIR->ir->CreateICmpEQ(len1,len2);
|
||||
|
||||
// compare pointers
|
||||
ptr1 = DtoArrayPtr(l);
|
||||
ptr2 = DtoArrayPtr(r);
|
||||
LLValue* b2 = gIR->ir->CreateICmpEQ(ptr1,ptr2,"tmp");
|
||||
LLValue* b2 = gIR->ir->CreateICmpEQ(ptr1,ptr2);
|
||||
|
||||
// combine
|
||||
LLValue* res = gIR->ir->CreateAnd(b1,b2,"tmp");
|
||||
LLValue* res = gIR->ir->CreateAnd(b1,b2);
|
||||
|
||||
// return result
|
||||
return (op == TOKnotidentity) ? gIR->ir->CreateNot(res) : res;
|
||||
|
@ -1032,7 +1032,7 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
|||
IF_LOG Logger::cout() << "to pointer" << '\n';
|
||||
rval = DtoArrayPtr(u);
|
||||
if (rval->getType() != tolltype)
|
||||
rval = gIR->ir->CreateBitCast(rval, tolltype, "tmp");
|
||||
rval = gIR->ir->CreateBitCast(rval, tolltype);
|
||||
}
|
||||
else if (totype->ty == Tarray) {
|
||||
IF_LOG Logger::cout() << "to array" << '\n';
|
||||
|
@ -1104,7 +1104,7 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
|||
// return (arr.ptr !is null)
|
||||
LLValue* ptr = DtoArrayPtr(u);
|
||||
LLConstant* nul = getNullPtr(ptr->getType());
|
||||
rval = gIR->ir->CreateICmpNE(ptr, nul, "tmp");
|
||||
rval = gIR->ir->CreateICmpNE(ptr, nul);
|
||||
}
|
||||
else {
|
||||
rval = DtoArrayPtr(u);
|
||||
|
|
|
@ -27,9 +27,9 @@ DValue* DtoBinAdd(DValue* lhs, DValue* rhs)
|
|||
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFAdd(l, r, "tmp");
|
||||
res = gIR->ir->CreateFAdd(l, r);
|
||||
else
|
||||
res = gIR->ir->CreateAdd(l, r, "tmp");
|
||||
res = gIR->ir->CreateAdd(l, r);
|
||||
|
||||
return new DImValue( t, res );
|
||||
}
|
||||
|
@ -45,9 +45,9 @@ DValue* DtoBinSub(DValue* lhs, DValue* rhs)
|
|||
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFSub(l, r, "tmp");
|
||||
res = gIR->ir->CreateFSub(l, r);
|
||||
else
|
||||
res = gIR->ir->CreateSub(l, r, "tmp");
|
||||
res = gIR->ir->CreateSub(l, r);
|
||||
|
||||
return new DImValue( t, res );
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ DValue* DtoBinMul(Type* targettype, DValue* lhs, DValue* rhs)
|
|||
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFMul(l, r, "tmp");
|
||||
res = gIR->ir->CreateFMul(l, r);
|
||||
else
|
||||
res = gIR->ir->CreateMul(l, r, "tmp");
|
||||
res = gIR->ir->CreateMul(l, r);
|
||||
return new DImValue( targettype, res );
|
||||
}
|
||||
|
||||
|
@ -80,11 +80,11 @@ DValue* DtoBinDiv(Type* targettype, DValue* lhs, DValue* rhs)
|
|||
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFDiv(l, r, "tmp");
|
||||
res = gIR->ir->CreateFDiv(l, r);
|
||||
else if (!isLLVMUnsigned(t))
|
||||
res = gIR->ir->CreateSDiv(l, r, "tmp");
|
||||
res = gIR->ir->CreateSDiv(l, r);
|
||||
else
|
||||
res = gIR->ir->CreateUDiv(l, r, "tmp");
|
||||
res = gIR->ir->CreateUDiv(l, r);
|
||||
return new DImValue( targettype, res );
|
||||
}
|
||||
|
||||
|
@ -98,11 +98,11 @@ DValue* DtoBinRem(Type* targettype, DValue* lhs, DValue* rhs)
|
|||
r = rhs->getRVal();
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFRem(l, r, "tmp");
|
||||
res = gIR->ir->CreateFRem(l, r);
|
||||
else if (!isLLVMUnsigned(t))
|
||||
res = gIR->ir->CreateSRem(l, r, "tmp");
|
||||
res = gIR->ir->CreateSRem(l, r);
|
||||
else
|
||||
res = gIR->ir->CreateURem(l, r, "tmp");
|
||||
res = gIR->ir->CreateURem(l, r);
|
||||
return new DImValue( targettype, res );
|
||||
}
|
||||
|
||||
|
@ -138,9 +138,9 @@ LLValue* DtoBinFloatsEquals(Loc& loc, DValue* lhs, DValue* rhs, TOK op)
|
|||
{
|
||||
LLValue* res = 0;
|
||||
if (op == TOKequal) {
|
||||
res = gIR->ir->CreateFCmpOEQ(lhs->getRVal(), rhs->getRVal(), "tmp");
|
||||
res = gIR->ir->CreateFCmpOEQ(lhs->getRVal(), rhs->getRVal());
|
||||
} else if (op == TOKnotequal) {
|
||||
res = gIR->ir->CreateFCmpUNE(lhs->getRVal(), rhs->getRVal(), "tmp");
|
||||
res = gIR->ir->CreateFCmpUNE(lhs->getRVal(), rhs->getRVal());
|
||||
} else {
|
||||
llvm::ICmpInst::Predicate cmpop;
|
||||
if (op == TOKidentity)
|
||||
|
@ -150,7 +150,7 @@ LLValue* DtoBinFloatsEquals(Loc& loc, DValue* lhs, DValue* rhs, TOK op)
|
|||
|
||||
LLValue* sz = DtoConstSize_t(getTypeStoreSize(DtoType(lhs->getType())));
|
||||
LLValue* val = DtoMemCmp(makeLValue(loc, lhs), makeLValue(loc, rhs), sz);
|
||||
res = gIR->ir->CreateICmp(cmpop, val, LLConstantInt::get(val->getType(), 0, false), "tmp");
|
||||
res = gIR->ir->CreateICmp(cmpop, val, LLConstantInt::get(val->getType(), 0, false));
|
||||
}
|
||||
assert(res);
|
||||
return res;
|
||||
|
|
|
@ -120,7 +120,7 @@ DValue* DtoNewClass(Loc& loc, TypeClass* tc, NewExp* newexp)
|
|||
DValue* thisval = toElem(newexp->thisexp);
|
||||
size_t idx = getIrField(tc->sym->vthis)->index;
|
||||
LLValue* src = thisval->getRVal();
|
||||
LLValue* dst = DtoGEPi(mem,0,idx,"tmp");
|
||||
LLValue* dst = DtoGEPi(mem, 0, idx);
|
||||
IF_LOG Logger::cout() << "dst: " << *dst << "\nsrc: " << *src << '\n';
|
||||
DtoStore(src, DtoBitCast(dst, getPtrToType(src->getType())));
|
||||
}
|
||||
|
@ -171,12 +171,12 @@ void DtoInitClass(TypeClass* tc, LLValue* dst)
|
|||
if (dataBytes == 0)
|
||||
return;
|
||||
|
||||
LLValue* dstarr = DtoGEPi(dst, 0, firstDataIdx, "tmp");
|
||||
LLValue* dstarr = DtoGEPi(dst, 0, firstDataIdx);
|
||||
|
||||
// init symbols might not have valid types
|
||||
LLValue* initsym = getIrAggr(tc->sym)->getInitSymbol();
|
||||
initsym = DtoBitCast(initsym, DtoType(tc));
|
||||
LLValue* srcarr = DtoGEPi(initsym, 0, firstDataIdx, "tmp");
|
||||
LLValue* srcarr = DtoGEPi(initsym, 0, firstDataIdx);
|
||||
|
||||
DtoMemCpy(dstarr, srcarr, DtoConstSize_t(dataBytes));
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ DValue* DtoCastClass(Loc& loc, DValue* val, Type* _to)
|
|||
IF_LOG Logger::println("to bool");
|
||||
LLValue* llval = val->getRVal();
|
||||
LLValue* zero = LLConstant::getNullValue(llval->getType());
|
||||
return new DImValue(_to, gIR->ir->CreateICmpNE(llval, zero, "tmp"));
|
||||
return new DImValue(_to, gIR->ir->CreateICmpNE(llval, zero));
|
||||
}
|
||||
// class -> integer
|
||||
else if (to->isintegral()) {
|
||||
|
@ -340,7 +340,7 @@ DValue* DtoDynamicCastObject(Loc& loc, DValue* val, Type* _to)
|
|||
assert(funcTy->getParamType(1) == cinfo->getType());
|
||||
|
||||
// call it
|
||||
LLValue* ret = gIR->CreateCallOrInvoke2(func, obj, cinfo, "tmp").getInstruction();
|
||||
LLValue* ret = gIR->CreateCallOrInvoke2(func, obj, cinfo).getInstruction();
|
||||
|
||||
// cast return value
|
||||
ret = DtoBitCast(ret, DtoType(_to));
|
||||
|
@ -363,7 +363,7 @@ DValue* DtoCastInterfaceToObject(Loc& loc, DValue* val, Type* to)
|
|||
tmp = DtoBitCast(tmp, funcTy->getParamType(0));
|
||||
|
||||
// call it
|
||||
LLValue* ret = gIR->CreateCallOrInvoke(func, tmp, "tmp").getInstruction();
|
||||
LLValue* ret = gIR->CreateCallOrInvoke(func, tmp).getInstruction();
|
||||
|
||||
// cast return value
|
||||
if (to != NULL)
|
||||
|
@ -400,7 +400,7 @@ DValue* DtoDynamicCastInterface(Loc& loc, DValue* val, Type* _to)
|
|||
cinfo = DtoBitCast(cinfo, funcTy->getParamType(1));
|
||||
|
||||
// call it
|
||||
LLValue* ret = gIR->CreateCallOrInvoke2(func, ptr, cinfo, "tmp").getInstruction();
|
||||
LLValue* ret = gIR->CreateCallOrInvoke2(func, ptr, cinfo).getInstruction();
|
||||
|
||||
// cast return value
|
||||
ret = DtoBitCast(ret, DtoType(_to));
|
||||
|
@ -473,7 +473,7 @@ LLValue* DtoVirtualFunctionPointer(DValue* inst, FuncDeclaration* fdecl, char* n
|
|||
|
||||
LLValue* funcval = vthis;
|
||||
// get the vtbl for objects
|
||||
funcval = DtoGEPi(funcval, 0, 0, "tmp");
|
||||
funcval = DtoGEPi(funcval, 0, 0);
|
||||
// load vtbl ptr
|
||||
funcval = DtoLoad(funcval);
|
||||
// index vtbl
|
||||
|
|
|
@ -107,8 +107,8 @@ DValue* DtoComplex(Loc& loc, Type* to, DValue* val)
|
|||
|
||||
void DtoComplexSet(LLValue* c, LLValue* re, LLValue* im)
|
||||
{
|
||||
DtoStore(re, DtoGEPi(c, 0, 0, "tmp"));
|
||||
DtoStore(im, DtoGEPi(c, 0, 1, "tmp"));
|
||||
DtoStore(re, DtoGEPi(c, 0, 0));
|
||||
DtoStore(im, DtoGEPi(c, 0, 1));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -192,14 +192,14 @@ DValue* DtoComplexAdd(Loc& loc, Type* type, DValue* lhs, DValue* rhs)
|
|||
|
||||
// add up
|
||||
if(lhs_re && rhs_re)
|
||||
res_re = gIR->ir->CreateFAdd(lhs_re, rhs_re, "tmp");
|
||||
res_re = gIR->ir->CreateFAdd(lhs_re, rhs_re);
|
||||
else if(lhs_re)
|
||||
res_re = lhs_re;
|
||||
else // either rhs_re or no re at all (then use any)
|
||||
res_re = rhs_re;
|
||||
|
||||
if(lhs_im && rhs_im)
|
||||
res_im = gIR->ir->CreateFAdd(lhs_im, rhs_im, "tmp");
|
||||
res_im = gIR->ir->CreateFAdd(lhs_im, rhs_im);
|
||||
else if(lhs_im)
|
||||
res_im = lhs_im;
|
||||
else // either rhs_im or no im at all (then use any)
|
||||
|
@ -222,14 +222,14 @@ DValue* DtoComplexSub(Loc& loc, Type* type, DValue* lhs, DValue* rhs)
|
|||
|
||||
// add up
|
||||
if(lhs_re && rhs_re)
|
||||
res_re = gIR->ir->CreateFSub(lhs_re, rhs_re, "tmp");
|
||||
res_re = gIR->ir->CreateFSub(lhs_re, rhs_re);
|
||||
else if(lhs_re)
|
||||
res_re = lhs_re;
|
||||
else // either rhs_re or no re at all (then use any)
|
||||
res_re = gIR->ir->CreateFNeg(rhs_re, "neg");
|
||||
|
||||
if(lhs_im && rhs_im)
|
||||
res_im = gIR->ir->CreateFSub(lhs_im, rhs_im, "tmp");
|
||||
res_im = gIR->ir->CreateFSub(lhs_im, rhs_im);
|
||||
else if(lhs_im)
|
||||
res_im = lhs_im;
|
||||
else // either rhs_im or no im at all (then use any)
|
||||
|
@ -373,8 +373,8 @@ DValue* DtoComplexRem(Loc& loc, Type* type, DValue* lhs, DValue* rhs)
|
|||
assert((rhs_re != 0) ^ (rhs_im != 0));
|
||||
|
||||
divisor = rhs_re ? rhs_re : rhs_im;
|
||||
res_re = lhs_re ? gIR->ir->CreateFRem(lhs_re, divisor, "tmp") : lhs_re;
|
||||
res_im = lhs_re ? gIR->ir->CreateFRem(lhs_im, divisor, "tmp") : lhs_im;
|
||||
res_re = lhs_re ? gIR->ir->CreateFRem(lhs_re, divisor) : lhs_re;
|
||||
res_im = lhs_re ? gIR->ir->CreateFRem(lhs_im, divisor) : lhs_im;
|
||||
|
||||
LLValue* res = DtoAggrPair(DtoType(type), res_re, res_im);
|
||||
return new DImValue(type, res);
|
||||
|
@ -391,8 +391,8 @@ DValue* DtoComplexNeg(Loc& loc, Type* type, DValue* val)
|
|||
|
||||
// neg up
|
||||
assert(a && b);
|
||||
re = gIR->ir->CreateFNeg(a, "tmp");
|
||||
im = gIR->ir->CreateFNeg(b, "tmp");
|
||||
re = gIR->ir->CreateFNeg(a);
|
||||
im = gIR->ir->CreateFNeg(b);
|
||||
|
||||
LLValue* res = DtoAggrPair(DtoType(type), re, im);
|
||||
return new DImValue(type, res);
|
||||
|
@ -416,9 +416,9 @@ LLValue* DtoComplexEquals(Loc& loc, TOK op, DValue* lhs, DValue* rhs)
|
|||
LLValue* b2 = DtoBinFloatsEquals(loc, lhs_im, rhs_im, op);
|
||||
|
||||
if (op == TOKequal)
|
||||
return gIR->ir->CreateAnd(b1, b2, "tmp");
|
||||
return gIR->ir->CreateAnd(b1, b2);
|
||||
else
|
||||
return gIR->ir->CreateOr(b1, b2, "tmp");
|
||||
return gIR->ir->CreateOr(b1, b2);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -436,12 +436,12 @@ DValue* DtoCastComplex(Loc& loc, DValue* val, Type* _to)
|
|||
LLType* toty = DtoComplexBaseType(to);
|
||||
|
||||
if (to->size() < vty->size()) {
|
||||
re = gIR->ir->CreateFPTrunc(re, toty, "tmp");
|
||||
im = gIR->ir->CreateFPTrunc(im, toty, "tmp");
|
||||
re = gIR->ir->CreateFPTrunc(re, toty);
|
||||
im = gIR->ir->CreateFPTrunc(im, toty);
|
||||
}
|
||||
else {
|
||||
re = gIR->ir->CreateFPExt(re, toty, "tmp");
|
||||
im = gIR->ir->CreateFPExt(im, toty, "tmp");
|
||||
re = gIR->ir->CreateFPExt(re, toty);
|
||||
im = gIR->ir->CreateFPExt(im, toty);
|
||||
}
|
||||
|
||||
LLValue* pair = DtoAggrPair(DtoType(_to), re, im);
|
||||
|
|
|
@ -550,19 +550,19 @@ DValue* DtoCastInt(Loc& loc, DValue* val, Type* _to)
|
|||
|
||||
if (to->ty == Tbool) {
|
||||
LLValue* zero = LLConstantInt::get(rval->getType(), 0, false);
|
||||
rval = gIR->ir->CreateICmpNE(rval, zero, "tmp");
|
||||
rval = gIR->ir->CreateICmpNE(rval, zero);
|
||||
}
|
||||
else if (to->isintegral()) {
|
||||
if (fromsz < tosz || from->ty == Tbool) {
|
||||
IF_LOG Logger::cout() << "cast to: " << *tolltype << '\n';
|
||||
if (isLLVMUnsigned(from) || from->ty == Tbool) {
|
||||
rval = new llvm::ZExtInst(rval, tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::ZExtInst(rval, tolltype, "", gIR->scopebb());
|
||||
} else {
|
||||
rval = new llvm::SExtInst(rval, tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::SExtInst(rval, tolltype, "", gIR->scopebb());
|
||||
}
|
||||
}
|
||||
else if (fromsz > tosz) {
|
||||
rval = new llvm::TruncInst(rval, tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::TruncInst(rval, tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else {
|
||||
rval = DtoBitCast(rval, tolltype);
|
||||
|
@ -573,15 +573,15 @@ DValue* DtoCastInt(Loc& loc, DValue* val, Type* _to)
|
|||
}
|
||||
else if (to->isfloating()) {
|
||||
if (from->isunsigned()) {
|
||||
rval = new llvm::UIToFPInst(rval, tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::UIToFPInst(rval, tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else {
|
||||
rval = new llvm::SIToFPInst(rval, tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::SIToFPInst(rval, tolltype, "", gIR->scopebb());
|
||||
}
|
||||
}
|
||||
else if (to->ty == Tpointer) {
|
||||
IF_LOG Logger::cout() << "cast pointer: " << *tolltype << '\n';
|
||||
rval = gIR->ir->CreateIntToPtr(rval, tolltype, "tmp");
|
||||
rval = gIR->ir->CreateIntToPtr(rval, tolltype);
|
||||
}
|
||||
else {
|
||||
error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), _to->toChars());
|
||||
|
@ -612,10 +612,10 @@ DValue* DtoCastPtr(Loc& loc, DValue* val, Type* to)
|
|||
else if (totype->ty == Tbool) {
|
||||
LLValue* src = val->getRVal();
|
||||
LLValue* zero = LLConstant::getNullValue(src->getType());
|
||||
rval = gIR->ir->CreateICmpNE(src, zero, "tmp");
|
||||
rval = gIR->ir->CreateICmpNE(src, zero);
|
||||
}
|
||||
else if (totype->isintegral()) {
|
||||
rval = new llvm::PtrToIntInst(val->getRVal(), tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::PtrToIntInst(val->getRVal(), tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else {
|
||||
error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars());
|
||||
|
@ -644,7 +644,7 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
|
|||
if (totype->ty == Tbool) {
|
||||
rval = val->getRVal();
|
||||
LLValue* zero = LLConstant::getNullValue(rval->getType());
|
||||
rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
|
||||
rval = gIR->ir->CreateFCmpUNE(rval, zero);
|
||||
}
|
||||
else if (totype->iscomplex()) {
|
||||
return DtoComplex(loc, to, val);
|
||||
|
@ -655,10 +655,10 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
|
|||
assert(rval->getType() == tolltype);
|
||||
}
|
||||
else if (fromsz < tosz) {
|
||||
rval = new llvm::FPExtInst(val->getRVal(), tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::FPExtInst(val->getRVal(), tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else if (fromsz > tosz) {
|
||||
rval = new llvm::FPTruncInst(val->getRVal(), tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::FPTruncInst(val->getRVal(), tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else {
|
||||
error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars());
|
||||
|
@ -667,10 +667,10 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
|
|||
}
|
||||
else if (totype->isintegral()) {
|
||||
if (totype->isunsigned()) {
|
||||
rval = new llvm::FPToUIInst(val->getRVal(), tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::FPToUIInst(val->getRVal(), tolltype, "", gIR->scopebb());
|
||||
}
|
||||
else {
|
||||
rval = new llvm::FPToSIInst(val->getRVal(), tolltype, "tmp", gIR->scopebb());
|
||||
rval = new llvm::FPToSIInst(val->getRVal(), tolltype, "", gIR->scopebb());
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -841,7 +841,7 @@ DValue* DtoPaintType(Loc& loc, DValue* val, Type* to)
|
|||
len = DtoArrayLen(val);
|
||||
ptr = DtoArrayPtr(val);
|
||||
ptr = DtoBitCast(ptr, DtoType(elem));
|
||||
return new DImValue(to, DtoAggrPair(len, ptr, "tmp"));
|
||||
return new DImValue(to, DtoAggrPair(len, ptr));
|
||||
}
|
||||
}
|
||||
else if (from->ty == Tdelegate)
|
||||
|
@ -862,7 +862,7 @@ DValue* DtoPaintType(Loc& loc, DValue* val, Type* to)
|
|||
LLValue* context = gIR->ir->CreateExtractValue(dg, 0, ".context");
|
||||
LLValue* funcptr = gIR->ir->CreateExtractValue(dg, 1, ".funcptr");
|
||||
funcptr = DtoBitCast(funcptr, DtoType(dgty)->getContainedType(1));
|
||||
LLValue* aggr = DtoAggrPair(context, funcptr, "tmp");
|
||||
LLValue* aggr = DtoAggrPair(context, funcptr);
|
||||
IF_LOG Logger::cout() << "dg: " << *aggr << '\n';
|
||||
return new DImValue(to, aggr);
|
||||
}
|
||||
|
@ -1746,7 +1746,7 @@ DValue* DtoSymbolAddress(Loc& loc, Type* type, Declaration* decl)
|
|||
LLType* vartype = DtoType(type);
|
||||
LLValue* m = getIrValue(tid);
|
||||
if (m->getType() != getPtrToType(vartype))
|
||||
m = gIR->ir->CreateBitCast(m, vartype, "tmp");
|
||||
m = gIR->ir->CreateBitCast(m, vartype);
|
||||
return new DImValue(type, m);
|
||||
}
|
||||
// nested variable
|
||||
|
|
|
@ -97,7 +97,7 @@ static LLValue* call_string_switch_runtime(llvm::Value* table, Expression* e)
|
|||
LLValue* llval = val->getRVal();
|
||||
assert(llval->getType() == fn->getFunctionType()->getParamType(1));
|
||||
|
||||
LLCallSite call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp");
|
||||
LLCallSite call = gIR->CreateCallOrInvoke2(fn, table, llval);
|
||||
|
||||
return call.getInstruction();
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ public:
|
|||
if (irs->topfunc() == irs->mainFunc)
|
||||
v = LLConstant::getNullValue(irs->mainFunc->getReturnType());
|
||||
else
|
||||
v = gIR->ir->CreateBitCast(v, irs->topfunc()->getReturnType(), "tmp");
|
||||
v = gIR->ir->CreateBitCast(v, irs->topfunc()->getReturnType());
|
||||
|
||||
IF_LOG Logger::cout() << "return value after cast: " << *v << '\n';
|
||||
}
|
||||
|
@ -1457,11 +1457,11 @@ public:
|
|||
LLValue* done = 0;
|
||||
LLValue* load = DtoLoad(keyvar);
|
||||
if (stmt->op == TOKforeach) {
|
||||
done = irs->ir->CreateICmpULT(load, niters, "tmp");
|
||||
done = irs->ir->CreateICmpULT(load, niters);
|
||||
}
|
||||
else if (stmt->op == TOKforeach_reverse) {
|
||||
done = irs->ir->CreateICmpUGT(load, zerokey, "tmp");
|
||||
load = irs->ir->CreateSub(load, LLConstantInt::get(keytype, 1, false), "tmp");
|
||||
done = irs->ir->CreateICmpUGT(load, zerokey);
|
||||
load = irs->ir->CreateSub(load, LLConstantInt::get(keytype, 1, false));
|
||||
DtoStore(load, keyvar);
|
||||
}
|
||||
llvm::BranchInst::Create(bodybb, endbb, done, irs->scopebb());
|
||||
|
@ -1470,7 +1470,7 @@ public:
|
|||
irs->scope() = IRScope(bodybb, nextbb);
|
||||
|
||||
// get value for this iteration
|
||||
LLValue* loadedKey = irs->ir->CreateLoad(keyvar, "tmp");
|
||||
LLValue* loadedKey = irs->ir->CreateLoad(keyvar);
|
||||
LLValue* gep = DtoGEP1(val, loadedKey);
|
||||
|
||||
if (!stmt->value->isRef() && !stmt->value->isOut()) {
|
||||
|
@ -1497,7 +1497,7 @@ public:
|
|||
irs->scope() = IRScope(nextbb, endbb);
|
||||
if (stmt->op == TOKforeach) {
|
||||
LLValue* load = DtoLoad(keyvar);
|
||||
load = irs->ir->CreateAdd(load, LLConstantInt::get(keytype, 1, false), "tmp");
|
||||
load = irs->ir->CreateAdd(load, LLConstantInt::get(keytype, 1, false));
|
||||
DtoStore(load, keyvar);
|
||||
}
|
||||
llvm::BranchInst::Create(condbb, irs->scopebb());
|
||||
|
|
|
@ -85,7 +85,7 @@ LLValue* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs)
|
|||
// call memcmp
|
||||
size_t sz = getTypePaddedSize(DtoType(t));
|
||||
LLValue* val = DtoMemCmp(lhs->getRVal(), rhs->getRVal(), DtoConstSize_t(sz));
|
||||
return gIR->ir->CreateICmp(cmpop, val, LLConstantInt::get(val->getType(), 0, false), "tmp");
|
||||
return gIR->ir->CreateICmp(cmpop, val, LLConstantInt::get(val->getType(), 0, false));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -88,7 +88,7 @@ DValue* DtoVaArg(Loc& loc, Type* type, Expression* valistArg)
|
|||
)
|
||||
warning(loc, "va_arg for C variadic functions is probably broken for anything but x86 and ppc64");
|
||||
// done
|
||||
return new DImValue(type, gIR->ir->CreateVAArg(expelem->getLVal(), llt, "tmp"));
|
||||
return new DImValue(type, gIR->ir->CreateVAArg(expelem->getLVal(), llt));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -308,7 +308,7 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args,
|
|||
}
|
||||
++argidx;
|
||||
|
||||
args.push_back(gIR->ir->CreateBitCast(mem, getPtrToType(LLType::getInt8Ty(gIR->context())), "tmp"));
|
||||
args.push_back(gIR->ir->CreateBitCast(mem, getPtrToType(LLType::getInt8Ty(gIR->context()))));
|
||||
if (HAS_ATTRIBUTES(irFty.arg_argptr->attrs)) {
|
||||
addToAttributes(attrs, argidx, irFty.arg_argptr->attrs);
|
||||
}
|
||||
|
|
48
gen/toir.cpp
48
gen/toir.cpp
|
@ -659,7 +659,7 @@ public:
|
|||
{
|
||||
if (negateOffset) noStrideInc = p->ir->CreateNeg(noStrideInc);
|
||||
return new DImValue(base->type,
|
||||
DtoGEP1(base->getRVal(), noStrideInc, 0, p->scopebb()));
|
||||
DtoGEP1(base->getRVal(), noStrideInc, "", p->scopebb()));
|
||||
}
|
||||
|
||||
// This might not actually be generated by the frontend, just to be
|
||||
|
@ -714,11 +714,11 @@ public:
|
|||
LLValue* lv = l->getRVal();
|
||||
LLValue* rv = toElem(e->e2)->getRVal();
|
||||
IF_LOG Logger::cout() << "lv: " << *lv << " rv: " << *rv << '\n';
|
||||
lv = p->ir->CreatePtrToInt(lv, DtoSize_t(), "tmp");
|
||||
rv = p->ir->CreatePtrToInt(rv, DtoSize_t(), "tmp");
|
||||
LLValue* diff = p->ir->CreateSub(lv,rv,"tmp");
|
||||
lv = p->ir->CreatePtrToInt(lv, DtoSize_t());
|
||||
rv = p->ir->CreatePtrToInt(rv, DtoSize_t());
|
||||
LLValue* diff = p->ir->CreateSub(lv,rv);
|
||||
if (diff->getType() != DtoType(e->type))
|
||||
diff = p->ir->CreateIntToPtr(diff, DtoType(e->type), "tmp");
|
||||
diff = p->ir->CreateIntToPtr(diff, DtoType(e->type));
|
||||
result = new DImValue(e->type, diff);
|
||||
}
|
||||
else if (t1->ty == Tpointer && t2->isintegral())
|
||||
|
@ -925,7 +925,7 @@ public:
|
|||
fatal();
|
||||
}
|
||||
|
||||
llvm::StoreInst* ret = gIR->ir->CreateStore(val, ptr, "tmp");
|
||||
llvm::StoreInst* ret = gIR->ir->CreateStore(val, ptr);
|
||||
ret->setAtomic(llvm::AtomicOrdering(atomicOrdering));
|
||||
ret->setAlignment(getTypeAllocSize(val->getType()));
|
||||
return;
|
||||
|
@ -948,7 +948,7 @@ public:
|
|||
fatal();
|
||||
}
|
||||
|
||||
llvm::LoadInst* val = gIR->ir->CreateLoad(ptr, "tmp");
|
||||
llvm::LoadInst* val = gIR->ir->CreateLoad(ptr);
|
||||
val->setAlignment(getTypeAllocSize(val->getType()));
|
||||
val->setAtomic(llvm::AtomicOrdering(atomicOrdering));
|
||||
result = new DImValue(retType, val);
|
||||
|
@ -1523,7 +1523,7 @@ public:
|
|||
eptr = DtoGEP1(eptr, vlo);
|
||||
|
||||
// adjust length
|
||||
elen = p->ir->CreateSub(vup, vlo, "tmp");
|
||||
elen = p->ir->CreateSub(vup, vlo);
|
||||
}
|
||||
// no bounds or full slice -> just convert to slice
|
||||
else
|
||||
|
@ -1584,7 +1584,7 @@ public:
|
|||
}
|
||||
if (a->getType() != b->getType())
|
||||
b = DtoBitCast(b, a->getType());
|
||||
eval = p->ir->CreateICmp(icmpPred, a, b, "tmp");
|
||||
eval = p->ir->CreateICmp(icmpPred, a, b);
|
||||
}
|
||||
}
|
||||
else if (t->isfloating())
|
||||
|
@ -1620,7 +1620,7 @@ public:
|
|||
default:
|
||||
llvm_unreachable("Unsupported floating point comparison operator.");
|
||||
}
|
||||
eval = p->ir->CreateFCmp(cmpop, l->getRVal(), r->getRVal(), "tmp");
|
||||
eval = p->ir->CreateFCmp(cmpop, l->getRVal(), r->getRVal());
|
||||
}
|
||||
else if (t->ty == Tsarray || t->ty == Tarray)
|
||||
{
|
||||
|
@ -1723,7 +1723,7 @@ public:
|
|||
Logger::cout() << "lv: " << *lv << '\n';
|
||||
Logger::cout() << "rv: " << *rv << '\n';
|
||||
}
|
||||
eval = p->ir->CreateICmp(cmpop, lv, rv, "tmp");
|
||||
eval = p->ir->CreateICmp(cmpop, lv, rv);
|
||||
}
|
||||
else if (t->isfloating()) // includes iscomplex
|
||||
{
|
||||
|
@ -1779,10 +1779,10 @@ public:
|
|||
assert(e2type->isintegral());
|
||||
LLValue* one = LLConstantInt::get(val->getType(), 1, !e2type->isunsigned());
|
||||
if (e->op == TOKplusplus) {
|
||||
post = llvm::BinaryOperator::CreateAdd(val, one, "tmp", p->scopebb());
|
||||
post = llvm::BinaryOperator::CreateAdd(val, one, "", p->scopebb());
|
||||
}
|
||||
else if (e->op == TOKminusminus) {
|
||||
post = llvm::BinaryOperator::CreateSub(val, one, "tmp", p->scopebb());
|
||||
post = llvm::BinaryOperator::CreateSub(val, one, "", p->scopebb());
|
||||
}
|
||||
}
|
||||
else if (e1type->ty == Tpointer)
|
||||
|
@ -1791,17 +1791,17 @@ public:
|
|||
LLConstant* minusone = LLConstantInt::get(DtoSize_t(), static_cast<uint64_t>(-1), true);
|
||||
LLConstant* plusone = LLConstantInt::get(DtoSize_t(), static_cast<uint64_t>(1), false);
|
||||
LLConstant* whichone = (e->op == TOKplusplus) ? plusone : minusone;
|
||||
post = llvm::GetElementPtrInst::Create(val, whichone, "tmp", p->scopebb());
|
||||
post = llvm::GetElementPtrInst::Create(val, whichone, "", p->scopebb());
|
||||
}
|
||||
else if (e1type->isfloating())
|
||||
{
|
||||
assert(e2type->isfloating());
|
||||
LLValue* one = DtoConstFP(e1type, ldouble(1.0));
|
||||
if (e->op == TOKplusplus) {
|
||||
post = llvm::BinaryOperator::CreateFAdd(val,one,"tmp",p->scopebb());
|
||||
post = llvm::BinaryOperator::CreateFAdd(val,one, "", p->scopebb());
|
||||
}
|
||||
else if (e->op == TOKminusminus) {
|
||||
post = llvm::BinaryOperator::CreateFSub(val,one,"tmp",p->scopebb());
|
||||
post = llvm::BinaryOperator::CreateFSub(val,one, "", p->scopebb());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2207,7 +2207,7 @@ public:
|
|||
DValue* v = toElem(e->e2); \
|
||||
errorOnIllegalArrayOp(e, e->e1, e->e2); \
|
||||
v = DtoCast(e->loc, v, e->e1->type); \
|
||||
LLValue* x = llvm::BinaryOperator::Create(llvm::Instruction::Y, u->getRVal(), v->getRVal(), "tmp", p->scopebb()); \
|
||||
LLValue* x = llvm::BinaryOperator::Create(llvm::Instruction::Y, u->getRVal(), v->getRVal(), "", p->scopebb()); \
|
||||
result = new DImValue(e->type, x); \
|
||||
}
|
||||
|
||||
|
@ -2226,9 +2226,9 @@ public:
|
|||
v = DtoCast(e->loc, v, e->e1->type);
|
||||
LLValue* x;
|
||||
if (isLLVMUnsigned(e->e1->type))
|
||||
x = p->ir->CreateLShr(u->getRVal(), v->getRVal(), "tmp");
|
||||
x = p->ir->CreateLShr(u->getRVal(), v->getRVal());
|
||||
else
|
||||
x = p->ir->CreateAShr(u->getRVal(), v->getRVal(), "tmp");
|
||||
x = p->ir->CreateAShr(u->getRVal(), v->getRVal());
|
||||
result = new DImValue(e->type, x);
|
||||
}
|
||||
|
||||
|
@ -2375,14 +2375,14 @@ public:
|
|||
rv = DtoBitCast(rv, lv->getType());
|
||||
}
|
||||
eval = (e->op == TOKidentity)
|
||||
? p->ir->CreateICmpEQ(lv, rv, "tmp")
|
||||
: p->ir->CreateICmpNE(lv, rv, "tmp");
|
||||
? p->ir->CreateICmpEQ(lv, rv)
|
||||
: p->ir->CreateICmpNE(lv, rv);
|
||||
}
|
||||
else {
|
||||
assert(lv->getType() == rv->getType());
|
||||
eval = (e->op == TOKidentity)
|
||||
? p->ir->CreateICmpEQ(lv, rv, "tmp")
|
||||
: p->ir->CreateICmpNE(lv, rv, "tmp");
|
||||
? p->ir->CreateICmpEQ(lv, rv)
|
||||
: p->ir->CreateICmpNE(lv, rv);
|
||||
}
|
||||
result = new DImValue(e->type, eval);
|
||||
}
|
||||
|
@ -2461,7 +2461,7 @@ public:
|
|||
|
||||
LLValue* value = u->getRVal();
|
||||
LLValue* minusone = LLConstantInt::get(value->getType(), static_cast<uint64_t>(-1), true);
|
||||
value = llvm::BinaryOperator::Create(llvm::Instruction::Xor, value, minusone, "tmp", p->scopebb());
|
||||
value = llvm::BinaryOperator::Create(llvm::Instruction::Xor, value, minusone, "", p->scopebb());
|
||||
|
||||
result = new DImValue(e->type, value);
|
||||
}
|
||||
|
|
|
@ -293,16 +293,16 @@ LLValue* DtoDelegateEquals(TOK op, LLValue* lhs, LLValue* rhs)
|
|||
|
||||
LLValue* l = gIR->ir->CreateExtractValue(lhs, 0);
|
||||
LLValue* r = gIR->ir->CreateExtractValue(rhs, 0);
|
||||
b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp");
|
||||
b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r);
|
||||
|
||||
l = gIR->ir->CreateExtractValue(lhs, 1);
|
||||
r = gIR->ir->CreateExtractValue(rhs, 1);
|
||||
b2 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp");
|
||||
b2 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r);
|
||||
|
||||
LLValue* b = gIR->ir->CreateAnd(b1,b2,"tmp");
|
||||
LLValue* b = gIR->ir->CreateAnd(b1,b2);
|
||||
|
||||
if (op == TOKnotequal || op == TOKnotidentity)
|
||||
return gIR->ir->CreateNot(b,"tmp");
|
||||
return gIR->ir->CreateNot(b);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ LLIntegerType* DtoSize_t()
|
|||
|
||||
LLValue* DtoGEP1(LLValue* ptr, LLValue* i0, const char* var, llvm::BasicBlock* bb)
|
||||
{
|
||||
return llvm::GetElementPtrInst::Create(ptr, i0, var?var:"tmp", bb?bb:gIR->scopebb());
|
||||
return llvm::GetElementPtrInst::Create(ptr, i0, var, bb ? bb : gIR->scopebb());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -508,14 +508,14 @@ LLValue* DtoGEP1(LLValue* ptr, LLValue* i0, const char* var, llvm::BasicBlock* b
|
|||
LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* var, llvm::BasicBlock* bb)
|
||||
{
|
||||
LLValue* v[] = { i0, i1 };
|
||||
return llvm::GetElementPtrInst::Create(ptr, v, var?var:"tmp", bb?bb:gIR->scopebb());
|
||||
return llvm::GetElementPtrInst::Create(ptr, v, var, 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());
|
||||
return llvm::GetElementPtrInst::Create(ptr, DtoConstUint(i), var, bb ? bb : gIR->scopebb());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -523,7 +523,7 @@ LLValue* DtoGEPi1(LLValue* ptr, unsigned i, const char* var, llvm::BasicBlock* b
|
|||
LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var, llvm::BasicBlock* bb)
|
||||
{
|
||||
LLValue* v[] = { DtoConstUint(i0), DtoConstUint(i1) };
|
||||
return llvm::GetElementPtrInst::Create(ptr, v, var?var:"tmp", bb?bb:gIR->scopebb());
|
||||
return llvm::GetElementPtrInst::Create(ptr, v, var, bb ? bb : gIR->scopebb());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -583,7 +583,7 @@ LLValue* DtoMemCmp(LLValue* lhs, LLValue* rhs, LLValue* nbytes)
|
|||
lhs = DtoBitCast(lhs, VoidPtrTy);
|
||||
rhs = DtoBitCast(rhs, VoidPtrTy);
|
||||
|
||||
return gIR->ir->CreateCall3(fn, lhs, rhs, nbytes, "tmp");
|
||||
return gIR->ir->CreateCall3(fn, lhs, rhs, nbytes);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -678,7 +678,7 @@ LLValue* DtoLoad(LLValue* src, const char* name)
|
|||
{
|
||||
// if (Logger::enabled())
|
||||
// Logger::cout() << "loading " << *src << '\n';
|
||||
llvm::LoadInst* ld = gIR->ir->CreateLoad(src, name ? name : "tmp");
|
||||
llvm::LoadInst* ld = gIR->ir->CreateLoad(src, name);
|
||||
//ld->setVolatile(gIR->func()->inVolatile);
|
||||
return ld;
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ LLValue* DtoLoad(LLValue* src, const char* name)
|
|||
// Like DtoLoad, but the pointer is guaranteed to be aligned appropriately for the type.
|
||||
LLValue* DtoAlignedLoad(LLValue* src, const char* name)
|
||||
{
|
||||
llvm::LoadInst* ld = gIR->ir->CreateLoad(src, name ? name : "tmp");
|
||||
llvm::LoadInst* ld = gIR->ir->CreateLoad(src, name);
|
||||
ld->setAlignment(getABITypeAlign(ld->getType()));
|
||||
return ld;
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ LLValue* DtoBitCast(LLValue* v, LLType* t, const char* name)
|
|||
if (v->getType() == t)
|
||||
return v;
|
||||
assert(!isaStruct(t));
|
||||
return gIR->ir->CreateBitCast(v, t, name ? name : "tmp");
|
||||
return gIR->ir->CreateBitCast(v, t, name);
|
||||
}
|
||||
|
||||
LLConstant* DtoBitCast(LLConstant* v, LLType* t)
|
||||
|
@ -740,24 +740,24 @@ LLConstant* DtoBitCast(LLConstant* v, LLType* t)
|
|||
|
||||
LLValue* DtoInsertValue(LLValue* aggr, LLValue* v, unsigned idx, const char* name)
|
||||
{
|
||||
return gIR->ir->CreateInsertValue(aggr, v, idx, name ? name : "tmp");
|
||||
return gIR->ir->CreateInsertValue(aggr, v, idx, name);
|
||||
}
|
||||
|
||||
LLValue* DtoExtractValue(LLValue* aggr, unsigned idx, const char* name)
|
||||
{
|
||||
return gIR->ir->CreateExtractValue(aggr, idx, name ? name : "tmp");
|
||||
return gIR->ir->CreateExtractValue(aggr, idx, name);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, LLValue *idx, const char* name)
|
||||
{
|
||||
return gIR->ir->CreateInsertElement(vec, v, idx, name ? name : "tmp");
|
||||
return gIR->ir->CreateInsertElement(vec, v, idx, name);
|
||||
}
|
||||
|
||||
LLValue* DtoExtractElement(LLValue* vec, LLValue *idx, const char* name)
|
||||
{
|
||||
return gIR->ir->CreateExtractElement(vec, idx, name ? name : "tmp");
|
||||
return gIR->ir->CreateExtractElement(vec, idx, name);
|
||||
}
|
||||
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, unsigned idx, const char* name)
|
||||
|
@ -1013,8 +1013,8 @@ LLStructType* DtoModuleReferenceType()
|
|||
LLValue* DtoAggrPair(LLType* type, LLValue* V1, LLValue* V2, const char* name)
|
||||
{
|
||||
LLValue* res = llvm::UndefValue::get(type);
|
||||
res = gIR->ir->CreateInsertValue(res, V1, 0, "tmp");
|
||||
return gIR->ir->CreateInsertValue(res, V2, 1, name?name:"tmp");
|
||||
res = gIR->ir->CreateInsertValue(res, V1, 0);
|
||||
return gIR->ir->CreateInsertValue(res, V2, 1, name);
|
||||
}
|
||||
|
||||
LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name)
|
||||
|
@ -1031,13 +1031,13 @@ LLValue* DtoAggrPaint(LLValue* aggr, LLType* as)
|
|||
|
||||
LLValue* res = llvm::UndefValue::get(as);
|
||||
|
||||
LLValue* V = gIR->ir->CreateExtractValue(aggr, 0, "tmp");;
|
||||
LLValue* V = gIR->ir->CreateExtractValue(aggr, 0);
|
||||
V = DtoBitCast(V, as->getContainedType(0));
|
||||
res = gIR->ir->CreateInsertValue(res, V, 0, "tmp");
|
||||
res = gIR->ir->CreateInsertValue(res, V, 0);
|
||||
|
||||
V = gIR->ir->CreateExtractValue(aggr, 1, "tmp");;
|
||||
V = gIR->ir->CreateExtractValue(aggr, 1);
|
||||
V = DtoBitCast(V, as->getContainedType(1));
|
||||
return gIR->ir->CreateInsertValue(res, V, 1, "tmp");
|
||||
return gIR->ir->CreateInsertValue(res, V, 1);
|
||||
}
|
||||
|
||||
LLValue* DtoAggrPairSwap(LLValue* aggr)
|
||||
|
|
30
gen/tollvm.h
30
gen/tollvm.h
|
@ -71,11 +71,11 @@ LLStructType* DtoMutexType();
|
|||
LLStructType* DtoModuleReferenceType();
|
||||
|
||||
// getelementptr helpers
|
||||
LLValue* DtoGEP1(LLValue* ptr, LLValue* i0, const char* var=0, llvm::BasicBlock* bb=NULL);
|
||||
LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* var=0, llvm::BasicBlock* bb=NULL);
|
||||
LLValue* DtoGEP1(LLValue* ptr, LLValue* i0, const char* name = "", llvm::BasicBlock* bb = NULL);
|
||||
LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* name = "", llvm::BasicBlock* bb = NULL);
|
||||
|
||||
LLValue* DtoGEPi1(LLValue* ptr, unsigned i0, const char* var=0, llvm::BasicBlock* bb=NULL);
|
||||
LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var=0, llvm::BasicBlock* bb=NULL);
|
||||
LLValue* DtoGEPi1(LLValue* ptr, unsigned i0, const char* name = "", llvm::BasicBlock* bb = NULL);
|
||||
LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* name = "", llvm::BasicBlock* bb = NULL);
|
||||
LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1);
|
||||
|
||||
// to constant helpers
|
||||
|
@ -89,19 +89,19 @@ LLConstant* DtoConstString(const char*);
|
|||
LLConstant* DtoConstBool(bool);
|
||||
|
||||
// llvm wrappers
|
||||
LLValue* DtoLoad(LLValue* src, const char* name=0);
|
||||
LLValue* DtoAlignedLoad(LLValue* src, const char* name=0);
|
||||
LLValue* DtoLoad(LLValue* src, const char* name = "");
|
||||
LLValue* DtoAlignedLoad(LLValue* src, const char* name = "");
|
||||
void DtoStore(LLValue* src, LLValue* dst);
|
||||
void DtoStoreZextI8(LLValue* src, LLValue* dst);
|
||||
void DtoAlignedStore(LLValue* src, LLValue* dst);
|
||||
LLValue* DtoBitCast(LLValue* v, LLType* t, const char* name=0);
|
||||
LLValue* DtoBitCast(LLValue* v, LLType* t, const char* name = "");
|
||||
LLConstant* DtoBitCast(LLConstant* v, LLType* t);
|
||||
LLValue* DtoInsertValue(LLValue* aggr, LLValue* v, unsigned idx, const char* name=0);
|
||||
LLValue* DtoExtractValue(LLValue* aggr, unsigned idx, const char* name=0);
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, LLValue *idx, const char* name=0);
|
||||
LLValue* DtoExtractElement(LLValue* vec, LLValue *idx, const char* name=0);
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, unsigned idx, const char* name=0);
|
||||
LLValue* DtoExtractElement(LLValue* vec, unsigned idx, const char* name=0);
|
||||
LLValue* DtoInsertValue(LLValue* aggr, LLValue* v, unsigned idx, const char* name = "");
|
||||
LLValue* DtoExtractValue(LLValue* aggr, unsigned idx, const char* name = "");
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, LLValue *idx, const char* name = "");
|
||||
LLValue* DtoExtractElement(LLValue* vec, LLValue *idx, const char* name = "");
|
||||
LLValue* DtoInsertElement(LLValue* vec, LLValue* v, unsigned idx, const char* name = "");
|
||||
LLValue* DtoExtractElement(LLValue* vec, unsigned idx, const char* name = "");
|
||||
|
||||
// llvm::dyn_cast wrappers
|
||||
LLPointerType* isaPointer(LLValue* v);
|
||||
|
@ -133,8 +133,8 @@ size_t getTypeAllocSize(LLType* t);
|
|||
unsigned char getABITypeAlign(LLType* t);
|
||||
|
||||
// pair type helpers
|
||||
LLValue* DtoAggrPair(LLType* type, LLValue* V1, LLValue* V2, const char* name = 0);
|
||||
LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name = 0);
|
||||
LLValue* DtoAggrPair(LLType* type, LLValue* V1, LLValue* V2, const char* name = "");
|
||||
LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name = "");
|
||||
LLValue* DtoAggrPaint(LLValue* aggr, LLType* as);
|
||||
LLValue* DtoAggrPairSwap(LLValue* aggr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue