Add begin_access and end_access instructions.

NFC because we're not actually emitting them.
This commit is contained in:
John McCall
2017-03-26 04:15:55 -04:00
parent f95133070e
commit 57ecaa7fae
18 changed files with 612 additions and 34 deletions

View File

@@ -678,6 +678,26 @@ EndBorrowArgumentInst::EndBorrowArgumentInst(SILDebugLocation DebugLoc,
SILArgument *Arg)
: UnaryInstructionBase(DebugLoc, SILValue(Arg)) {}
StringRef swift::getSILAccessKindName(SILAccessKind kind) {
switch (kind) {
case SILAccessKind::Init: return "init";
case SILAccessKind::Read: return "read";
case SILAccessKind::Modify: return "modify";
case SILAccessKind::Deinit: return "deinit";
}
llvm_unreachable("bad access kind");
}
StringRef swift::getSILAccessEnforcementName(SILAccessEnforcement enforcement) {
switch (enforcement) {
case SILAccessEnforcement::Unknown: return "unknown";
case SILAccessEnforcement::Static: return "static";
case SILAccessEnforcement::Dynamic: return "dynamic";
case SILAccessEnforcement::Unsafe: return "unsafe";
}
llvm_unreachable("bad access enforcement");
}
AssignInst::AssignInst(SILDebugLocation Loc, SILValue Src, SILValue Dest)
: SILInstruction(ValueKind::AssignInst, Loc), Operands(this, Src, Dest) {}