Added explicit types for llvm::GetElementPtrInst::Create()

This commit is contained in:
Andrey Guskov
2015-03-18 16:33:42 +03:00
parent 6d43d3c180
commit 97eff6a185
4 changed files with 46 additions and 2 deletions

View File

@@ -330,8 +330,13 @@ lGEPInst(llvm::Value *ptr, llvm::Value *offset, const char *name,
llvm::Instruction *insertBefore) {
llvm::Value *index[1] = { offset };
llvm::ArrayRef<llvm::Value *> arrayRef(&index[0], &index[1]);
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
return llvm::GetElementPtrInst::Create(ptr, arrayRef, name,
insertBefore);
#else // LLVM 3.7++
return llvm::GetElementPtrInst::Create(PTYPE(ptr), ptr, arrayRef,
name, insertBefore);
#endif
}