Skip to content

Commit 91444dd

Browse files
committed
Delete dead code.
1 parent 8016bf2 commit 91444dd

File tree

1 file changed

+0
-96
lines changed

1 file changed

+0
-96
lines changed

lib/SILOptimizer/Utils/SILIsolationInfo.cpp

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -53,102 +53,6 @@ getGlobalActorInitIsolation(SILFunction *fn) {
5353
return getActorIsolation(globalDecl);
5454
}
5555

56-
class DeclRefExprAnalysis {
57-
DeclRefExpr *result = nullptr;
58-
59-
// Be greedy with the small size so we very rarely allocate.
60-
SmallVector<Expr *, 8> lookThroughExprs;
61-
62-
public:
63-
bool compute(Expr *expr);
64-
65-
DeclRefExpr *getResult() const {
66-
assert(result && "Not computed?!");
67-
return result;
68-
}
69-
70-
ArrayRef<Expr *> getLookThroughExprs() const {
71-
assert(result && "Not computed?!");
72-
return lookThroughExprs;
73-
}
74-
75-
void print(llvm::raw_ostream &os) const {
76-
if (!result) {
77-
os << "DeclRefExprAnalysis: None.";
78-
return;
79-
}
80-
81-
os << "DeclRefExprAnalysis:\n";
82-
result->dump(os);
83-
os << "\n";
84-
if (lookThroughExprs.size()) {
85-
os << "LookThroughExprs:\n";
86-
for (auto *expr : lookThroughExprs) {
87-
expr->dump(os, 4);
88-
}
89-
}
90-
}
91-
92-
SWIFT_DEBUG_DUMP { print(llvm::dbgs()); }
93-
94-
bool hasNonisolatedUnsafe() const {
95-
// See if our initial member_ref_expr is actor instance isolated.
96-
for (auto *expr : lookThroughExprs) {
97-
// We can skip load expr.
98-
if (isa<LoadExpr>(expr))
99-
continue;
100-
101-
if (auto *mri = dyn_cast<MemberRefExpr>(expr)) {
102-
if (mri->hasDecl()) {
103-
auto isolation = swift::getActorIsolation(mri->getDecl().getDecl());
104-
if (isolation.isNonisolatedUnsafe())
105-
return true;
106-
}
107-
}
108-
109-
break;
110-
}
111-
112-
return false;
113-
}
114-
};
115-
116-
bool DeclRefExprAnalysis::compute(Expr *expr) {
117-
struct LocalWalker final : ASTWalker {
118-
DeclRefExprAnalysis &parentAnalysis;
119-
120-
LocalWalker(DeclRefExprAnalysis &parentAnalysis)
121-
: parentAnalysis(parentAnalysis) {}
122-
123-
PreWalkResult<Expr *> walkToExprPre(Expr *expr) override {
124-
assert(!parentAnalysis.result && "Shouldn't have a result yet");
125-
126-
if (auto *dre = dyn_cast<DeclRefExpr>(expr)) {
127-
parentAnalysis.result = dre;
128-
return Action::Stop();
129-
}
130-
131-
if (isa<CoerceExpr, MemberRefExpr, ImplicitConversionExpr, IdentityExpr>(
132-
expr)) {
133-
parentAnalysis.lookThroughExprs.push_back(expr);
134-
return Action::Continue(expr);
135-
}
136-
137-
return Action::Stop();
138-
}
139-
};
140-
141-
LocalWalker walker(*this);
142-
143-
if (auto *ae = dyn_cast<AssignExpr>(expr)) {
144-
ae->getSrc()->walk(walker);
145-
} else {
146-
expr->walk(walker);
147-
}
148-
149-
return result;
150-
}
151-
15256
static SILIsolationInfo
15357
inferIsolationInfoForTempAllocStack(AllocStackInst *asi) {
15458
// We want to search for an alloc_stack that is not from a VarDecl and that is

0 commit comments

Comments
 (0)