LLVM 3.7: llvm::ConstantExpr::getElementPtr() wants element type.

This is the same change like the one on the GEP instruction.
This commit is contained in:
Kai Nacke 2015-04-04 01:37:14 +02:00
parent 1b3abdbb14
commit a4924c50e1
5 changed files with 68 additions and 5 deletions

View file

@ -384,7 +384,11 @@ LLConstant* DtoConstArrayInitializer(ArrayInitializer* arrinit)
LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) };
#if LDC_LLVM_VER >= 307
LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(isaPointer(gvar)->getElementType(), gvar, idxs, true);
#else
LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(gvar, idxs, true);
#endif
gep = llvm::ConstantExpr::getBitCast(gvar, getPtrToType(llelemty));
return DtoConstSlice(DtoConstSize_t(arrlen), gep, arrty);