Skip to content

Commit f3c6519

Browse files
committed
cleanup
1 parent 94553fd commit f3c6519

File tree

1 file changed

+6
-62
lines changed

1 file changed

+6
-62
lines changed

lib/SILOptimizer/Mandatory/FlowIsolation.cpp

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -58,64 +58,6 @@ struct State {
5858
static constexpr unsigned NumStates = 2;
5959
};
6060

61-
/// a ritzy wrapper for a SILInstruction* that includes a high-level description
62-
//struct NonIsolatedUse {
63-
// // NOTE: these enum values correspond to messages in diagnostics
64-
// enum Kind {
65-
// Uncategorized = 0,
66-
// SelfCopy = 1,
67-
// InvokeFunc = 2,
68-
// };
69-
//
70-
// SILInstruction* inst;
71-
// Kind kind;
72-
//
73-
// NonIsolatedUse() : inst(nullptr), kind(Uncategorized) {}
74-
// NonIsolatedUse(SILInstruction *i, Kind c) : inst(i), kind(c) {}
75-
// NonIsolatedUse(std::pair<SILInstruction*, Kind> const& other) {
76-
// inst = other.first;
77-
// kind = other.second;
78-
// }
79-
//
80-
// /// Returns an ID corresponding to a selector in a diagnostic suitable
81-
// /// for describing this use kind.
82-
// unsigned descriptionID() const {
83-
// return (unsigned)kind;
84-
// }
85-
//
86-
// /// Returns an identifier describing the subject of the use kind.
87-
// DeclName descriptionSubject() const {
88-
// switch (kind) {
89-
// // subject is 'self'
90-
// case SelfCopy:
91-
// case Uncategorized: {
92-
// auto &ctx = inst->getModule().getASTContext();
93-
// return ctx.Id_self;
94-
// break;
95-
// }
96-
//
97-
// // subject is the callee function
98-
// case MethodCall:
99-
// case ExplicitArgInCall: {
100-
// auto apply = ApplySite::isa(inst);
101-
// if (auto *fn = apply.getReferencedFunctionOrNull())
102-
// if (auto *declCxt = fn->getDeclContext())
103-
// if (auto *astDecl = dyn_cast<ValueDecl>(declCxt->getAsDecl()))
104-
// return astDecl->getName();
105-
// }
106-
// };
107-
// }
108-
//
109-
// operator bool() const {
110-
// return inst;
111-
// }
112-
//
113-
// void dump() const LLVM_ATTRIBUTE_USED {
114-
// inst->dump();
115-
// llvm::dbgs() << "(" << descriptionID() << ")\n";
116-
// }
117-
//};
118-
11961
/// Information gathered for analysis that is specific to a block.
12062
struct Info {
12163
using UseSet = SmallPtrSet<SILInstruction*, 8>;
@@ -827,10 +769,12 @@ void checkFlowIsolation(SILFunction *fn) {
827769
info.verifyIsolation();
828770
}
829771

830-
/// The FlowIsolation pass performs flow-sensitive actor-isolation checking in the body of actor member
831-
/// functions that treat `self` as `nonisolated` after the first `nonisolated` use. This pass uses a simple
832-
/// forward dataflow analysis to track these changes and emits diagnostics if an isolated use of `self` appears
833-
/// when `self` may be `nonisolated` at that point in the function.
772+
/// The FlowIsolation pass performs flow-sensitive actor-isolation checking in
773+
/// the body of actor member functions that treat `self` as `nonisolated` after
774+
/// the first `nonisolated` use. This pass uses a simple forward dataflow
775+
/// analysis to track these changes and emits diagnostics if an isolated use of
776+
/// `self` appears when `self` may be `nonisolated` at that point in the
777+
/// function.
834778
class FlowIsolation : public SILFunctionTransform {
835779

836780
/// The entry point to the checker.

0 commit comments

Comments
 (0)