Lines Matching +full:class +full:- +full:dg
1 //===--------------- OrcV2CBindings.cpp - C bindings OrcV2 APIs -----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm-c/LLJIT.h"
10 #include "llvm-c/Orc.h"
11 #include "llvm-c/OrcEE.h"
12 #include "llvm-c/TargetMachine.h"
26 class InProgressLookupState;
28 class OrcV2CAPIHelper {
81 class OrcCAPIMaterializationUnit : public llvm::orc::MaterializationUnit {
259 class CAPIDefinitionGenerator final : public DefinitionGenerator {
318 unwrap(ES)->setErrorReporter( in LLVMOrcExecutionSessionSetErrorReporter()
325 unwrap(ES)->getExecutorProcessControl().getSymbolStringPool().get()); in LLVMOrcExecutionSessionGetSymbolStringPool()
329 unwrap(SSP)->clearDeadEntries(); in LLVMOrcSymbolStringPoolClearDeadEntries()
334 return wrap(SymbolStringPoolEntryUnsafe::take(unwrap(ES)->intern(Name))); in LLVMOrcExecutionSessionIntern()
357 unwrap(ES)->lookup( in LLVMOrcExecutionSessionLookup()
382 return unwrap(S).rawPtr()->getKey().data(); in LLVMOrcSymbolStringPoolEntryStr()
387 auto RT = unwrap(JD)->createResourceTracker(); in LLVMOrcJITDylibCreateResourceTracker()
389 RT->Retain(); in LLVMOrcJITDylibCreateResourceTracker()
395 auto RT = unwrap(JD)->getDefaultResourceTracker(); in LLVMOrcJITDylibGetDefaultResourceTracker()
402 TmpRT->Release(); in LLVMOrcReleaseResourceTracker()
408 TmpRT->transferTo(*unwrap(DstRT)); in LLVMOrcResourceTrackerTransferTo()
413 return wrap(TmpRT->remove()); in LLVMOrcResourceTrackerRemove()
416 void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG) { in LLVMOrcDisposeDefinitionGenerator() argument
417 std::unique_ptr<DefinitionGenerator> TmpDG(unwrap(DG)); in LLVMOrcDisposeDefinitionGenerator()
473 return wrap(&unwrap(MR)->getTargetJITDylib()); in LLVMOrcMaterializationResponsibilityGetTargetDylib()
479 return wrap(&unwrap(MR)->getExecutionSession()); in LLVMOrcMaterializationResponsibilityGetExecutionSession()
485 auto Symbols = unwrap(MR)->getSymbols(); in LLVMOrcMaterializationResponsibilityGetSymbols()
506 auto Sym = unwrap(MR)->getInitializerSymbol(); in LLVMOrcMaterializationResponsibilityGetInitializerSymbol()
514 auto Symbols = unwrap(MR)->getRequestedSymbols(); in LLVMOrcMaterializationResponsibilityGetRequestedSymbols()
535 return wrap(unwrap(MR)->notifyResolved(std::move(SM))); in LLVMOrcMaterializationResponsibilityNotifyResolved()
550 return wrap(unwrap(MR)->notifyEmitted(SDGs)); in LLVMOrcMaterializationResponsibilityNotifyEmitted()
561 return wrap(unwrap(MR)->defineMaterializing(std::move(SFM))); in LLVMOrcMaterializationResponsibilityDefineMaterializing()
568 return wrap(unwrap(MR)->replace(std::move(TmpMU))); in LLVMOrcMaterializationResponsibilityReplace()
579 auto OtherMR = unwrap(MR)->delegate(Syms); in LLVMOrcMaterializationResponsibilityDelegate()
584 *Result = wrap(OtherMR->release()); in LLVMOrcMaterializationResponsibilityDelegate()
590 unwrap(MR)->failMaterialization(); in LLVMOrcMaterializationResponsibilityFailMaterialization()
597 unwrap(IRLayer)->emit( in LLVMOrcIRTransformLayerEmit()
605 return wrap(&unwrap(ES)->createBareJITDylib(Name)); in LLVMOrcExecutionSessionCreateBareJITDylib()
612 auto JD = unwrap(ES)->createJITDylib(Name); in LLVMOrcExecutionSessionCreateJITDylib()
622 return wrap(unwrap(ES)->getJITDylibByName(Name)); in LLVMOrcExecutionSessionGetJITDylibByName()
629 if (auto Err = unwrap(JD)->define(TmpMU)) { in LLVMOrcJITDylibDefine()
637 return wrap(unwrap(JD)->clear()); in LLVMOrcJITDylibClear()
641 LLVMOrcDefinitionGeneratorRef DG) { in LLVMOrcJITDylibAddGenerator() argument
642 unwrap(JD)->addGenerator(std::unique_ptr<DefinitionGenerator>(unwrap(DG))); in LLVMOrcJITDylibAddGenerator()
648 auto DG = std::make_unique<CAPIDefinitionGenerator>(Dispose, Ctx, F); in LLVMOrcCreateCustomCAPIDefinitionGenerator() local
649 return wrap(DG.release()); in LLVMOrcCreateCustomCAPIDefinitionGenerator()
668 Pred = [=](const SymbolStringPtr &Name) -> bool { in LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess()
680 *Result = wrap(ProcessSymsGenerator->release()); in LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess()
694 Pred = [=](const SymbolStringPtr &Name) -> bool { in LLVMOrcCreateDynamicLibrarySearchGeneratorForPath()
706 *Result = wrap(LibrarySymsGenerator->release()); in LLVMOrcCreateDynamicLibrarySearchGeneratorForPath()
723 *Result = wrap(LibrarySymsGenerator->release()); in LLVMOrcCreateStaticLibrarySearchGeneratorForPath()
733 return wrap(unwrap(TSCtx)->getContext()); in LLVMOrcThreadSafeContextGetContext()
744 return wrap(unwrap(TSM)->withModuleDo( in LLVMOrcThreadSafeModuleWithModuleDo()
778 std::make_unique<JITTargetMachineBuilder>(TemplateTM->getTargetTriple()); in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
781 .setCPU(TemplateTM->getTargetCPU().str()) in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
782 .setRelocationModel(TemplateTM->getRelocationModel()) in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
783 .setCodeModel(TemplateTM->getCodeModel()) in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
784 .setCodeGenOptLevel(TemplateTM->getOptLevel()) in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
785 .setFeatures(TemplateTM->getTargetFeatureString()) in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
786 .setOptions(TemplateTM->Options); in LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()
800 auto Tmp = unwrap(JTMB)->getTargetTriple().str(); in LLVMOrcJITTargetMachineBuilderGetTargetTriple()
808 unwrap(JTMB)->getTargetTriple() = Triple(TargetTriple); in LLVMOrcJITTargetMachineBuilderSetTargetTriple()
814 return wrap(unwrap(ObjLayer)->add( in LLVMOrcObjectLayerAddObjectFile()
822 unwrap(ObjLayer)->add(ResourceTrackerSP(unwrap(RT)), in LLVMOrcObjectLayerAddObjectFileWithRT()
829 unwrap(ObjLayer)->emit( in LLVMOrcObjectLayerEmit()
842 ->setTransform( in LLVMOrcIRTransformLayerSetTransform()
844 MaterializationResponsibility &R) -> Expected<ThreadSafeModule> { in LLVMOrcIRTransformLayerSetTransform()
862 ->setTransform([TransformFunction, Ctx](std::unique_ptr<MemoryBuffer> Obj) in LLVMOrcObjectTransformLayerSetTransform()
863 -> Expected<std::unique_ptr<MemoryBuffer>> { in LLVMOrcObjectTransformLayerSetTransform()
888 *ObjBuffer = wrap(Result->release()); in LLVMOrcDumpObjects_CallOperator()
906 unwrap(Builder)->setJITTargetMachineBuilder(std::move(*unwrap(JTMB))); in LLVMOrcLLJITBuilderSetJITTargetMachineBuilder()
913 unwrap(Builder)->setObjectLinkingLayerCreator( in LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator()
928 auto J = unwrap(Builder)->create(); in LLVMOrcCreateLLJIT()
936 *Result = wrap(J->release()); in LLVMOrcCreateLLJIT()
946 return wrap(&unwrap(J)->getExecutionSession()); in LLVMOrcLLJITGetExecutionSession()
950 return wrap(&unwrap(J)->getMainJITDylib()); in LLVMOrcLLJITGetMainJITDylib()
954 return unwrap(J)->getTargetTriple().str().c_str(); in LLVMOrcLLJITGetTripleString()
958 return unwrap(J)->getDataLayout().getGlobalPrefix(); in LLVMOrcLLJITGetGlobalPrefix()
964 unwrap(J)->mangleAndIntern(UnmangledName))); in LLVMOrcLLJITMangleAndIntern()
969 return wrap(unwrap(J)->addObjectFile( in LLVMOrcLLJITAddObjectFile()
976 return wrap(unwrap(J)->addObjectFile( in LLVMOrcLLJITAddObjectFileWithRT()
985 return wrap(unwrap(J)->addIRModule(*unwrap(JD), std::move(*TmpTSM))); in LLVMOrcLLJITAddLLVMIRModule()
992 return wrap(unwrap(J)->addIRModule(ResourceTrackerSP(unwrap(RT)), in LLVMOrcLLJITAddLLVMIRModuleWithRT()
1001 auto Sym = unwrap(J)->lookup(Name); in LLVMOrcLLJITLookup()
1007 *Result = Sym->getValue(); in LLVMOrcLLJITLookup()
1012 return wrap(&unwrap(J)->getObjLinkingLayer()); in LLVMOrcLLJITGetObjLinkingLayer()
1017 return wrap(&unwrap(J)->getObjTransformLayer()); in LLVMOrcLLJITGetObjTransformLayer()
1078 class MCJITMemoryManagerLikeCallbacksMemMgr : public RTDyldMemoryManager { in LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks()
1144 ->registerJITEventListener(*unwrap(Listener)); in LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener()
1148 return wrap(&unwrap(J)->getIRTransformLayer()); in LLVMOrcLLJITGetIRTransformLayer()
1152 return unwrap(J)->getDataLayout().getStringRepresentation().c_str(); in LLVMOrcLLJITGetDataLayoutStr()
1174 *Result = wrap(LCTM->release()); in LLVMOrcCreateLocalLazyCallThroughManager()