Skip to content

Commit 899a619

Browse files
committed
IRGen: remove remaining (dead) code which deals with pinning
1 parent c6eb5fe commit 899a619

File tree

3 files changed

+14
-34
lines changed

3 files changed

+14
-34
lines changed

lib/IRGen/GenHeap.cpp

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,43 +1297,23 @@ llvm::Value *IRGenFunction::emitLoadRefcountedPtr(Address addr,
12971297
}
12981298

12991299
llvm::Value *IRGenFunction::
1300-
emitIsUniqueCall(llvm::Value *value, SourceLoc loc, bool isNonNull,
1301-
bool checkPinned) {
1300+
emitIsUniqueCall(llvm::Value *value, SourceLoc loc, bool isNonNull) {
13021301
llvm::Constant *fn;
13031302
if (value->getType() == IGM.RefCountedPtrTy) {
1304-
if (checkPinned) {
1305-
if (isNonNull)
1306-
fn = IGM.getIsUniquelyReferencedOrPinned_nonNull_nativeFn();
1307-
else
1308-
fn = IGM.getIsUniquelyReferencedOrPinned_nativeFn();
1309-
}
1310-
else {
1311-
if (isNonNull)
1312-
fn = IGM.getIsUniquelyReferenced_nonNull_nativeFn();
1313-
else
1314-
fn = IGM.getIsUniquelyReferenced_nativeFn();
1315-
}
1303+
if (isNonNull)
1304+
fn = IGM.getIsUniquelyReferenced_nonNull_nativeFn();
1305+
else
1306+
fn = IGM.getIsUniquelyReferenced_nativeFn();
13161307
} else if (value->getType() == IGM.UnknownRefCountedPtrTy) {
1317-
if (checkPinned) {
1318-
if (!isNonNull)
1319-
unimplemented(loc, "optional objc ref");
1320-
1321-
fn = IGM.getIsUniquelyReferencedOrPinnedNonObjC_nonNullFn();
1322-
}
1323-
else {
1324-
if (isNonNull)
1325-
fn = IGM.getIsUniquelyReferencedNonObjC_nonNullFn();
1326-
else
1327-
fn = IGM.getIsUniquelyReferencedNonObjCFn();
1328-
}
1308+
if (isNonNull)
1309+
fn = IGM.getIsUniquelyReferencedNonObjC_nonNullFn();
1310+
else
1311+
fn = IGM.getIsUniquelyReferencedNonObjCFn();
13291312
} else if (value->getType() == IGM.BridgeObjectPtrTy) {
13301313
if (!isNonNull)
13311314
unimplemented(loc, "optional bridge ref");
13321315

1333-
if (checkPinned)
1334-
fn = IGM.getIsUniquelyReferencedOrPinnedNonObjC_nonNull_bridgeObjectFn();
1335-
else
1336-
fn = IGM.getIsUniquelyReferencedNonObjC_nonNull_bridgeObjectFn();
1316+
fn = IGM.getIsUniquelyReferencedNonObjC_nonNull_bridgeObjectFn();
13371317
} else {
13381318
llvm_unreachable("Unexpected LLVM type for a refcounted pointer.");
13391319
}

lib/IRGen/IRGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class IRGenFunction {
430430
void emitErrorStrongRelease(llvm::Value *value);
431431

432432
llvm::Value *emitIsUniqueCall(llvm::Value *value, SourceLoc loc,
433-
bool isNonNull, bool checkPinned);
433+
bool isNonNull);
434434

435435
llvm::Value *emitIsEscapingClosureCall(llvm::Value *value, SourceLoc loc,
436436
unsigned verificationType);

lib/IRGen/IRGenSIL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@ static bool hasReferenceSemantics(IRGenSILFunction &IGF,
39143914
}
39153915

39163916
static llvm::Value *emitIsUnique(IRGenSILFunction &IGF, SILValue operand,
3917-
SourceLoc loc, bool checkPinned) {
3917+
SourceLoc loc) {
39183918
if (!hasReferenceSemantics(IGF, operand->getType())) {
39193919
IGF.emitTrap(/*EmitUnreachable=*/false);
39203920
return llvm::UndefValue::get(IGF.IGM.Int1Ty);
@@ -3925,12 +3925,12 @@ static llvm::Value *emitIsUnique(IRGenSILFunction &IGF, SILValue operand,
39253925
operTI.loadRefcountedPtr(IGF, loc, IGF.getLoweredAddress(operand));
39263926

39273927
return
3928-
IGF.emitIsUniqueCall(ref.getValue(), loc, ref.isNonNull(), checkPinned);
3928+
IGF.emitIsUniqueCall(ref.getValue(), loc, ref.isNonNull());
39293929
}
39303930

39313931
void IRGenSILFunction::visitIsUniqueInst(swift::IsUniqueInst *i) {
39323932
llvm::Value *result = emitIsUnique(*this, i->getOperand(),
3933-
i->getLoc().getSourceLoc(), false);
3933+
i->getLoc().getSourceLoc());
39343934
Explosion out;
39353935
out.add(result);
39363936
setLoweredExplosion(i, out);

0 commit comments

Comments
 (0)