aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-08-23 20:37:31 +0000
committerLang Hames <lhames@gmail.com>2019-08-23 20:37:31 +0000
commite00585c77ca63928794e730ac38194c659819db4 (patch)
tree79d9c53bbd87cc8138f598a24f369ecb0f158dbf /llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
parenta47d622240b199d6ab8736d83e1e3de44556f4a1 (diff)
downloadllvm-e00585c77ca63928794e730ac38194c659819db4.zip
llvm-e00585c77ca63928794e730ac38194c659819db4.tar.gz
llvm-e00585c77ca63928794e730ac38194c659819db4.tar.bz2
[ORC] Fix a FIXME: Propagate errors to dependencies.
When symbols are failed (via MaterializationResponsibility::failMaterialization) any symbols depending on them will now be moved to an error state. Attempting to resolve or emit a symbol in the error state (via the notifyResolved or notifyEmitted methods on MaterializationResponsibility) will result in an error. If notifyResolved or notifyEmitted return an error due to failure of a dependence then the caller should log or discard the error and call failMaterialization to propagate the failure to any queries waiting on the symbols being resolved/emitted (plus their dependencies). llvm-svn: 369808
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
index ff9b55d..0d0b8a9 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
@@ -127,7 +127,11 @@ public:
if (auto Err = MR.defineMaterializing(ExtraSymbolsToClaim))
return notifyFailed(std::move(Err));
- MR.notifyResolved(InternedResult);
+ if (auto Err = MR.notifyResolved(InternedResult)) {
+ Layer.getExecutionSession().reportError(std::move(Err));
+ MR.failMaterialization();
+ return;
+ }
Layer.notifyLoaded(MR);
}
@@ -138,10 +142,12 @@ public:
if (auto Err = Layer.notifyEmitted(MR, std::move(A))) {
Layer.getExecutionSession().reportError(std::move(Err));
MR.failMaterialization();
-
return;
}
- MR.notifyEmitted();
+ if (auto Err = MR.notifyEmitted()) {
+ Layer.getExecutionSession().reportError(std::move(Err));
+ MR.failMaterialization();
+ }
}
AtomGraphPassFunction getMarkLivePass(const Triple &TT) const override {