[llvm] 7129237 - Make LazyCallThroughManager destructor virtual rather than arranging for

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 18:41:18 PDT 2020


Author: Richard Smith
Date: 2020-07-14T18:41:07-07:00
New Revision: 71292379d757f7a40b1771ade7738e25d7ddece5

URL: https://github.com/llvm/llvm-project/commit/71292379d757f7a40b1771ade7738e25d7ddece5
DIFF: https://github.com/llvm/llvm-project/commit/71292379d757f7a40b1771ade7738e25d7ddece5.diff

LOG: Make LazyCallThroughManager destructor virtual rather than arranging for
all clients to delete it via the correct dynamic type.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
    llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
    llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index 2b56a4e8b63e..96f8e169e7dc 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -250,7 +250,7 @@ class LLLazyJIT : public LLJIT {
   // Create a single-threaded LLLazyJIT instance.
   LLLazyJIT(LLLazyJITBuilderState &S, Error &Err);
 
-  std::unique_ptr<LocalLazyCallThroughManager> LCTMgr;
+  std::unique_ptr<LazyCallThroughManager> LCTMgr;
   std::unique_ptr<CompileOnDemandLayer> CODLayer;
 };
 
@@ -384,7 +384,7 @@ class LLLazyJITBuilderState : public LLJITBuilderState {
 
   Triple TT;
   JITTargetAddress LazyCompileFailureAddr = 0;
-  std::unique_ptr<LocalLazyCallThroughManager> LCTMgr;
+  std::unique_ptr<LazyCallThroughManager> LCTMgr;
   IndirectStubsManagerBuilderFunction ISMBuilder;
 
   Error prepareForConstruction();

diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
index 3225d6078bf8..0d3ccecdf121 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
@@ -50,13 +50,14 @@ class LazyCallThroughManager {
       JITTargetAddress TrampolineAddr,
       TrampolinePool::NotifyLandingResolvedFunction NotifyLandingResolved);
 
+  virtual ~LazyCallThroughManager() = default;
+
 protected:
   using NotifyLandingResolvedFunction =
       TrampolinePool::NotifyLandingResolvedFunction;
 
   LazyCallThroughManager(ExecutionSession &ES,
                          JITTargetAddress ErrorHandlerAddr, TrampolinePool *TP);
-  ~LazyCallThroughManager() = default;
 
   struct ReexportsEntry {
     JITDylib *SourceJD;
@@ -128,7 +129,7 @@ class LocalLazyCallThroughManager : public LazyCallThroughManager {
 
 /// Create a LocalLazyCallThroughManager from the given triple and execution
 /// session.
-Expected<std::unique_ptr<LocalLazyCallThroughManager>>
+Expected<std::unique_ptr<LazyCallThroughManager>>
 createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
                                   JITTargetAddress ErrorHandlerAddr);
 

diff  --git a/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp b/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
index fda6c7930581..153f6b80784f 100644
--- a/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
@@ -98,7 +98,7 @@ void LazyCallThroughManager::resolveTrampolineLandingAddress(
       NoDependenciesToRegister);
 }
 
-Expected<std::unique_ptr<LocalLazyCallThroughManager>>
+Expected<std::unique_ptr<LazyCallThroughManager>>
 createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
                                   JITTargetAddress ErrorHandlerAddr) {
   switch (T.getArch()) {


        


More information about the llvm-commits mailing list