@@ -1501,24 +1501,21 @@ static bool serializeSIB(SILModule *SM, const PrimarySpecificPaths &PSPs,
15011501}
15021502
15031503static GeneratedModule
1504- generateIR (const IRGenOptions &IRGenOpts,
1504+ generateIR (const IRGenOptions &IRGenOpts, const TBDGenOptions &TBDOpts,
15051505 std::unique_ptr<SILModule> SM,
15061506 const PrimarySpecificPaths &PSPs,
15071507 StringRef OutputFilename, ModuleOrSourceFile MSF,
15081508 llvm::GlobalVariable *&HashGlobal,
1509- ArrayRef<std::string> parallelOutputFilenames,
1510- llvm::StringSet<> &LinkerDirectives) {
1509+ ArrayRef<std::string> parallelOutputFilenames) {
15111510 if (auto *SF = MSF.dyn_cast <SourceFile *>()) {
1512- return performIRGeneration (IRGenOpts, *SF ,
1511+ return performIRGeneration (*SF, IRGenOpts, TBDOpts ,
15131512 std::move (SM), OutputFilename, PSPs,
15141513 SF->getPrivateDiscriminator ().str (),
1515- &HashGlobal,
1516- &LinkerDirectives);
1514+ &HashGlobal);
15171515 } else {
1518- return performIRGeneration (IRGenOpts, MSF.get <ModuleDecl *>(),
1516+ return performIRGeneration (MSF.get <ModuleDecl *>(), IRGenOpts, TBDOpts ,
15191517 std::move (SM), OutputFilename, PSPs,
1520- parallelOutputFilenames,
1521- &HashGlobal, &LinkerDirectives);
1518+ parallelOutputFilenames, &HashGlobal);
15221519 }
15231520}
15241521
@@ -1663,19 +1660,6 @@ static bool generateCode(CompilerInstance &Instance, StringRef OutputFilename,
16631660 OutputFilename, Instance.getStatsReporter ());
16641661}
16651662
1666- static llvm::StringSet<>
1667- collectLinkerDirectives (const CompilerInvocation &Invocation,
1668- ModuleOrSourceFile MSF) {
1669- auto tbdOpts = Invocation.getTBDGenOptions ();
1670- tbdOpts.LinkerDirectivesOnly = true ;
1671- if (auto *SF = MSF.dyn_cast <SourceFile *>()) {
1672- return getPublicSymbols (TBDGenDescriptor::forFile (SF, tbdOpts));
1673- } else {
1674- return getPublicSymbols (
1675- TBDGenDescriptor::forModule (MSF.get <ModuleDecl *>(), tbdOpts));
1676- }
1677- }
1678-
16791663static bool performCompileStepsPostSILGen (CompilerInstance &Instance,
16801664 std::unique_ptr<SILModule> SM,
16811665 ModuleOrSourceFile MSF,
@@ -1783,18 +1767,13 @@ static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
17831767 return processCommandLineAndRunImmediately (
17841768 Instance, std::move (SM), MSF, observer, ReturnValue);
17851769
1786- llvm::StringSet<> LinkerDirectives;
1787- collectLinkerDirectives (Invocation, MSF, LinkerDirectives);
1788- // Don't proceed to IRGen if collecting linker directives failed.
1789- if (Context.hadError ())
1790- return true ;
17911770 StringRef OutputFilename = PSPs.OutputFilename ;
17921771 std::vector<std::string> ParallelOutputFilenames =
17931772 opts.InputsAndOutputs .copyOutputFilenames ();
17941773 llvm::GlobalVariable *HashGlobal;
17951774 auto IRModule = generateIR (
1796- IRGenOpts, std::move (SM), PSPs, OutputFilename, MSF, HashGlobal ,
1797- ParallelOutputFilenames, LinkerDirectives );
1775+ IRGenOpts, Invocation. getTBDGenOptions (), std::move (SM), PSPs,
1776+ OutputFilename, MSF, HashGlobal, ParallelOutputFilenames );
17981777
17991778 // Just because we had an AST error it doesn't mean we can't performLLVM.
18001779 bool HadError = Instance.getASTContext ().hadError ();
0 commit comments