LCOV - code coverage report
Current view: top level - lib/ExecutionEngine/Orc - OrcCBindingsStack.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 141 197 71.6 %
Date: 2018-09-23 13:06:45 Functions: 24 32 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- OrcCBindingsStack.h - Orc JIT stack for C bindings -----*- C++ -*---===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : 
      10             : #ifndef LLVM_LIB_EXECUTIONENGINE_ORC_ORCCBINDINGSSTACK_H
      11             : #define LLVM_LIB_EXECUTIONENGINE_ORC_ORCCBINDINGSSTACK_H
      12             : 
      13             : #include "llvm-c/OrcBindings.h"
      14             : #include "llvm-c/TargetMachine.h"
      15             : #include "llvm/ADT/STLExtras.h"
      16             : #include "llvm/ADT/StringRef.h"
      17             : #include "llvm/ExecutionEngine/JITSymbol.h"
      18             : #include "llvm/ExecutionEngine/JITEventListener.h"
      19             : #include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
      20             : #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
      21             : #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
      22             : #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
      23             : #include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
      24             : #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
      25             : #include "llvm/ExecutionEngine/RuntimeDyld.h"
      26             : #include "llvm/ExecutionEngine/SectionMemoryManager.h"
      27             : #include "llvm/IR/DataLayout.h"
      28             : #include "llvm/IR/Mangler.h"
      29             : #include "llvm/IR/Module.h"
      30             : #include "llvm/Support/CBindingWrapping.h"
      31             : #include "llvm/Support/Error.h"
      32             : #include "llvm/Support/raw_ostream.h"
      33             : #include "llvm/Target/TargetMachine.h"
      34             : #include <algorithm>
      35             : #include <cstdint>
      36             : #include <functional>
      37             : #include <map>
      38             : #include <memory>
      39             : #include <set>
      40             : #include <string>
      41             : #include <vector>
      42             : 
      43             : namespace llvm {
      44             : 
      45             : class OrcCBindingsStack;
      46             : 
      47             : DEFINE_SIMPLE_CONVERSION_FUNCTIONS(OrcCBindingsStack, LLVMOrcJITStackRef)
      48             : DEFINE_SIMPLE_CONVERSION_FUNCTIONS(TargetMachine, LLVMTargetMachineRef)
      49             : 
      50             : namespace detail {
      51             : 
      52             : // FIXME: Kill this off once the Layer concept becomes an interface.
      53             : class GenericLayer {
      54             : public:
      55           0 :   virtual ~GenericLayer() = default;
      56             : 
      57             :   virtual JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
      58             :                                  bool ExportedSymbolsOnly) = 0;
      59             :   virtual Error removeModule(orc::VModuleKey K) = 0;
      60             :   };
      61             : 
      62             :   template <typename LayerT> class GenericLayerImpl : public GenericLayer {
      63             :   public:
      64           3 :     GenericLayerImpl(LayerT &Layer) : Layer(Layer) {}
      65             : 
      66           1 :     JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
      67             :                            bool ExportedSymbolsOnly) override {
      68           1 :       return Layer.findSymbolIn(K, Name, ExportedSymbolsOnly);
      69             :     }
      70           1 : 
      71             :     Error removeModule(orc::VModuleKey K) override {
      72           1 :       return Layer.removeModule(K);
      73             :     }
      74           0 : 
      75             :   private:
      76           0 :     LayerT &Layer;
      77             :   };
      78             : 
      79           3 :   template <>
      80           3 :   class GenericLayerImpl<orc::RTDyldObjectLinkingLayer> : public GenericLayer {
      81             :   private:
      82           2 :     using LayerT = orc::RTDyldObjectLinkingLayer;
      83           2 :   public:
      84             :     GenericLayerImpl(LayerT &Layer) : Layer(Layer) {}
      85           1 : 
      86           1 :     JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
      87             :                            bool ExportedSymbolsOnly) override {
      88             :       return Layer.findSymbolIn(K, Name, ExportedSymbolsOnly);
      89             :     }
      90             : 
      91             :     Error removeModule(orc::VModuleKey K) override {
      92             :       return Layer.removeObject(K);
      93             :     }
      94             : 
      95             :   private:
      96             :     LayerT &Layer;
      97             :   };
      98           1 : 
      99             :   template <typename LayerT>
     100           0 :   std::unique_ptr<GenericLayerImpl<LayerT>> createGenericLayer(LayerT &Layer) {
     101             :     return llvm::make_unique<GenericLayerImpl<LayerT>>(Layer);
     102           0 :   }
     103             : 
     104             : } // end namespace detail
     105           1 : 
     106           1 : class OrcCBindingsStack {
     107             : public:
     108             : 
     109             :   using CompileCallbackMgr = orc::JITCompileCallbackManager;
     110             :   using ObjLayerT = orc::RTDyldObjectLinkingLayer;
     111             :   using CompileLayerT = orc::IRCompileLayer<ObjLayerT, orc::SimpleCompiler>;
     112             :   using CODLayerT =
     113             :         orc::CompileOnDemandLayer<CompileLayerT, CompileCallbackMgr>;
     114             : 
     115             :   using CallbackManagerBuilder =
     116             :       std::function<std::unique_ptr<CompileCallbackMgr>()>;
     117             : 
     118             :   using IndirectStubsManagerBuilder = CODLayerT::IndirectStubsManagerBuilderT;
     119             : 
     120             : private:
     121             : 
     122             :   using OwningObject = object::OwningBinary<object::ObjectFile>;
     123             : 
     124             :   class CBindingsResolver : public orc::SymbolResolver {
     125             :   public:
     126             :     CBindingsResolver(OrcCBindingsStack &Stack,
     127             :                       LLVMOrcSymbolResolverFn ExternalResolver,
     128             :                       void *ExternalResolverCtx)
     129             :         : Stack(Stack), ExternalResolver(std::move(ExternalResolver)),
     130             :           ExternalResolverCtx(std::move(ExternalResolverCtx)) {}
     131             : 
     132             :     orc::SymbolNameSet
     133             :     getResponsibilitySet(const orc::SymbolNameSet &Symbols) override {
     134             :       orc::SymbolNameSet Result;
     135             : 
     136             :       for (auto &S : Symbols) {
     137             :         if (auto Sym = findSymbol(*S)) {
     138             :           if (!Sym.getFlags().isStrong())
     139             :             Result.insert(S);
     140             :         } else if (auto Err = Sym.takeError()) {
     141             :           Stack.reportError(std::move(Err));
     142             :           return orc::SymbolNameSet();
     143           4 :         }
     144           4 :       }
     145             : 
     146             :       return Result;
     147           3 :     }
     148             : 
     149             :     orc::SymbolNameSet
     150           3 :     lookup(std::shared_ptr<orc::AsynchronousSymbolQuery> Query,
     151           0 :            orc::SymbolNameSet Symbols) override {
     152             :       orc::SymbolNameSet UnresolvedSymbols;
     153             : 
     154           0 :       for (auto &S : Symbols) {
     155           0 :         if (auto Sym = findSymbol(*S)) {
     156           0 :           if (auto Addr = Sym.getAddress()) {
     157             :             Query->resolve(S, JITEvaluatedSymbol(*Addr, Sym.getFlags()));
     158             :             Query->notifySymbolReady();
     159             :           } else {
     160             :             Stack.ES.legacyFailQuery(*Query, Addr.takeError());
     161             :             return orc::SymbolNameSet();
     162             :           }
     163             :         } else if (auto Err = Sym.takeError()) {
     164           4 :           Stack.ES.legacyFailQuery(*Query, std::move(Err));
     165             :           return orc::SymbolNameSet();
     166             :         } else
     167             :           UnresolvedSymbols.insert(S);
     168           8 :       }
     169          16 : 
     170           4 :       if (Query->isFullyResolved())
     171           8 :         Query->handleFullyResolved();
     172           4 : 
     173             :       if (Query->isFullyReady())
     174           0 :         Query->handleFullyReady();
     175           0 : 
     176             :       return UnresolvedSymbols;
     177           0 :     }
     178           0 : 
     179           0 :   private:
     180             :     JITSymbol findSymbol(const std::string &Name) {
     181             :       // Search order:
     182             :       // 1. JIT'd symbols.
     183             :       // 2. Runtime overrides.
     184           4 :       // 3. External resolver (if present).
     185           4 : 
     186             :       if (auto Sym = Stack.CODLayer.findSymbol(Name, true))
     187           4 :         return Sym;
     188           4 :       else if (auto Err = Sym.takeError())
     189             :         return Sym.takeError();
     190             : 
     191             :       if (auto Sym = Stack.CXXRuntimeOverrides.searchOverrides(Name))
     192             :         return Sym;
     193             : 
     194           4 :       if (ExternalResolver)
     195             :         return JITSymbol(ExternalResolver(Name.c_str(), ExternalResolverCtx),
     196             :                          JITSymbolFlags::Exported);
     197             : 
     198             :       return JITSymbol(nullptr);
     199             :     }
     200          12 : 
     201           0 :     OrcCBindingsStack &Stack;
     202           4 :     LLVMOrcSymbolResolverFn ExternalResolver;
     203             :     void *ExternalResolverCtx = nullptr;
     204             :   };
     205           4 : 
     206           0 : public:
     207             :   OrcCBindingsStack(TargetMachine &TM,
     208           4 :                     IndirectStubsManagerBuilder IndirectStubsMgrBuilder)
     209             :       : CCMgr(createLocalCompileCallbackManager(TM.getTargetTriple(), ES, 0)),
     210           8 :         DL(TM.createDataLayout()), IndirectStubsMgr(IndirectStubsMgrBuilder()),
     211             :         ObjectLayer(ES,
     212             :                     [this](orc::VModuleKey K) {
     213             :                       auto ResolverI = Resolvers.find(K);
     214             :                       assert(ResolverI != Resolvers.end() &&
     215             :                              "No resolver for module K");
     216             :                       auto Resolver = std::move(ResolverI->second);
     217             :                       Resolvers.erase(ResolverI);
     218             :                       return ObjLayerT::Resources{
     219             :                           std::make_shared<SectionMemoryManager>(), Resolver};
     220             :                     },
     221           4 :                     nullptr,
     222             :                     [this](orc::VModuleKey K, const object::ObjectFile &Obj,
     223           4 :                            const RuntimeDyld::LoadedObjectInfo &LoadedObjInfo) {
     224             :                       this->notifyFinalized(K, Obj, LoadedObjInfo);
     225             :                     },
     226             :                     [this](orc::VModuleKey K, const object::ObjectFile &Obj) {
     227             :                       this->notifyFreed(K, Obj);
     228             :                     }),
     229             :         CompileLayer(ObjectLayer, orc::SimpleCompiler(TM)),
     230             :         CODLayer(ES, CompileLayer,
     231             :                  [this](orc::VModuleKey K) {
     232             :                    auto ResolverI = Resolvers.find(K);
     233             :                    assert(ResolverI != Resolvers.end() &&
     234             :                           "No resolver for module K");
     235             :                    return ResolverI->second;
     236             :                  },
     237             :                  [this](orc::VModuleKey K,
     238             :                         std::shared_ptr<orc::SymbolResolver> Resolver) {
     239             :                    assert(!Resolvers.count(K) && "Resolver already present");
     240             :                    Resolvers[K] = std::move(Resolver);
     241             :                  },
     242             :                  [](Function &F) { return std::set<Function *>({&F}); },
     243             :                  *this->CCMgr, std::move(IndirectStubsMgrBuilder), false),
     244             :         CXXRuntimeOverrides(
     245             :             [this](const std::string &S) { return mangle(S); }) {}
     246             : 
     247             :   LLVMOrcErrorCode shutdown() {
     248             :     // Run any destructors registered with __cxa_atexit.
     249             :     CXXRuntimeOverrides.runDestructors();
     250             :     // Run any IR destructors.
     251             :     for (auto &DtorRunner : IRStaticDestructorRunners)
     252             :       if (auto Err = DtorRunner.runViaLayer(*this))
     253             :         return mapError(std::move(Err));
     254             :     return LLVMOrcErrSuccess;
     255             :   }
     256           1 : 
     257             :   std::string mangle(StringRef Name) {
     258             :     std::string MangledName;
     259          44 :     {
     260             :       raw_string_ostream MangledNameStream(MangledName);
     261           4 :       Mangler::getNameWithPrefix(MangledNameStream, Name, DL);
     262             :     }
     263           4 :     return MangledName;
     264             :   }
     265           7 : 
     266           6 :   template <typename PtrTy>
     267           0 :   static PtrTy fromTargetAddress(JITTargetAddress Addr) {
     268             :     return reinterpret_cast<PtrTy>(static_cast<uintptr_t>(Addr));
     269             :   }
     270             : 
     271          17 : 
     272             :   LLVMOrcErrorCode
     273             :   createLazyCompileCallback(JITTargetAddress &RetAddr,
     274          17 :                             LLVMOrcLazyCompileCallbackFn Callback,
     275          34 :                             void *CallbackCtx) {
     276             :     auto WrappedCallback = [=]() -> JITTargetAddress {
     277          17 :       return Callback(wrap(this), CallbackCtx);
     278             :     };
     279             : 
     280             :     if (auto CCAddr = CCMgr->getCompileCallback(std::move(WrappedCallback))) {
     281             :       RetAddr = *CCAddr;
     282             :       return LLVMOrcErrSuccess;
     283             :     } else
     284             :       return mapError(CCAddr.takeError());
     285             :   }
     286             : 
     287           1 :   LLVMOrcErrorCode createIndirectStub(StringRef StubName,
     288             :                                       JITTargetAddress Addr) {
     289             :     return mapError(
     290             :         IndirectStubsMgr->createStub(StubName, Addr, JITSymbolFlags::Exported));
     291           1 :   }
     292             : 
     293             :   LLVMOrcErrorCode setIndirectStubPointer(StringRef Name,
     294           3 :                                           JITTargetAddress Addr) {
     295           1 :     return mapError(IndirectStubsMgr->updatePointer(Name, Addr));
     296           1 :   }
     297             :   template <typename LayerT>
     298           0 :   LLVMOrcErrorCode
     299             :   addIRModule(orc::VModuleKey &RetKey, LayerT &Layer, std::unique_ptr<Module> M,
     300             :               std::unique_ptr<RuntimeDyld::MemoryManager> MemMgr,
     301           1 :               LLVMOrcSymbolResolverFn ExternalResolver,
     302             :               void *ExternalResolverCtx) {
     303           1 : 
     304           2 :     // Attach a data-layout if one isn't already present.
     305             :     if (M->getDataLayout().isDefault())
     306             :       M->setDataLayout(DL);
     307           1 : 
     308             :     // Record the static constructors and destructors. We have to do this before
     309           1 :     // we hand over ownership of the module to the JIT.
     310             :     std::vector<std::string> CtorNames, DtorNames;
     311             :     for (auto Ctor : orc::getConstructors(*M))
     312             :       CtorNames.push_back(mangle(Ctor.Func->getName()));
     313           3 :     for (auto Dtor : orc::getDestructors(*M))
     314             :       DtorNames.push_back(mangle(Dtor.Func->getName()));
     315             : 
     316             :     // Add the module to the JIT.
     317             :     RetKey = ES.allocateVModule();
     318             :     Resolvers[RetKey] = std::make_shared<CBindingsResolver>(
     319           3 :         *this, ExternalResolver, ExternalResolverCtx);
     320           3 :     if (auto Err = Layer.addModule(RetKey, std::move(M)))
     321             :       return mapError(std::move(Err));
     322             : 
     323             :     KeyLayers[RetKey] = detail::createGenericLayer(Layer);
     324           3 : 
     325           3 :     // Run the static constructors, and save the static destructor runner for
     326           0 :     // execution when the JIT is torn down.
     327           3 :     orc::CtorDtorRunner<OrcCBindingsStack> CtorRunner(std::move(CtorNames),
     328           0 :                                                       RetKey);
     329             :     if (auto Err = CtorRunner.runViaLayer(*this))
     330             :       return mapError(std::move(Err));
     331           3 : 
     332           6 :     IRStaticDestructorRunners.emplace_back(std::move(DtorNames), RetKey);
     333             : 
     334           6 :     return LLVMOrcErrSuccess;
     335           0 :   }
     336             : 
     337           3 :   LLVMOrcErrorCode addIRModuleEager(orc::VModuleKey &RetKey,
     338             :                                     std::unique_ptr<Module> M,
     339             :                                     LLVMOrcSymbolResolverFn ExternalResolver,
     340             :                                     void *ExternalResolverCtx) {
     341           3 :     return addIRModule(RetKey, CompileLayer, std::move(M),
     342             :                        llvm::make_unique<SectionMemoryManager>(),
     343           6 :                        std::move(ExternalResolver), ExternalResolverCtx);
     344           0 :   }
     345             : 
     346           3 :   LLVMOrcErrorCode addIRModuleLazy(orc::VModuleKey &RetKey,
     347             :                                    std::unique_ptr<Module> M,
     348           3 :                                    LLVMOrcSymbolResolverFn ExternalResolver,
     349             :                                    void *ExternalResolverCtx) {
     350           1 :     return addIRModule(RetKey, CODLayer, std::move(M),
     351             :                        llvm::make_unique<SectionMemoryManager>(),
     352             :                        std::move(ExternalResolver), ExternalResolverCtx);
     353             :   }
     354             : 
     355             :   LLVMOrcErrorCode removeModule(orc::VModuleKey K) {
     356           1 :     // FIXME: Should error release the module key?
     357           1 :     if (auto Err = KeyLayers[K]->removeModule(K))
     358             :       return mapError(std::move(Err));
     359             :     ES.releaseVModule(K);
     360             :     KeyLayers.erase(K);
     361           1 :     return LLVMOrcErrSuccess;
     362           1 :   }
     363           0 : 
     364           1 :   LLVMOrcErrorCode addObject(orc::VModuleKey &RetKey,
     365           0 :                              std::unique_ptr<MemoryBuffer> ObjBuffer,
     366             :                              LLVMOrcSymbolResolverFn ExternalResolver,
     367             :                              void *ExternalResolverCtx) {
     368           1 :     if (auto Obj = object::ObjectFile::createObjectFile(
     369           2 :             ObjBuffer->getMemBufferRef())) {
     370             : 
     371           2 :       RetKey = ES.allocateVModule();
     372           0 :       Resolvers[RetKey] = std::make_shared<CBindingsResolver>(
     373             :           *this, ExternalResolver, ExternalResolverCtx);
     374           1 : 
     375             :       if (auto Err = ObjectLayer.addObject(RetKey, std::move(ObjBuffer)))
     376             :         return mapError(std::move(Err));
     377             : 
     378           1 :       KeyLayers[RetKey] = detail::createGenericLayer(ObjectLayer);
     379             : 
     380           2 :       return LLVMOrcErrSuccess;
     381           0 :     } else
     382             :       return mapError(Obj.takeError());
     383           1 :   }
     384             : 
     385           1 :   JITSymbol findSymbol(const std::string &Name,
     386             :                                  bool ExportedSymbolsOnly) {
     387           2 :     if (auto Sym = IndirectStubsMgr->findStub(Name, ExportedSymbolsOnly))
     388             :       return Sym;
     389             :     return CODLayer.findSymbol(mangle(Name), ExportedSymbolsOnly);
     390             :   }
     391             : 
     392             :   JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
     393           2 :                          bool ExportedSymbolsOnly) {
     394           2 :     assert(KeyLayers.count(K) && "looking up symbol in unknown module");
     395             :     return KeyLayers[K]->findSymbolIn(K, mangle(Name), ExportedSymbolsOnly);
     396             :   }
     397             : 
     398           2 :   LLVMOrcErrorCode findSymbolAddress(JITTargetAddress &RetAddr,
     399           2 :                                      const std::string &Name,
     400           0 :                                      bool ExportedSymbolsOnly) {
     401           2 :     RetAddr = 0;
     402           0 :     if (auto Sym = findSymbol(Name, ExportedSymbolsOnly)) {
     403             :       // Successful lookup, non-null symbol:
     404             :       if (auto AddrOrErr = Sym.getAddress()) {
     405           2 :         RetAddr = *AddrOrErr;
     406           4 :         return LLVMOrcErrSuccess;
     407             :       } else
     408           4 :         return mapError(AddrOrErr.takeError());
     409           0 :     } else if (auto Err = Sym.takeError()) {
     410             :       // Lookup failure - report error.
     411           2 :       return mapError(std::move(Err));
     412             :     }
     413             :     // Otherwise we had a successful lookup but got a null result. We already
     414             :     // set RetAddr to '0' above, so just return success.
     415           2 :     return LLVMOrcErrSuccess;
     416             :   }
     417           4 : 
     418           0 :   LLVMOrcErrorCode findSymbolAddressIn(JITTargetAddress &RetAddr,
     419             :                                        orc::VModuleKey K,
     420           2 :                                        const std::string &Name,
     421             :                                        bool ExportedSymbolsOnly) {
     422           2 :     RetAddr = 0;
     423             :     if (auto Sym = findSymbolIn(K, Name, ExportedSymbolsOnly)) {
     424             :       // Successful lookup, non-null symbol:
     425           2 :       if (auto AddrOrErr = Sym.getAddress()) {
     426             :         RetAddr = *AddrOrErr;
     427             :         return LLVMOrcErrSuccess;
     428             :       } else
     429           4 :         return mapError(AddrOrErr.takeError());
     430           2 :     } else if (auto Err = Sym.takeError()) {
     431           2 :       // Lookup failure - report error.
     432             :       return mapError(std::move(Err));
     433             :     }
     434           1 :     // Otherwise we had a successful lookup but got a null result. We already
     435             :     // set RetAddr to '0' above, so just return success.
     436             :     return LLVMOrcErrSuccess;
     437             :   }
     438           2 : 
     439           1 :   const std::string &getErrorMessage() const { return ErrMsg; }
     440           1 : 
     441             :   void RegisterJITEventListener(JITEventListener *L) {
     442             :     if (!L)
     443           4 :       return;
     444             :     EventListeners.push_back(L);
     445           8 :   }
     446           0 : 
     447             :   void UnregisterJITEventListener(JITEventListener *L) {
     448             :     if (!L)
     449           4 :       return;
     450             : 
     451             :     auto I = find(reverse(EventListeners), L);
     452           1 :     if (I != EventListeners.rend()) {
     453             :       std::swap(*I, EventListeners.back());
     454             :       EventListeners.pop_back();
     455             :     }
     456           1 :   }
     457           3 : 
     458             : private:
     459           1 : 
     460           1 :   LLVMOrcErrorCode mapError(Error Err) {
     461             :     LLVMOrcErrorCode Result = LLVMOrcErrSuccess;
     462             :     handleAllErrors(std::move(Err), [&](ErrorInfoBase &EIB) {
     463           3 :       // Handler of last resort.
     464           0 :       Result = LLVMOrcErrGeneric;
     465             :       ErrMsg = "";
     466           1 :       raw_string_ostream ErrStream(ErrMsg);
     467             :       EIB.log(ErrStream);
     468           1 :     });
     469             :     return Result;
     470           0 :   }
     471             : 
     472             :   void reportError(Error Err) {
     473           5 :     // FIXME: Report errors on the execution session.
     474             :     logAllUnhandledErrors(std::move(Err), errs(), "ORC error: ");
     475          10 :   };
     476           1 : 
     477           8 :   void notifyFinalized(orc::VModuleKey K,
     478             :                        const object::ObjectFile &Obj,
     479             :                        const RuntimeDyld::LoadedObjectInfo &LoadedObjInfo) {
     480           1 :     for (auto &Listener : EventListeners)
     481             :       Listener->NotifyObjectEmitted(Obj, LoadedObjInfo);
     482             :   }
     483           1 : 
     484             :   void notifyFreed(orc::VModuleKey K, const object::ObjectFile &Obj) {
     485             :     for (auto &Listener : EventListeners)
     486           5 :       Listener->NotifyFreeingObject(Obj);
     487             :   }
     488             : 
     489           5 :   orc::ExecutionSession ES;
     490           5 :   std::unique_ptr<CompileCallbackMgr> CCMgr;
     491             : 
     492           5 :   std::vector<JITEventListener *> EventListeners;
     493           5 : 
     494           5 :   DataLayout DL;
     495             :   SectionMemoryManager CCMgrMemMgr;
     496           0 : 
     497           0 :   std::unique_ptr<orc::IndirectStubsManager> IndirectStubsMgr;
     498             : 
     499           0 :   ObjLayerT ObjectLayer;
     500             :   CompileLayerT CompileLayer;
     501             :   CODLayerT CODLayer;
     502             : 
     503           0 :   std::map<orc::VModuleKey, std::unique_ptr<detail::GenericLayer>> KeyLayers;
     504             : 
     505             :   orc::LocalCXXRuntimeOverrides CXXRuntimeOverrides;
     506           1 :   std::vector<orc::CtorDtorRunner<OrcCBindingsStack>> IRStaticDestructorRunners;
     507             :   std::string ErrMsg;
     508             : 
     509             :   std::map<orc::VModuleKey, std::shared_ptr<orc::SymbolResolver>> Resolvers;
     510           1 : };
     511           1 : 
     512             : } // end namespace llvm
     513           1 : 
     514           1 : #endif // LLVM_LIB_EXECUTIONENGINE_ORC_ORCCBINDINGSSTACK_H

Generated by: LCOV version 1.13