summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-05-01 02:43:52 +0000
committerLang Hames <lhames@gmail.com>2019-05-01 02:43:52 +0000
commit3181b87cb68ecb4ab73a9cfe1096271b964e6aa9 (patch)
treee7ca0fd886e567502c5433f0a7b66be022b01c0c /llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
parent3740ca1e7fc757574683d64a797f4edd4f90a005 (diff)
downloadbcm5719-llvm-3181b87cb68ecb4ab73a9cfe1096271b964e6aa9.tar.gz
bcm5719-llvm-3181b87cb68ecb4ab73a9cfe1096271b964e6aa9.zip
[JITLink] Make sure we explicitly deallocate memory on failure.
JITLinkGeneric phases 2 and 3 (focused on applying fixups and finalizing memory, respectively) may fail for various reasons. If this happens, we need to explicitly de-allocate the memory allocated in phase 1 (explicitly, because deallocation may also fail and so is implemented as a method returning error). No testcase yet: I am still trying to decide on the right way to test totally platform agnostic code like this. llvm-svn: 359643
Diffstat (limited to 'llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h')
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
index 74db48fdff2..9d8238cf2e5 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
@@ -102,6 +102,7 @@ private:
Error allocateSegments(const SegmentLayoutMap &Layout);
DenseSet<StringRef> getExternalSymbolNames() const;
void applyLookupResult(AsyncLookupResult LR);
+ void deallocateAndBailOut(Error Err);
void dumpGraph(raw_ostream &OS);
OpenPOWER on IntegriCloud