Skip to content

Commit 190fea8

Browse files
committed
IRGen: getPointerElementType -> getNonOpaquePointerElementType
`getPointerElementType` is deprecated in a newer LLVM.
1 parent 214ec19 commit 190fea8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/IRGen/Callee.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ namespace irgen {
340340
AuthInfo(authInfo), Sig(signature), awaitSignature(awaitSignature) {
341341
// The function pointer should have function type.
342342
assert(!value->getContext().supportsTypedPointers() ||
343-
value->getType()->getPointerElementType()->isFunctionTy());
343+
value->getType()->getNonOpaquePointerElementType()->isFunctionTy());
344344
// TODO: maybe assert similarity to signature.getType()?
345345
if (authInfo) {
346346
if (kind == Kind::Function) {

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ void CallEmission::emitToExplosion(Explosion &out, bool isOutlined) {
31883188
auto temp = IGF.createAlloca(resultTy, Alignment(), "indirect.result");
31893189
if (IGF.IGM.getLLVMContext().supportsTypedPointers()) {
31903190
temp = IGF.Builder.CreateElementBitCast(
3191-
temp, fnType->getParamType(0)->getPointerElementType());
3191+
temp, fnType->getParamType(0)->getNonOpaquePointerElementType());
31923192
}
31933193
emitToMemory(temp, substResultTI, isOutlined);
31943194
return;

lib/IRGen/IRGenSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5433,7 +5433,7 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
54335433
shadowTy = IGM.Int8Ty;
54345434
}
54355435
assert(!IGM.getLLVMContext().supportsTypedPointers() ||
5436-
shadowTy == shadow->getType()->getPointerElementType());
5436+
shadowTy == shadow->getType()->getNonOpaquePointerElementType());
54375437
addr = builder.CreateLoad(shadowTy, shadow);
54385438
}
54395439

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,15 +1271,15 @@ fixUpTypesInByValAndStructRetAttributes(llvm::FunctionType *fnType,
12711271
auto paramTy = fnType->getParamType(i);
12721272
auto attrListIndex = llvm::AttributeList::FirstArgIndex + i;
12731273
if (attrList.hasParamAttr(i, llvm::Attribute::StructRet) &&
1274-
paramTy->getPointerElementType() != attrList.getParamStructRetType(i))
1274+
paramTy->getNonOpaquePointerElementType() != attrList.getParamStructRetType(i))
12751275
attrList = attrList.replaceAttributeTypeAtIndex(
12761276
context, attrListIndex, llvm::Attribute::StructRet,
1277-
paramTy->getPointerElementType());
1277+
paramTy->getNonOpaquePointerElementType());
12781278
if (attrList.hasParamAttr(i, llvm::Attribute::ByVal) &&
1279-
paramTy->getPointerElementType() != attrList.getParamByValType(i))
1279+
paramTy->getNonOpaquePointerElementType() != attrList.getParamByValType(i))
12801280
attrList = attrList.replaceAttributeTypeAtIndex(
12811281
context, attrListIndex, llvm::Attribute::ByVal,
1282-
paramTy->getPointerElementType());
1282+
paramTy->getNonOpaquePointerElementType());
12831283
}
12841284
return attrList;
12851285
}

0 commit comments

Comments
 (0)