Skip to content

Commit fbb53e6

Browse files
KornevNikitaMrSidims
authored andcommitted
Fix using of deprecated CreateInBounds
Enable using of CreateInBounds with element type due to deprecate GetElementPtrInst::CreateInBounds without element type.
1 parent 974d4db commit fbb53e6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ bool SPIRVToLLVM::postProcessOCLBuiltinWithArrayArguments(
14241424
auto Zero =
14251425
ConstantInt::getNullValue(Type::getInt32Ty(T->getContext()));
14261426
Value *Index[] = {Zero, Zero};
1427-
I = GetElementPtrInst::CreateInBounds(Alloca, Index, "", CI);
1427+
I = GetElementPtrInst::CreateInBounds(nullptr, Alloca, Index, "", CI);
14281428
}
14291429
return Name.str();
14301430
},

lib/SPIRV/SPIRVUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,8 @@ Value *getScalarOrArrayConstantInt(Instruction *Pos, Type *T, unsigned Len,
11841184
new StoreInst(CA, Alloca, Pos);
11851185
auto Zero = ConstantInt::getNullValue(Type::getInt32Ty(T->getContext()));
11861186
Value *Index[] = {Zero, Zero};
1187-
auto Ret = GetElementPtrInst::CreateInBounds(Alloca, Index, "", Pos);
1187+
auto *Ret =
1188+
GetElementPtrInst::CreateInBounds(nullptr, Alloca, Index, "", Pos);
11881189
LLVM_DEBUG(dbgs() << "[getScalarOrArrayConstantInt] Alloca: " << *Alloca
11891190
<< ", Return: " << *Ret << '\n');
11901191
return Ret;

0 commit comments

Comments
 (0)