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