mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
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:
parent
1b3abdbb14
commit
a4924c50e1
5 changed files with 68 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue