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 {
112
112
void HandleVTable (CXXRecordDecl *RD) override ;
113
113
114
114
// 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);
116
116
117
117
// / Get the best possible source location to represent a diagnostic that
118
118
// / may have associated debug info.
Original file line number Diff line number Diff line change @@ -1035,7 +1035,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1035
1035
1036
1036
// Link against bitcodes supplied via the -mlink-builtin-bitcode option
1037
1037
if (CodeGenOpts.LinkBitcodePostopt )
1038
- MPM.addPass (LinkInModulesPass (BC, false ));
1038
+ MPM.addPass (LinkInModulesPass (BC));
1039
1039
1040
1040
// Add a verifier pass if requested. We don't have to do this if the action
1041
1041
// 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) {
226
226
HandleTopLevelDecl (D);
227
227
}
228
228
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) {
231
231
for (auto &LM : LinkModules) {
232
232
assert (LM.Module && " LinkModule does not actually have a module" );
233
233
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
-
239
234
if (LM.PropagateAttrs )
240
235
for (Function &F : *LM.Module ) {
241
236
// Skip intrinsics. Keep consistent with how intrinsics are created
Original file line number Diff line number Diff line change 20
20
21
21
using namespace llvm ;
22
22
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) {}
26
25
27
26
PreservedAnalyses LinkInModulesPass::run (Module &M, ModuleAnalysisManager &AM) {
28
27
if (!BC)
29
28
return PreservedAnalyses::all ();
30
29
31
- if (BC->LinkInModules (&M, ShouldLinkFiles ))
30
+ if (BC->LinkInModules (&M))
32
31
report_fatal_error (" Bitcode module postopt linking failed, aborted!" );
33
32
34
33
return PreservedAnalyses::none ();
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class LinkInModulesPass : public PassInfoMixin<LinkInModulesPass> {
31
31
bool ShouldLinkFiles;
32
32
33
33
public:
34
- LinkInModulesPass (clang::BackendConsumer *BC, bool ShouldLinkFiles = true );
34
+ LinkInModulesPass (clang::BackendConsumer *BC);
35
35
36
36
PreservedAnalyses run (Module &M, AnalysisManager<Module> &);
37
37
static bool isRequired () { return true ; }
You can’t perform that action at this time.
0 commit comments