File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2701,6 +2701,10 @@ static void markBuffersAsDontNeed(Ctx &ctx, bool skipLinkedOutput) {
27012701template <class ELFT >
27022702void LinkerDriver::compileBitcodeFiles (bool skipLinkedOutput) {
27032703 llvm::TimeTraceScope timeScope (" LTO" );
2704+ // Capture the triple before moving the bitcode into the bitcode compiler.
2705+ std::optional<llvm::Triple> tt;
2706+ if (!ctx.bitcodeFiles .empty ())
2707+ tt = llvm::Triple (ctx.bitcodeFiles .front ()->obj ->getTargetTriple ());
27042708 // Compile bitcode files and replace bitcode symbols.
27052709 lto.reset (new BitcodeCompiler (ctx));
27062710 for (BitcodeFile *file : ctx.bitcodeFiles )
@@ -2711,9 +2715,7 @@ void LinkerDriver::compileBitcodeFiles(bool skipLinkedOutput) {
27112715 SmallVector<StringRef> bitcodeLibFuncs;
27122716 if (!ctx.bitcodeFiles .empty ()) {
27132717 markBuffersAsDontNeed (ctx, skipLinkedOutput);
2714-
2715- llvm::Triple tt (ctx.bitcodeFiles .front ()->obj ->getTargetTriple ());
2716- for (StringRef libFunc : lto::LTO::getLibFuncSymbols (tt, saver)) {
2718+ for (StringRef libFunc : lto::LTO::getLibFuncSymbols (*tt, saver)) {
27172719 Symbol *sym = ctx.symtab ->find (libFunc);
27182720 if (!sym)
27192721 continue ;
You can’t perform that action at this time.
0 commit comments