aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2022-03-14 14:08:25 -0700
committerNick Desaulniers <ndesaulniers@google.com>2022-03-14 14:37:34 -0700
commit236695e70c41e3d649b2b8a4a72f58e4218f0aa9 (patch)
tree891245df899073317f1ee071750d310cc94d8743 /llvm/lib/Linker/LinkModules.cpp
parente049a87f04cff8e81b4177097a6b2fdf37c7b148 (diff)
downloadllvm-236695e70c41e3d649b2b8a4a72f58e4218f0aa9.zip
llvm-236695e70c41e3d649b2b8a4a72f58e4218f0aa9.tar.gz
llvm-236695e70c41e3d649b2b8a4a72f58e4218f0aa9.tar.bz2
[IRLinker] make IRLinker::AddLazyFor optional (llvm::unique_function). NFC
2 of the 3 callsite of IRMover::move() pass empty lambda functions. Just make this parameter llvm::unique_function. Came about via discussion in D120781. Probably worth making this change regardless of the resolution of D120781. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D121630
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index f9f51bf..436c3eb 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -573,11 +573,13 @@ bool ModuleLinker::run() {
// FIXME: Propagate Errors through to the caller instead of emitting
// diagnostics.
bool HasErrors = false;
- if (Error E = Mover.move(std::move(SrcM), ValuesToLink.getArrayRef(),
- [this](GlobalValue &GV, IRMover::ValueAdder Add) {
- addLazyFor(GV, Add);
- },
- /* IsPerformingImport */ false)) {
+ if (Error E =
+ Mover.move(std::move(SrcM), ValuesToLink.getArrayRef(),
+ IRMover::LazyCallback(
+ [this](GlobalValue &GV, IRMover::ValueAdder Add) {
+ addLazyFor(GV, Add);
+ }),
+ /* IsPerformingImport */ false)) {
handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) {
DstM.getContext().diagnose(LinkDiagnosticInfo(DS_Error, EIB.message()));
HasErrors = true;