SIL: Add instructions for boxed existential operations.

Parsing and serialization for {Alloc,Open,Dealloc}ExistentialBox instructions to represent operations on ErrorType boxes.

Swift SVN r26145
This commit is contained in:
Joe Groff
2015-03-15 03:32:37 +00:00
parent 8962cd2665
commit fdde2a8e99
16 changed files with 427 additions and 60 deletions

View File

@@ -1100,6 +1100,10 @@ public:
OS << "open_existential_metatype " << getIDAndType(OI->getOperand())
<< " to " << OI->getType();
}
void visitOpenExistentialBoxInst(OpenExistentialBoxInst *OI) {
OS << "open_existential_box " << getIDAndType(OI->getOperand())
<< " to " << OI->getType();
}
void visitInitExistentialAddrInst(InitExistentialAddrInst *AEI) {
OS << "init_existential_addr " << getIDAndType(AEI->getOperand()) << ", $";
AEI->getFormalConcreteType().print(OS);
@@ -1113,9 +1117,17 @@ public:
OS << "init_existential_metatype " << getIDAndType(AEI->getOperand())
<< ", " << AEI->getType();
}
void visitAllocExistentialBoxInst(AllocExistentialBoxInst *AEBI) {
OS << "alloc_existential_box " << AEBI->getExistentialType()
<< ", $" << AEBI->getFormalConcreteType();
}
void visitDeinitExistentialAddrInst(DeinitExistentialAddrInst *DEI) {
OS << "deinit_existential_addr " << getIDAndType(DEI->getOperand());
}
void visitDeallocExistentialBoxInst(DeallocExistentialBoxInst *DEI) {
OS << "dealloc_existential_box " << getIDAndType(DEI->getOperand())
<< ", $" << DEI->getConcreteType();
}
void visitProjectBlockStorageInst(ProjectBlockStorageInst *PBSI) {
OS << "project_block_storage " << getIDAndType(PBSI->getOperand());
}