Lines Matching +full:composite +full:- +full:in
1 //===- llvm-link.cpp - Low-level LLVM linker ------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This utility may be invoked in the following manner:
10 // llvm-link a.bc b.bc c.bc -o x.bc
12 //===----------------------------------------------------------------------===//
57 // llvm-link to simulate ThinLTO backend processes.
61 "imported from bitcode in filename"),
65 // must be specified in the case were we request imports via the -import
67 // exported (imported by a different llvm-link -import invocation), to ensure
70 SummaryIndex("summary-index", cl::desc("Module summary index filename"),
75 OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
83 DisableDITypeMap("disable-debug-info-type-map",
87 static cl::opt<bool> OnlyNeeded("only-needed",
94 static cl::opt<bool> DisableLazyLoad("disable-lazy-loading",
109 static cl::opt<bool> SuppressWarnings("suppress-warnings",
114 "preserve-bc-uselistorder",
115 cl::desc("Preserve use-list order when writing LLVM bitcode."),
119 "preserve-ll-uselistorder",
120 cl::desc("Preserve use-list order when writing LLVM assembly."),
123 static cl::opt<bool> NoVerify("disable-verify",
128 "ignore-non-bitcode",
129 cl::desc("Do not report an error for non-bitcode files in archives"),
133 "try-experimental-debuginfo-iterators",
134 cl::desc("Enable debuginfo iterator positions, if they're built in"),
146 // Read the specified bitcode file in and return it. This routine searches the
155 errs() << "Loading '" << Buffer->getBufferIdentifier() << "'\n"; in loadFile()
169 ExitOnErr(Result->materializeMetadata()); in loadFile()
180 StringRef ArchiveName = Buffer->getBufferIdentifier(); in loadArFile()
185 object::Archive::create(Buffer->getMemBufferRef()); in loadArFile()
193 for (const object::Archive::Child &C : Archive->children(Err)) { in loadArFile()
264 /// Create the loader, Module will be initialized in \p Context.
276 std::unique_ptr<Module> Ret = std::move(I->second); in takeModule()
320 /// Import any functions requested via the -import option.
327 // Map of Module -> List of globals to import from the Module in importFunctions()
364 errs() << "Ignoring import request for non-existent function " in importFunctions()
371 if (F->hasWeakAnyLinkage()) { in importFunctions()
372 errs() << "Ignoring import request for weak-any function " << FunctionName in importFunctions()
380 // `-import` specifies the `<filename,function-name>` pairs to import as in importFunctions()
382 // FIXME: A follow-up patch should add test coverage for import declaration in importFunctions()
383 // in `llvm-link` CLI (e.g., by introducing a new command line option). in importFunctions()
385 ImportList[FileNameStringCache.insert(FileName).first->getKey()]; in importFunctions()
386 Entry[F->getGUID()] = GlobalValueSummary::Definition; in importFunctions()
417 identify_magic(Buffer->getBuffer()) == file_magic::archive in linkFiles()
426 // Note that when ODR merging types cannot verify input files in here When in linkFiles()
427 // doing that debug metadata in the src module might already be pointing to in linkFiles()
446 if (GlobalValue::isLocalLinkage(S->linkage())) in linkFiles()
447 S->setLinkage(GlobalValue::ExternalLinkage); in linkFiles()
458 errs() << "Linking in '" << File << "'\n"; in linkFiles()
496 // Since llvm-link collects multiple IR modules together, for simplicity's in main()
508 auto Composite = std::make_unique<Module>("llvm-link", Context); in main() local
509 Linker L(*Composite); in main()
519 // Next the -override ones. in main()
524 // Import any functions requested via -import in main()
525 if (!importFunctions(argv[0], *Composite)) in main()
529 errs() << "Here's the assembly:\n" << *Composite; in main()
540 if (!NoVerify && verifyModule(*Composite, &errs())) { in main()
549 Composite->setIsNewDbgInfoFormat(NewFormat); in main()
551 Composite->removeDebugIntrinsicDeclarations(); in main()
555 Composite->print(Out.os(), nullptr, PreserveAssemblyUseListOrder); in main()
558 WriteBitcodeToFile(*Composite, Out.os(), PreserveBitcodeUseListOrder); in main()