mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: Remove unnecessary performSILLinking() calls from immediate mode and REPL
This commit is contained in:
@@ -59,8 +59,7 @@ namespace swift {
|
||||
/// serialized modules.
|
||||
///
|
||||
/// \param M the SILModule on which to operate
|
||||
/// \param LinkAll when true, always link. For testing purposes.
|
||||
void performSILLinking(SILModule *M, bool LinkAll = false);
|
||||
void performSILLinking(SILModule *M);
|
||||
|
||||
/// \brief Convert SIL to a lowered form suitable for IRGen.
|
||||
void runSILLoweringPasses(SILModule &M);
|
||||
|
||||
@@ -984,7 +984,7 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
static void linkAllIfNeeded(const CompilerInvocation &Invocation,
|
||||
SILModule *SM) {
|
||||
if (Invocation.getSILOptions().LinkMode == SILOptions::LinkAll)
|
||||
performSILLinking(SM, true);
|
||||
performSILLinking(SM);
|
||||
}
|
||||
|
||||
/// Perform "stable" optimizations that are invariant across compiler versions.
|
||||
|
||||
@@ -253,7 +253,6 @@ bool swift::immediate::IRGenImportedModules(
|
||||
|
||||
std::unique_ptr<SILModule> SILMod = performSILGeneration(import,
|
||||
CI.getSILOptions());
|
||||
performSILLinking(SILMod.get());
|
||||
if (runSILDiagnosticPasses(*SILMod)) {
|
||||
hadError = true;
|
||||
break;
|
||||
|
||||
@@ -869,7 +869,6 @@ private:
|
||||
if (!CI.getASTContext().hadError()) {
|
||||
sil = performSILGeneration(REPLInputFile, CI.getSILOptions(),
|
||||
RC.CurIRGenElem);
|
||||
performSILLinking(sil.get());
|
||||
runSILDiagnosticPasses(*sil);
|
||||
runSILLoweringPasses(*sil);
|
||||
}
|
||||
|
||||
@@ -20,14 +20,9 @@ using namespace swift;
|
||||
// Top Level Driver
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void swift::performSILLinking(SILModule *M, bool LinkAll) {
|
||||
auto LinkMode = LinkAll? SILModule::LinkingMode::LinkAll :
|
||||
SILModule::LinkingMode::LinkNormal;
|
||||
void swift::performSILLinking(SILModule *M) {
|
||||
for (auto &Fn : *M)
|
||||
M->linkFunction(&Fn, LinkMode);
|
||||
|
||||
if (!LinkAll)
|
||||
return;
|
||||
M->linkFunction(&Fn, SILModule::LinkingMode::LinkAll);
|
||||
|
||||
M->linkAllWitnessTables();
|
||||
M->linkAllVTables();
|
||||
|
||||
Reference in New Issue
Block a user