Skip to content

Commit 1e2eea6

Browse files
committed
[CallGraph] Rip out CallGraph from the linker pass.
1 parent cb83040 commit 1e2eea6

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

lib/SILPasses/UtilityPasses/Link.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "swift/SILAnalysis/CallGraph.h"
14-
#include "swift/SILAnalysis/CallGraphAnalysis.h"
1513
#include "swift/SILPasses/Passes.h"
1614
#include "swift/SILPasses/Transforms.h"
1715
#include "swift/SIL/SILModule.h"
@@ -38,20 +36,15 @@ void swift::performSILLinking(SILModule *M, bool LinkAll) {
3836

3937
namespace {
4038

39+
/// Copies code from the standard library into the user program to enable
40+
/// optimizations.
4141
class SILLinker : public SILModuleTransform {
4242

43-
/// The entry point to the transformation.
4443
void run() override {
45-
// Copies code from the standard library into the user program to enable
46-
// optimizations.
47-
auto *CGA = PM->getAnalysis<CallGraphAnalysis>();
48-
auto *CG = CGA->getCallGraphOrNull();
49-
CallGraphLinkerEditor Editor(CG);
5044
SILModule &M = *getModule();
5145
for (auto &Fn : M)
52-
if (M.linkFunction(&Fn, SILModule::LinkingMode::LinkAll,
53-
Editor.getCallback()))
54-
invalidateAnalysis(&Fn, SILAnalysis::InvalidationKind::Instructions);
46+
if (M.linkFunction(&Fn, SILModule::LinkingMode::LinkAll))
47+
invalidateAnalysis(&Fn, SILAnalysis::InvalidationKind::Everything);
5548
}
5649

5750
StringRef getName() override { return "SIL Linker"; }

0 commit comments

Comments
 (0)