mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Add an UpcastExistentialInst.
Converting from a protocol type to a more general protocol type is different at the implementation level from converting a concrete type to a protocol type, since the witness tables and concrete value can be copied directly from the original existential container to the new without adding another indirection. This instruction represents that operation. Swift SVN r3887
This commit is contained in:
@@ -342,6 +342,13 @@ public:
|
||||
OS << "init_existential " << getID(AEI->getExistential()) << ", $";
|
||||
AEI->getConcreteType()->print(OS);
|
||||
}
|
||||
void visitUpcastExistentialInst(UpcastExistentialInst *UEI) {
|
||||
OS << "upcast_existential ";
|
||||
if (UEI->isTakeOfSrc())
|
||||
OS << "[take] ";
|
||||
OS << getID(UEI->getSrcExistential())
|
||||
<< " to " << getID(UEI->getDestExistential());
|
||||
}
|
||||
void visitDeinitExistentialInst(DeinitExistentialInst *DEI) {
|
||||
OS << "deinit_existential " << getID(DEI->getExistential());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user