Skip to content

Commit 67299b4

Browse files
committed
SIL bridging: work around an unresolved symbol linker error
Works around problem #64502
1 parent 010efc1 commit 67299b4

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

include/swift/SILOptimizer/Analysis/BasicCalleeAnalysis.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ class BasicCalleeAnalysis : public SILAnalysis {
191191
BasicCalleeAnalysis(SILModule *M)
192192
: SILAnalysis(SILAnalysisKind::BasicCallee), M(*M), Cache(nullptr) {}
193193

194+
~BasicCalleeAnalysis();
195+
194196
static bool classof(const SILAnalysis *S) {
195197
return S->getKind() == SILAnalysisKind::BasicCallee;
196198
}

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,10 @@ struct BridgedCalleeAnalysis {
5050
swift::BasicCalleeAnalysis * _Nonnull ca;
5151

5252
SWIFT_IMPORT_UNSAFE
53-
swift::CalleeList getCallees(BridgedValue callee) const {
54-
return ca->getCalleeListOfValue(callee.getSILValue());
55-
}
53+
swift::CalleeList getCallees(BridgedValue callee) const;
5654

5755
SWIFT_IMPORT_UNSAFE
58-
swift::CalleeList getDestructors(swift::SILType type, bool isExactType) const {
59-
return ca->getDestructors(type, isExactType);
60-
}
56+
swift::CalleeList getDestructors(swift::SILType type, bool isExactType) const;
6157

6258
SWIFT_IMPORT_UNSAFE
6359
static BridgedFunction getCallee(swift::CalleeList cl, SwiftInt index) {

lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ CalleeList CalleeCache::getDestructors(SILType type, bool isExactType) const {
313313
return getCalleeList(SILDeclRef(classDecl->getDestructor()));
314314
}
315315

316+
// TODO: can't be inlined to work around https://github.com/apple/swift/issues/64502
317+
BasicCalleeAnalysis::~BasicCalleeAnalysis() {
318+
}
319+
316320
void BasicCalleeAnalysis::dump() const {
317321
print(llvm::errs());
318322
}

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,3 +1444,13 @@ bool BridgedPassContext::enableSimplificationFor(BridgedInstruction inst) const
14441444
}
14451445
return false;
14461446
}
1447+
1448+
// TODO: can't be inlined to work around https://github.com/apple/swift/issues/64502
1449+
CalleeList BridgedCalleeAnalysis::getCallees(BridgedValue callee) const {
1450+
return ca->getCalleeListOfValue(callee.getSILValue());
1451+
}
1452+
1453+
// TODO: can't be inlined to work around https://github.com/apple/swift/issues/64502
1454+
CalleeList BridgedCalleeAnalysis::getDestructors(SILType type, bool isExactType) const {
1455+
return ca->getDestructors(type, isExactType);
1456+
}

0 commit comments

Comments
 (0)