File tree Expand file tree Collapse file tree 5 files changed +8
-14
lines changed Expand file tree Collapse file tree 5 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ class BackendConsumer : public ASTConsumer {
112112 void HandleVTable (CXXRecordDecl *RD) override ;
113113
114114 // Links each entry in LinkModules into our module. Returns true on error.
115- bool LinkInModules (llvm::Module *M, bool ShouldLinkFiles = true );
115+ bool LinkInModules (llvm::Module *M);
116116
117117 // / Get the best possible source location to represent a diagnostic that
118118 // / may have associated debug info.
Original file line number Diff line number Diff line change @@ -1035,7 +1035,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10351035
10361036 // Link against bitcodes supplied via the -mlink-builtin-bitcode option
10371037 if (CodeGenOpts.LinkBitcodePostopt )
1038- MPM.addPass (LinkInModulesPass (BC, false ));
1038+ MPM.addPass (LinkInModulesPass (BC));
10391039
10401040 // Add a verifier pass if requested. We don't have to do this if the action
10411041 // requires code generation because there will already be a verifier pass in
Original file line number Diff line number Diff line change @@ -226,16 +226,11 @@ void BackendConsumer::HandleInterestingDecl(DeclGroupRef D) {
226226 HandleTopLevelDecl (D);
227227}
228228
229- // Links each entry in LinkModules into our module. Returns true on error.
230- bool BackendConsumer::LinkInModules (llvm::Module *M, bool ShouldLinkFiles ) {
229+ // Links each entry in LinkModules into our module. Returns true on error.
230+ bool BackendConsumer::LinkInModules (llvm::Module *M) {
231231 for (auto &LM : LinkModules) {
232232 assert (LM.Module && " LinkModule does not actually have a module" );
233233
234- // If ShouldLinkFiles is not set, skip files added via the
235- // -mlink-bitcode-files, only linking -mlink-builtin-bitcode
236- if (!LM.Internalize && !ShouldLinkFiles)
237- continue ;
238-
239234 if (LM.PropagateAttrs )
240235 for (Function &F : *LM.Module ) {
241236 // Skip intrinsics. Keep consistent with how intrinsics are created
Original file line number Diff line number Diff line change 2020
2121using namespace llvm ;
2222
23- LinkInModulesPass::LinkInModulesPass (clang::BackendConsumer *BC,
24- bool ShouldLinkFiles)
25- : BC(BC), ShouldLinkFiles(ShouldLinkFiles) {}
23+ LinkInModulesPass::LinkInModulesPass (clang::BackendConsumer *BC) : BC(BC),
24+ ShouldLinkFiles(ShouldLinkFiles) {}
2625
2726PreservedAnalyses LinkInModulesPass::run (Module &M, ModuleAnalysisManager &AM) {
2827 if (!BC)
2928 return PreservedAnalyses::all ();
3029
31- if (BC->LinkInModules (&M, ShouldLinkFiles ))
30+ if (BC->LinkInModules (&M))
3231 report_fatal_error (" Bitcode module postopt linking failed, aborted!" );
3332
3433 return PreservedAnalyses::none ();
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class LinkInModulesPass : public PassInfoMixin<LinkInModulesPass> {
3131 bool ShouldLinkFiles;
3232
3333public:
34- LinkInModulesPass (clang::BackendConsumer *BC, bool ShouldLinkFiles = true );
34+ LinkInModulesPass (clang::BackendConsumer *BC);
3535
3636 PreservedAnalyses run (Module &M, AnalysisManager<Module> &);
3737 static bool isRequired () { return true ; }
You can’t perform that action at this time.
0 commit comments