Skip to content

Commit dcf119b

Browse files
authored
Merge pull request #31089 from MForster/fix-build-master
Fix master-next build (Part 1)
2 parents 31f715d + 2b9daec commit dcf119b

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

include/swift/Reflection/TypeRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class OpaqueArchetypeTypeRef final : public TypeRef {
352352
StringRef description, unsigned ordinal,
353353
ArrayRef<ArrayRef<const TypeRef *>> argumentLists) {
354354
TypeRefID ID;
355-
ID.addString(idString);
355+
ID.addString(idString.str());
356356
ID.addInteger(ordinal);
357357
for (auto argList : argumentLists) {
358358
ID.addInteger(0u);

lib/IRGen/GenCall.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,10 @@ llvm::CallInst *IRBuilder::CreateCall(const FunctionPointer &fn,
16601660
}
16611661

16621662
assert(!isTrapIntrinsic(fn.getPointer()) && "Use CreateNonMergeableTrap");
1663-
llvm::CallInst *call =
1664-
IRBuilderBase::CreateCall(fn.getPointer(), args, bundles);
1663+
llvm::CallInst *call = IRBuilderBase::CreateCall(
1664+
cast<llvm::FunctionType>(
1665+
fn.getPointer()->getType()->getPointerElementType()),
1666+
fn.getPointer(), args, bundles);
16651667
call->setAttributes(fn.getAttributes());
16661668
call->setCallingConv(fn.getCallingConv());
16671669
return call;

lib/IRGen/GenDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,9 @@ void IRGenModule::emitVTableStubs() {
17291729
stub->setCallingConv(DefaultCC);
17301730
auto *entry = llvm::BasicBlock::Create(getLLVMContext(), "entry", stub);
17311731
auto *errorFunc = getDeletedMethodErrorFn();
1732-
llvm::CallInst::Create(errorFunc, ArrayRef<llvm::Value *>(), "", entry);
1732+
llvm::CallInst::Create(cast<llvm::FunctionType>(
1733+
errorFunc->getType()->getPointerElementType()),
1734+
errorFunc, ArrayRef<llvm::Value *>(), "", entry);
17331735
new llvm::UnreachableInst(getLLVMContext(), entry);
17341736
}
17351737

lib/IRGen/IRBuilder.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ class IRBuilder : public IRBuilderBase {
271271
// assert((!DebugInfo || getCurrentDebugLocation()) && "no debugloc on
272272
// call");
273273
assert(!isTrapIntrinsic(Callee) && "Use CreateNonMergeableTrap");
274-
auto Call = IRBuilderBase::CreateCall(Callee, Args, Name, FPMathTag);
274+
auto Call = IRBuilderBase::CreateCall(
275+
cast<llvm::FunctionType>(Callee->getType()->getPointerElementType()),
276+
Callee, Args, Name, FPMathTag);
275277
setCallingConvUsingCallee(Call);
276278
return Call;
277279
}

lib/LLVMPasses/ARCEntryPointBuilder.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,18 @@ class ARCEntryPointBuilder {
7272
llvm::CallingConv::ID DefaultCC;
7373

7474
llvm::CallInst *CreateCall(Constant *Fn, Value *V) {
75-
CallInst *CI = B.CreateCall(Fn, V);
75+
CallInst *CI = B.CreateCall(
76+
cast<llvm::FunctionType>(Fn->getType()->getPointerElementType()), Fn,
77+
V);
7678
if (auto Fun = llvm::dyn_cast<llvm::Function>(Fn))
7779
CI->setCallingConv(Fun->getCallingConv());
7880
return CI;
7981
}
8082

8183
llvm::CallInst *CreateCall(Constant *Fn, llvm::ArrayRef<Value *> Args) {
82-
CallInst *CI = B.CreateCall(Fn, Args);
84+
CallInst *CI = B.CreateCall(
85+
cast<llvm::FunctionType>(Fn->getType()->getPointerElementType()), Fn,
86+
Args);
8387
if (auto Fun = llvm::dyn_cast<llvm::Function>(Fn))
8488
CI->setCallingConv(Fun->getCallingConv());
8589
return CI;

stdlib/public/Reflection/TypeRef.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ class PrintTypeRef : public TypeRefVisitor<PrintTypeRef, void> {
258258

259259
void visitOpaqueArchetypeTypeRef(const OpaqueArchetypeTypeRef *O) {
260260
printHeader("opaque_archetype");
261-
printField("id", O->getID());
262-
printField("description", O->getDescription());
261+
printField("id", O->getID().str());
262+
printField("description", O->getDescription().str());
263263
fprintf(file, " ordinal %u ", O->getOrdinal());
264264
for (auto argList : O->getArgumentLists()) {
265265
fprintf(file, "\n");

0 commit comments

Comments
 (0)