Skip to content

Commit 9a29edf

Browse files
author
Joe Shajrawi
authored
Merge pull request #7972 from shajrawi/rename_opaque_br
Rename unconditional_checked_cast_opaque to unconditional_checked_cast_value
2 parents f66db48 + 33b0cf6 commit 9a29edf

26 files changed

+63
-64
lines changed

docs/SIL.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4446,7 +4446,7 @@ Checked Conversions
44464446

44474447
Some user-level cast operations can fail and thus require runtime checking.
44484448

4449-
The `unconditional_checked_cast_addr`_, `unconditional_checked_cast_opaque`_ and `unconditional_checked_cast`_
4449+
The `unconditional_checked_cast_addr`_, `unconditional_checked_cast_value`_ and `unconditional_checked_cast`_
44504450
instructions performs an unconditional checked cast; it is a runtime failure
44514451
if the cast fails. The `checked_cast_addr_br`_, `checked_cast_value_br`_ and `checked_cast_br`_
44524452
terminator instruction performs a conditional checked cast; it branches to one
@@ -4485,13 +4485,13 @@ unconditional_checked_cast_addr
44854485
Performs a checked indirect conversion, causing a runtime failure if the
44864486
conversion fails.
44874487

4488-
unconditional_checked_cast_opaque
4489-
`````````````````````````````````
4488+
unconditional_checked_cast_value
4489+
````````````````````````````````
44904490
::
44914491

4492-
sil-instruction ::= 'unconditional_checked_cast_opaque' sil-operand 'to' sil-type
4492+
sil-instruction ::= 'unconditional_checked_cast_value' sil-operand 'to' sil-type
44934493

4494-
%1 = unconditional_checked_cast_opaque %0 : $A to $B
4494+
%1 = unconditional_checked_cast_value %0 : $A to $B
44954495
// $A must be not be an address
44964496
// $B must be an opaque value
44974497
// %1 will be of type $B

include/swift/SIL/SILBuilder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,10 +798,10 @@ class SILBuilder {
798798
targetType));
799799
}
800800

801-
UnconditionalCheckedCastOpaqueInst *
802-
createUnconditionalCheckedCastOpaque(SILLocation Loc, SILValue op,
803-
SILType destTy) {
804-
return insert(UnconditionalCheckedCastOpaqueInst::create(
801+
UnconditionalCheckedCastValueInst *
802+
createUnconditionalCheckedCastValue(SILLocation Loc, SILValue op,
803+
SILType destTy) {
804+
return insert(UnconditionalCheckedCastValueInst::create(
805805
getSILDebugLocation(Loc), op, destTy, F, OpenedArchetypes));
806806
}
807807

include/swift/SIL/SILCloner.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,13 +1157,13 @@ SILCloner<ImplClass>::visitUnconditionalCheckedCastAddrInst(
11571157
}
11581158

11591159
template <typename ImplClass>
1160-
void SILCloner<ImplClass>::visitUnconditionalCheckedCastOpaqueInst(
1161-
UnconditionalCheckedCastOpaqueInst *Inst) {
1160+
void SILCloner<ImplClass>::visitUnconditionalCheckedCastValueInst(
1161+
UnconditionalCheckedCastValueInst *Inst) {
11621162
SILLocation OpLoc = getOpLocation(Inst->getLoc());
11631163
SILValue OpValue = getOpValue(Inst->getOperand());
11641164
SILType OpType = getOpType(Inst->getType());
11651165
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
1166-
doPostProcess(Inst, getBuilder().createUnconditionalCheckedCastOpaque(
1166+
doPostProcess(Inst, getBuilder().createUnconditionalCheckedCastValue(
11671167
OpLoc, OpValue, OpType));
11681168
}
11691169

include/swift/SIL/SILInstruction.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,20 +2838,19 @@ class UnconditionalCheckedCastAddrInst : public SILInstruction
28382838

28392839
/// Perform an unconditional checked cast that aborts if the cast fails.
28402840
/// The result of the checked cast is left in the destination.
2841-
class UnconditionalCheckedCastOpaqueInst final
2841+
class UnconditionalCheckedCastValueInst final
28422842
: public UnaryInstructionWithTypeDependentOperandsBase<
2843-
ValueKind::UnconditionalCheckedCastOpaqueInst,
2844-
UnconditionalCheckedCastOpaqueInst, ConversionInst, true> {
2843+
ValueKind::UnconditionalCheckedCastValueInst,
2844+
UnconditionalCheckedCastValueInst, ConversionInst, true> {
28452845
friend SILBuilder;
28462846

2847-
UnconditionalCheckedCastOpaqueInst(SILDebugLocation DebugLoc,
2848-
SILValue Operand,
2849-
ArrayRef<SILValue> TypeDependentOperands,
2850-
SILType DestTy)
2847+
UnconditionalCheckedCastValueInst(SILDebugLocation DebugLoc, SILValue Operand,
2848+
ArrayRef<SILValue> TypeDependentOperands,
2849+
SILType DestTy)
28512850
: UnaryInstructionWithTypeDependentOperandsBase(
28522851
DebugLoc, Operand, TypeDependentOperands, DestTy) {}
28532852

2854-
static UnconditionalCheckedCastOpaqueInst *
2853+
static UnconditionalCheckedCastValueInst *
28552854
create(SILDebugLocation DebugLoc, SILValue Operand, SILType DestTy,
28562855
SILFunction &F, SILOpenedArchetypesState &OpenedArchetypes);
28572856
};

include/swift/SIL/SILNodes.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ ABSTRACT_VALUE(SILInstruction, ValueBase)
270270
INST(ObjCMetatypeToObjectInst, ConversionInst, objc_metatype_to_object, None, DoesNotRelease)
271271
INST(ObjCExistentialMetatypeToObjectInst, ConversionInst, objc_existential_metatype_to_object, None,
272272
DoesNotRelease)
273-
INST(UnconditionalCheckedCastOpaqueInst, ConversionInst, unconditional_checked_cast_opaque, None, DoesNotRelease)
273+
INST(UnconditionalCheckedCastValueInst, ConversionInst, unconditional_checked_cast_value, None, DoesNotRelease)
274274
INST(UnconditionalCheckedCastInst, ConversionInst, unconditional_checked_cast, None, DoesNotRelease)
275275
VALUE_RANGE(ConversionInst, UpcastInst, UnconditionalCheckedCastInst)
276276
INST(IsNonnullInst, SILInstruction, is_nonnull, None, DoesNotRelease)

lib/IRGen/IRGenSIL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,8 @@ class IRGenSILFunction :
973973
void visitObjCToThickMetatypeInst(ObjCToThickMetatypeInst *i);
974974
void visitUnconditionalCheckedCastInst(UnconditionalCheckedCastInst *i);
975975
void visitUnconditionalCheckedCastAddrInst(UnconditionalCheckedCastAddrInst *i);
976-
void visitUnconditionalCheckedCastOpaqueInst(
977-
UnconditionalCheckedCastOpaqueInst *i);
976+
void
977+
visitUnconditionalCheckedCastValueInst(UnconditionalCheckedCastValueInst *i);
978978
void visitObjCMetatypeToObjectInst(ObjCMetatypeToObjectInst *i);
979979
void visitObjCExistentialMetatypeToObjectInst(
980980
ObjCExistentialMetatypeToObjectInst *i);
@@ -4276,8 +4276,8 @@ void IRGenSILFunction::visitUnconditionalCheckedCastAddrInst(
42764276
i->getConsumptionKind(), CheckedCastMode::Unconditional);
42774277
}
42784278

4279-
void IRGenSILFunction::visitUnconditionalCheckedCastOpaqueInst(
4280-
swift::UnconditionalCheckedCastOpaqueInst *i) {
4279+
void IRGenSILFunction::visitUnconditionalCheckedCastValueInst(
4280+
swift::UnconditionalCheckedCastValueInst *i) {
42814281
llvm_unreachable("unsupported instruction during IRGen");
42824282
}
42834283

lib/Parse/ParseSIL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,7 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB, SILBuilder &B) {
24772477

24782478
// Checked Conversion instructions.
24792479
case ValueKind::UnconditionalCheckedCastInst:
2480-
case ValueKind::UnconditionalCheckedCastOpaqueInst:
2480+
case ValueKind::UnconditionalCheckedCastValueInst:
24812481
case ValueKind::CheckedCastValueBranchInst:
24822482
case ValueKind::CheckedCastBranchInst: {
24832483
SILType ty;
@@ -2501,10 +2501,10 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB, SILBuilder &B) {
25012501
return true;
25022502
ResultVal = B.createUnconditionalCheckedCast(InstLoc, Val, ty);
25032503
break;
2504-
} else if (Opcode == ValueKind::UnconditionalCheckedCastOpaqueInst) {
2504+
} else if (Opcode == ValueKind::UnconditionalCheckedCastValueInst) {
25052505
if (parseSILDebugLocation(InstLoc, B))
25062506
return true;
2507-
ResultVal = B.createUnconditionalCheckedCastOpaque(InstLoc, Val, ty);
2507+
ResultVal = B.createUnconditionalCheckedCastValue(InstLoc, Val, ty);
25082508
break;
25092509
}
25102510
// The conditional cast still needs its branch destinations.

lib/SIL/InstructionUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static bool isRCIdentityPreservingCast(ValueKind Kind) {
6767
case ValueKind::UncheckedRefCastInst:
6868
case ValueKind::UncheckedRefCastAddrInst:
6969
case ValueKind::UnconditionalCheckedCastInst:
70-
case ValueKind::UnconditionalCheckedCastOpaqueInst:
70+
case ValueKind::UnconditionalCheckedCastValueInst:
7171
case ValueKind::RefToBridgeObjectInst:
7272
case ValueKind::BridgeObjectToRefInst:
7373
return true;
@@ -364,7 +364,7 @@ void ConformanceCollector::collect(swift::SILInstruction *I) {
364364
case ValueKind::AllocRefDynamicInst:
365365
case ValueKind::MetatypeInst:
366366
case ValueKind::UnconditionalCheckedCastInst:
367-
case ValueKind::UnconditionalCheckedCastOpaqueInst:
367+
case ValueKind::UnconditionalCheckedCastValueInst:
368368
scanType(I->getType().getSwiftRValueType());
369369
break;
370370
case ValueKind::AllocStackInst: {

lib/SIL/SILInstructions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ UnconditionalCheckedCastInst *UnconditionalCheckedCastInst::create(
17731773
TypeDependentOperands, DestTy);
17741774
}
17751775

1776-
UnconditionalCheckedCastOpaqueInst *UnconditionalCheckedCastOpaqueInst::create(
1776+
UnconditionalCheckedCastValueInst *UnconditionalCheckedCastValueInst::create(
17771777
SILDebugLocation DebugLoc, SILValue Operand, SILType DestTy, SILFunction &F,
17781778
SILOpenedArchetypesState &OpenedArchetypes) {
17791779
SILModule &Mod = F.getModule();
@@ -1783,8 +1783,8 @@ UnconditionalCheckedCastOpaqueInst *UnconditionalCheckedCastOpaqueInst::create(
17831783
unsigned size =
17841784
totalSizeToAlloc<swift::Operand>(1 + TypeDependentOperands.size());
17851785
void *Buffer =
1786-
Mod.allocateInst(size, alignof(UnconditionalCheckedCastOpaqueInst));
1787-
return ::new (Buffer) UnconditionalCheckedCastOpaqueInst(
1786+
Mod.allocateInst(size, alignof(UnconditionalCheckedCastValueInst));
1787+
return ::new (Buffer) UnconditionalCheckedCastValueInst(
17881788
DebugLoc, Operand, TypeDependentOperands, DestTy);
17891789
}
17901790

lib/SIL/SILOwnershipVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static bool isOwnershipForwardingValueKind(ValueKind K) {
193193
case ValueKind::RefToBridgeObjectInst:
194194
case ValueKind::BridgeObjectToRefInst:
195195
case ValueKind::UnconditionalCheckedCastInst:
196-
case ValueKind::UnconditionalCheckedCastOpaqueInst:
196+
case ValueKind::UnconditionalCheckedCastValueInst:
197197
case ValueKind::TupleExtractInst:
198198
case ValueKind::StructExtractInst:
199199
case ValueKind::UncheckedEnumDataInst:
@@ -568,7 +568,7 @@ FORWARD_ANY_OWNERSHIP_INST(ConvertFunction)
568568
FORWARD_ANY_OWNERSHIP_INST(RefToBridgeObject)
569569
FORWARD_ANY_OWNERSHIP_INST(BridgeObjectToRef)
570570
FORWARD_ANY_OWNERSHIP_INST(UnconditionalCheckedCast)
571-
FORWARD_ANY_OWNERSHIP_INST(UnconditionalCheckedCastOpaque)
571+
FORWARD_ANY_OWNERSHIP_INST(UnconditionalCheckedCastValue)
572572
FORWARD_ANY_OWNERSHIP_INST(MarkUninitialized)
573573
FORWARD_ANY_OWNERSHIP_INST(UncheckedEnumData)
574574
#undef FORWARD_ANY_OWNERSHIP_INST

lib/SIL/SILPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,8 @@ class SILPrinter : public SILVisitor<SILPrinter> {
12231223
<< getIDAndType(CI->getDest());
12241224
}
12251225

1226-
void visitUnconditionalCheckedCastOpaqueInst(
1227-
UnconditionalCheckedCastOpaqueInst *CI) {
1226+
void visitUnconditionalCheckedCastValueInst(
1227+
UnconditionalCheckedCastValueInst *CI) {
12281228
*this << getIDAndType(CI->getOperand()) << " to " << CI->getType();
12291229
}
12301230

lib/SIL/SILValue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ CONSTANT_OWNERSHIP_INST(Owned, PartialApply)
215215
CONSTANT_OWNERSHIP_INST(Owned, StrongPin)
216216
CONSTANT_OWNERSHIP_INST(Owned, ThinToThickFunction)
217217
CONSTANT_OWNERSHIP_INST(Owned, InitExistentialOpaque)
218-
CONSTANT_OWNERSHIP_INST(Owned, UnconditionalCheckedCastOpaque)
218+
CONSTANT_OWNERSHIP_INST(Owned, UnconditionalCheckedCastValue)
219219

220220
// One would think that these /should/ be unowned. In truth they are owned since
221221
// objc metatypes do not go through the retain/release fast path. In their

lib/SIL/SILVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,8 +2522,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
25222522
verifyOpenedArchetype(CI, CI->getType().getSwiftRValueType());
25232523
}
25242524

2525-
void checkUnconditionalCheckedCastOpaqueInst(
2526-
UnconditionalCheckedCastOpaqueInst *CI) {
2525+
void checkUnconditionalCheckedCastValueInst(
2526+
UnconditionalCheckedCastValueInst *CI) {
25272527
verifyCheckedCast(/*exact*/ false, CI->getOperand()->getType(),
25282528
CI->getType(), true);
25292529
verifyOpenedArchetype(CI, CI->getType().getSwiftRValueType());

lib/SILGen/SILGenBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,9 @@ ManagedValue SILGenBuilder::createEnum(SILLocation loc, ManagedValue payload,
527527
return gen.emitManagedRValueWithCleanup(result);
528528
}
529529

530-
ManagedValue SILGenBuilder::createUnconditionalCheckedCastOpaque(
530+
ManagedValue SILGenBuilder::createUnconditionalCheckedCastValue(
531531
SILLocation loc, ManagedValue operand, SILType type) {
532-
SILValue result = SILBuilder::createUnconditionalCheckedCastOpaque(
532+
SILValue result = SILBuilder::createUnconditionalCheckedCastValue(
533533
loc, operand.forward(gen), type);
534534
return gen.emitManagedRValueWithCleanup(result);
535535
}

lib/SILGen/SILGenBuilder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ class SILGenBuilder : public SILBuilder {
218218
SILLocation loc, SILType ty, const TypeLowering &lowering,
219219
SGFContext context, std::function<void(SILValue)> rvalueEmitter);
220220

221-
using SILBuilder::createUnconditionalCheckedCastOpaque;
222-
ManagedValue createUnconditionalCheckedCastOpaque(SILLocation loc,
223-
ManagedValue operand,
224-
SILType type);
221+
using SILBuilder::createUnconditionalCheckedCastValue;
222+
ManagedValue createUnconditionalCheckedCastValue(SILLocation loc,
223+
ManagedValue operand,
224+
SILType type);
225225
using SILBuilder::createUnconditionalCheckedCast;
226226
ManagedValue createUnconditionalCheckedCast(SILLocation loc,
227227
ManagedValue operand,

lib/SILGen/SILGenDynamicCast.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace {
102102

103103
ManagedValue result;
104104
if (Strategy == CastStrategy::Address) {
105-
result = SGF.B.createUnconditionalCheckedCastOpaque(
105+
result = SGF.B.createUnconditionalCheckedCastValue(
106106
Loc, operand, origTargetTL.getLoweredType());
107107
} else {
108108
result = SGF.B.createUnconditionalCheckedCast(
@@ -388,7 +388,7 @@ namespace {
388388

389389
SILValue resultScalar;
390390
if (Strategy == CastStrategy::Address) {
391-
resultScalar = SGF.B.createUnconditionalCheckedCastOpaque(
391+
resultScalar = SGF.B.createUnconditionalCheckedCastValue(
392392
Loc, operand.forward(SGF), origTargetTL.getLoweredType());
393393
} else {
394394
resultScalar = SGF.B.createUnconditionalCheckedCast(

lib/SILOptimizer/Utils/Local.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ SILInstruction *CastOptimizer::simplifyCheckedCastValueBranchInst(
20452045
}
20462046

20472047
if (!CastedValue)
2048-
CastedValue = Builder.createUnconditionalCheckedCastOpaque(
2048+
CastedValue = Builder.createUnconditionalCheckedCastValue(
20492049
Loc, Op, LoweredTargetType);
20502050
} else {
20512051
CastedValue = SILUndef::get(LoweredTargetType, Mod);

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ InlineCost swift::instructionInlineCost(SILInstruction &I) {
396396
case ValueKind::UncheckedTakeEnumDataAddrInst:
397397
case ValueKind::UnconditionalCheckedCastInst:
398398
case ValueKind::UnconditionalCheckedCastAddrInst:
399-
case ValueKind::UnconditionalCheckedCastOpaqueInst:
399+
case ValueKind::UnconditionalCheckedCastValueInst:
400400
case ValueKind::UnmanagedToRefInst:
401401
case ValueKind::UnownedReleaseInst:
402402
case ValueKind::UnownedRetainInst:

lib/Serialization/DeserializeSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,11 +1924,11 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
19241924
failureBB);
19251925
break;
19261926
}
1927-
case ValueKind::UnconditionalCheckedCastOpaqueInst: {
1927+
case ValueKind::UnconditionalCheckedCastValueInst: {
19281928
SILValue Val = getLocalValue(
19291929
ValID, getSILType(MF->getType(TyID2), (SILValueCategory)TyCategory2));
19301930
SILType Ty = getSILType(MF->getType(TyID), (SILValueCategory)TyCategory);
1931-
ResultVal = Builder.createUnconditionalCheckedCastOpaque(Loc, Val, Ty);
1931+
ResultVal = Builder.createUnconditionalCheckedCastValue(Loc, Val, Ty);
19321932
break;
19331933
}
19341934
case ValueKind::UnconditionalCheckedCastAddrInst:

lib/Serialization/SerializeSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,8 +1307,8 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
13071307
llvm::makeArrayRef(listOfValues));
13081308
break;
13091309
}
1310-
case ValueKind::UnconditionalCheckedCastOpaqueInst: {
1311-
auto CI = cast<UnconditionalCheckedCastOpaqueInst>(&SI);
1310+
case ValueKind::UnconditionalCheckedCastValueInst: {
1311+
auto CI = cast<UnconditionalCheckedCastValueInst>(&SI);
13121312
SILInstCastLayout::emitRecord(
13131313
Out, ScratchRecord, SILAbbrCodes[SILInstCastLayout::Code],
13141314
(unsigned)SI.getKind(), /*attr*/ 0,

test/SIL/Parser/opaque_values_parse.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ struct S : Foo {
1616

1717
// CHECK-LABEL: sil @castOpaque : $@convention(thin) (Int) -> () {
1818
// CHECK: bb0([[ARG:%.*]] : $Int):
19-
// CHECK: unconditional_checked_cast_opaque [[ARG]] : $Int to $Foo
19+
// CHECK: unconditional_checked_cast_value [[ARG]] : $Int to $Foo
2020
// CHECK-LABEL: } // end sil function 'castOpaque'
2121
sil @castOpaque : $@convention(thin) (Int) -> () {
2222
bb0(%0 : $Int):
23-
%c = unconditional_checked_cast_opaque %0 : $Int to $Foo
23+
%c = unconditional_checked_cast_value %0 : $Int to $Foo
2424
%t = tuple ()
2525
return %t : $()
2626
}

test/SIL/Serialization/opaque_values_serialize.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ struct S : Foo {
2222

2323
// CHECK-LABEL: sil @castOpaque : $@convention(thin) (Int) -> () {
2424
// CHECK: bb0([[ARG:%.*]] : $Int):
25-
// CHECK: unconditional_checked_cast_opaque [[ARG]] : $Int to $Foo
25+
// CHECK: unconditional_checked_cast_value [[ARG]] : $Int to $Foo
2626
// CHECK-LABEL: } // end sil function 'castOpaque'
2727
sil @castOpaque : $@convention(thin) (Int) -> () {
2828
bb0(%0 : $Int):
29-
%c = unconditional_checked_cast_opaque %0 : $Int to $Foo
29+
%c = unconditional_checked_cast_value %0 : $Int to $Foo
3030
%t = tuple ()
3131
return %t : $()
3232
}

test/SIL/ownership-verifier/opaque_use_verifier.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ sil_stage canonical
99

1010
import Builtin
1111

12-
sil @unconditional_checked_cast_opaque_test : $@convention(thin) <T> (Builtin.Int32) -> @out T {
12+
sil @unconditional_checked_cast_value_test : $@convention(thin) <T> (Builtin.Int32) -> @out T {
1313
bb0(%0 : @trivial $Builtin.Int32):
14-
%1 = unconditional_checked_cast_opaque %0 : $Builtin.Int32 to $T
14+
%1 = unconditional_checked_cast_value %0 : $Builtin.Int32 to $T
1515
return %1 : $T
1616
}

test/SILGen/opaque_values_silgen.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func s160_______callAnyArg() {
257257
// CHECK: [[INT_TYPE:%.*]] = metatype $@thin Int.Type
258258
// CHECK: [[INT_LIT:%.*]] = integer_literal $Builtin.Int2048, 42
259259
// CHECK: [[INT_ARG:%.*]] = apply %{{.*}}([[INT_LIT]], [[INT_TYPE]]) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int
260-
// CHECK: [[INT_CAST:%.*]] = unconditional_checked_cast_opaque [[INT_ARG]] : $Int to $T
260+
// CHECK: [[INT_CAST:%.*]] = unconditional_checked_cast_value [[INT_ARG]] : $Int to $T
261261
// CHECK: [[CAST_BORROW:%.*]] = begin_borrow [[INT_CAST]] : $T
262262
// CHECK: [[RETURN_VAL:%.*]] = copy_value [[CAST_BORROW]] : $T
263263
// CHECK: end_borrow [[CAST_BORROW]] from [[INT_CAST]] : $T, $T
@@ -275,7 +275,7 @@ func s170____force_convert<T>() -> T {
275275
// CHECK: bb0:
276276
// CHECK: [[INT_LIT:%.*]] = integer_literal $Builtin.Int2048, 42
277277
// CHECK: [[INT_ARG:%.*]] = apply %{{.*}}([[INT_LIT]], [[INT_TYPE]]) : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int
278-
// CHECK: [[INT_CAST:%.*]] = unconditional_checked_cast_opaque [[INT_ARG]] : $Int to $Foo
278+
// CHECK: [[INT_CAST:%.*]] = unconditional_checked_cast_value [[INT_ARG]] : $Int to $Foo
279279
// CHECK: return [[INT_CAST]] : $Foo
280280
// CHECK-LABEL: } // end sil function '_T020opaque_values_silgen21s180_______return_fooAA3Foo_pyF'
281281
func s180_______return_foo() -> Foo {

utils/sil-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159

160160
;; Checked Conversions
161161
`(,(regexp-opt '("unconditional_checked_cast" "unconditional_checked_cast_addr"
162-
"unconditional_checked_cast_opaque")
162+
"unconditional_checked_cast_value")
163163
'words) . font-lock-keyword-face)
164164
;; Runtime Failures
165165
`(,(regexp-opt '("cond_fail")

utils/vim/syntax/sil.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ syn keyword swiftKeyword init_existential_addr init_existential_opaque init_exis
4040
syn keyword swiftKeyword upcast address_to_pointer pointer_to_address pointer_to_thin_function unchecked_addr_cast unchecked_ref_cast unchecked_ref_cast_addr ref_to_raw_pointer ref_to_bridge_object ref_to_unmanaged unmanaged_to_ref raw_pointer_to_ref skipwhite
4141
syn keyword swiftKeyword convert_function thick_to_objc_metatype thin_function_to_pointer objc_to_thick_metatype thin_to_thick_function is_nonnull unchecked_ref_bit_cast unchecked_trivial_bit_cast bridge_object_to_ref bridge_object_to_word unchecked_bitwise_cast skipwhite
4242
syn keyword swiftKeyword objc_existential_metatype_to_object objc_metatype_to_object objc_protocol skipwhite
43-
syn keyword swiftKeyword unconditional_checked_cast unconditional_checked_cast_addr unconditional_checked_cast_opaque skipwhite
43+
syn keyword swiftKeyword unconditional_checked_cast unconditional_checked_cast_addr unconditional_checked_cast_value skipwhite
4444
syn keyword swiftKeyword cond_fail skipwhite
4545
syn keyword swiftKeyword unreachable return throw br cond_br switch_value select_enum select_enum_addr select_value switch_enum switch_enum_addr dynamic_method_br checked_cast_br checked_cast_value_br checked_cast_addr_br skipwhite
4646
syn keyword swiftKeyword project_box project_existential_box project_value_buffer project_block_storage init_block_storage_header copy_block mark_dependence skipwhite

0 commit comments

Comments
 (0)