LLVM 17.0.0git
OrcV2CBindings.cpp
Go to the documentation of this file.
1//===--------------- OrcV2CBindings.cpp - C bindings OrcV2 APIs -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "llvm-c/LLJIT.h"
10#include "llvm-c/Orc.h"
11#include "llvm-c/OrcEE.h"
13
19
20using namespace llvm;
21using namespace llvm::orc;
22
23namespace llvm {
24namespace orc {
25
27
29public:
32
33 // Move from SymbolStringPtr to PoolEntryPtr (no change in ref count).
35 PoolEntryPtr Result = nullptr;
36 std::swap(Result, S.S);
37 return Result;
38 }
39
40 // Move from a PoolEntryPtr to a SymbolStringPtr (no change in ref count).
43 S.S = P;
44 return S;
45 }
46
47 // Copy a pool entry to a SymbolStringPtr (increments ref count).
49 return SymbolStringPtr(P);
50 }
51
53 return S.S;
54 }
55
58 S.S = nullptr;
59 }
60
63 S.S = P;
64 }
65
67 return LS.IPLS.release();
68 }
69
71 return LS.reset(IPLS);
72 }
73};
74
75} // namespace orc
76} // namespace llvm
77
108
109namespace {
110
111class OrcCAPIMaterializationUnit : public llvm::orc::MaterializationUnit {
112public:
113 OrcCAPIMaterializationUnit(
114 std::string Name, SymbolFlagsMap InitialSymbolFlags,
115 SymbolStringPtr InitSymbol, void *Ctx,
120 Interface(std::move(InitialSymbolFlags), std::move(InitSymbol))),
121 Name(std::move(Name)), Ctx(Ctx), Materialize(Materialize),
122 Discard(Discard), Destroy(Destroy) {}
123
124 ~OrcCAPIMaterializationUnit() {
125 if (Ctx)
126 Destroy(Ctx);
127 }
128
129 StringRef getName() const override { return Name; }
130
131 void materialize(std::unique_ptr<MaterializationResponsibility> R) override {
132 void *Tmp = Ctx;
133 Ctx = nullptr;
134 Materialize(Tmp, wrap(R.release()));
135 }
136
137private:
138 void discard(const JITDylib &JD, const SymbolStringPtr &Name) override {
140 }
141
142 std::string Name;
143 void *Ctx = nullptr;
147};
148
149static JITSymbolFlags toJITSymbolFlags(LLVMJITSymbolFlags F) {
150
151 JITSymbolFlags JSF;
152
153 if (F.GenericFlags & LLVMJITSymbolGenericFlagsExported)
155 if (F.GenericFlags & LLVMJITSymbolGenericFlagsWeak)
157 if (F.GenericFlags & LLVMJITSymbolGenericFlagsCallable)
161
162 JSF.getTargetFlags() = F.TargetFlags;
163
164 return JSF;
165}
166
167static LLVMJITSymbolFlags fromJITSymbolFlags(JITSymbolFlags JSF) {
168 LLVMJITSymbolFlags F = {0, 0};
169 if (JSF & JITSymbolFlags::Exported)
170 F.GenericFlags |= LLVMJITSymbolGenericFlagsExported;
171 if (JSF & JITSymbolFlags::Weak)
172 F.GenericFlags |= LLVMJITSymbolGenericFlagsWeak;
173 if (JSF & JITSymbolFlags::Callable)
174 F.GenericFlags |= LLVMJITSymbolGenericFlagsCallable;
177
178 F.TargetFlags = JSF.getTargetFlags();
179
180 return F;
181}
182
183static SymbolMap toSymbolMap(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs) {
184 SymbolMap SM;
185 for (size_t I = 0; I != NumPairs; ++I) {
186 JITSymbolFlags Flags = toJITSymbolFlags(Syms[I].Sym.Flags);
188 ExecutorAddr(Syms[I].Sym.Address), Flags};
189 }
190 return SM;
191}
192
194toSymbolDependenceMap(LLVMOrcCDependenceMapPairs Pairs, size_t NumPairs) {
196 for (size_t I = 0; I != NumPairs; ++I) {
197 JITDylib *JD = unwrap(Pairs[I].JD);
199
200 for (size_t J = 0; J != Pairs[I].Names.Length; ++J) {
201 auto Sym = Pairs[I].Names.Symbols[J];
203 }
204 SDM[JD] = Names;
205 }
206 return SDM;
207}
208
209static LookupKind toLookupKind(LLVMOrcLookupKind K) {
210 switch (K) {
212 return LookupKind::Static;
214 return LookupKind::DLSym;
215 }
216 llvm_unreachable("unrecognized LLVMOrcLookupKind value");
217}
218
219static LLVMOrcLookupKind fromLookupKind(LookupKind K) {
220 switch (K) {
221 case LookupKind::Static:
223 case LookupKind::DLSym:
225 }
226 llvm_unreachable("unrecognized LookupKind value");
227}
228
230toJITDylibLookupFlags(LLVMOrcJITDylibLookupFlags LF) {
231 switch (LF) {
233 return JITDylibLookupFlags::MatchExportedSymbolsOnly;
235 return JITDylibLookupFlags::MatchAllSymbols;
236 }
237 llvm_unreachable("unrecognized LLVMOrcJITDylibLookupFlags value");
238}
239
241fromJITDylibLookupFlags(JITDylibLookupFlags LF) {
242 switch (LF) {
243 case JITDylibLookupFlags::MatchExportedSymbolsOnly:
245 case JITDylibLookupFlags::MatchAllSymbols:
247 }
248 llvm_unreachable("unrecognized JITDylibLookupFlags value");
249}
250
251static SymbolLookupFlags toSymbolLookupFlags(LLVMOrcSymbolLookupFlags SLF) {
252 switch (SLF) {
254 return SymbolLookupFlags::RequiredSymbol;
256 return SymbolLookupFlags::WeaklyReferencedSymbol;
257 }
258 llvm_unreachable("unrecognized LLVMOrcSymbolLookupFlags value");
259}
260
261static LLVMOrcSymbolLookupFlags fromSymbolLookupFlags(SymbolLookupFlags SLF) {
262 switch (SLF) {
263 case SymbolLookupFlags::RequiredSymbol:
265 case SymbolLookupFlags::WeaklyReferencedSymbol:
267 }
268 llvm_unreachable("unrecognized SymbolLookupFlags value");
269}
270
272fromExecutorSymbolDef(const ExecutorSymbolDef &S) {
273 return {S.getAddress().getValue(), fromJITSymbolFlags(S.getFlags())};
274}
275
276} // end anonymous namespace
277
278namespace llvm {
279namespace orc {
280
282public:
286 : Dispose(Dispose), Ctx(Ctx), TryToGenerate(TryToGenerate) {}
287
289 if (Dispose)
290 Dispose(Ctx);
291 }
292
294 JITDylibLookupFlags JDLookupFlags,
295 const SymbolLookupSet &LookupSet) override {
296
297 // Take the lookup state.
299
300 // Translate the lookup kind.
301 LLVMOrcLookupKind CLookupKind = fromLookupKind(K);
302
303 // Translate the JITDylibLookupFlags.
304 LLVMOrcJITDylibLookupFlags CJDLookupFlags =
305 fromJITDylibLookupFlags(JDLookupFlags);
306
307 // Translate the lookup set.
308 std::vector<LLVMOrcCLookupSetElement> CLookupSet;
309 CLookupSet.reserve(LookupSet.size());
310 for (auto &KV : LookupSet) {
313 LLVMOrcSymbolLookupFlags SLF = fromSymbolLookupFlags(KV.second);
314 CLookupSet.push_back({Name, SLF});
315 }
316
317 // Run the C TryToGenerate function.
318 auto Err = unwrap(TryToGenerate(::wrap(this), Ctx, &LSR, CLookupKind,
319 ::wrap(&JD), CJDLookupFlags,
320 CLookupSet.data(), CLookupSet.size()));
321
322 // Restore the lookup state.
324
325 return Err;
326 }
327
328private:
330 void *Ctx;
332};
333
334} // end namespace orc
335} // end namespace llvm
336
339 void *Ctx) {
340 unwrap(ES)->setErrorReporter(
341 [=](Error Err) { ReportError(Ctx, wrap(std::move(Err))); });
342}
343
346 return wrap(
347 unwrap(ES)->getExecutorProcessControl().getSymbolStringPool().get());
348}
349
351 unwrap(SSP)->clearDeadEntries();
352}
353
356 return wrap(
358}
359
362 LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize,
363 LLVMOrcCLookupSet Symbols, size_t SymbolsSize,
365 assert(ES && "ES cannot be null");
366 assert(SearchOrder && "SearchOrder cannot be null");
367 assert(Symbols && "Symbols cannot be null");
368 assert(HandleResult && "HandleResult cannot be null");
369
371 for (size_t I = 0; I != SearchOrderSize; ++I)
372 SO.push_back({unwrap(SearchOrder[I].JD),
373 toJITDylibLookupFlags(SearchOrder[I].JDLookupFlags)});
374
375 SymbolLookupSet SLS;
376 for (size_t I = 0; I != SymbolsSize; ++I)
378 toSymbolLookupFlags(Symbols[I].LookupFlags));
379
380 unwrap(ES)->lookup(
381 toLookupKind(K), SO, std::move(SLS), SymbolState::Ready,
382 [HandleResult, Ctx](Expected<SymbolMap> Result) {
383 if (Result) {
385 for (auto &KV : *Result)
387 wrap(OrcV2CAPIHelper::getRawPoolEntryPtr(KV.first)),
388 fromExecutorSymbolDef(KV.second)});
389 HandleResult(LLVMErrorSuccess, CResult.data(), CResult.size(), Ctx);
390 } else
391 HandleResult(wrap(Result.takeError()), nullptr, 0, Ctx);
392 },
394}
395
398}
399
402}
403
405 return unwrap(S)->getKey().data();
406}
407
410 auto RT = unwrap(JD)->createResourceTracker();
411 // Retain the pointer for the C API client.
412 RT->Retain();
413 return wrap(RT.get());
414}
415
418 auto RT = unwrap(JD)->getDefaultResourceTracker();
419 // Retain the pointer for the C API client.
420 return wrap(RT.get());
421}
422
424 ResourceTrackerSP TmpRT(unwrap(RT));
425 TmpRT->Release();
426}
427
430 ResourceTrackerSP TmpRT(unwrap(SrcRT));
431 TmpRT->transferTo(*unwrap(DstRT));
432}
433
435 ResourceTrackerSP TmpRT(unwrap(RT));
436 return wrap(TmpRT->remove());
437}
438
440 std::unique_ptr<DefinitionGenerator> TmpDG(unwrap(DG));
441}
442
444 std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
445}
446
448 const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,
449 size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,
453 SymbolFlagsMap SFM;
454 for (size_t I = 0; I != NumSyms; ++I)
456 toJITSymbolFlags(Syms[I].Flags);
457
459
460 return wrap(new OrcCAPIMaterializationUnit(
461 Name, std::move(SFM), std::move(IS), Ctx, Materialize, Discard, Destroy));
462}
463
466 SymbolMap SM = toSymbolMap(Syms, NumPairs);
467 return wrap(absoluteSymbols(std::move(SM)).release());
468}
469
472 LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases,
473 size_t NumPairs) {
474
475 SymbolAliasMap SAM;
476 for (size_t I = 0; I != NumPairs; ++I) {
477 auto pair = CallableAliases[I];
478 JITSymbolFlags Flags = toJITSymbolFlags(pair.Entry.Flags);
483 }
484
485 return wrap(lazyReexports(*unwrap(LCTM), *unwrap(ISM), *unwrap(SourceJD),
486 std::move(SAM))
487 .release());
488}
489
492 std::unique_ptr<MaterializationResponsibility> TmpMR(unwrap(MR));
493}
494
497 return wrap(&unwrap(MR)->getTargetJITDylib());
498}
499
503 return wrap(&unwrap(MR)->getExecutionSession());
504}
505
507 LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs) {
508
509 auto Symbols = unwrap(MR)->getSymbols();
511 safe_malloc(Symbols.size() * sizeof(LLVMOrcCSymbolFlagsMapPair)));
512 size_t I = 0;
513 for (auto const &pair : Symbols) {
515 auto Flags = pair.second;
516 Result[I] = {Name, fromJITSymbolFlags(Flags)};
517 I++;
518 }
519 *NumPairs = Symbols.size();
520 return Result;
521}
522
524 free(Pairs);
525}
526
530 auto Sym = unwrap(MR)->getInitializerSymbol();
532}
533
536 LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols) {
537
538 auto Symbols = unwrap(MR)->getRequestedSymbols();
541 Symbols.size() * sizeof(LLVMOrcSymbolStringPoolEntryRef)));
542 size_t I = 0;
543 for (auto &Name : Symbols) {
545 I++;
546 }
547 *NumSymbols = Symbols.size();
548 return Result;
549}
550
552 free(Symbols);
553}
554
557 size_t NumPairs) {
558 SymbolMap SM = toSymbolMap(Symbols, NumPairs);
559 return wrap(unwrap(MR)->notifyResolved(std::move(SM)));
560}
561
564 return wrap(unwrap(MR)->notifyEmitted());
565}
566
569 LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms) {
570 SymbolFlagsMap SFM;
571 for (size_t I = 0; I != NumSyms; ++I)
573 toJITSymbolFlags(Syms[I].Flags);
574
575 return wrap(unwrap(MR)->defineMaterializing(std::move(SFM)));
576}
577
581 std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
582 return wrap(unwrap(MR)->replace(std::move(TmpMU)));
583}
584
587 LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,
589 SymbolNameSet Syms;
590 for (size_t I = 0; I != NumSymbols; I++) {
592 }
593 auto OtherMR = unwrap(MR)->delegate(Syms);
594
595 if (!OtherMR) {
596 return wrap(OtherMR.takeError());
597 }
598 *Result = wrap(OtherMR->release());
599 return LLVMErrorSuccess;
600}
601
605 LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs) {
606
607 SymbolDependenceMap SDM = toSymbolDependenceMap(Dependencies, NumPairs);
609 unwrap(MR)->addDependencies(Sym, SDM);
610}
611
614 LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs) {
615
616 SymbolDependenceMap SDM = toSymbolDependenceMap(Dependencies, NumPairs);
617 unwrap(MR)->addDependenciesForAll(SDM);
618}
619
622 unwrap(MR)->failMaterialization();
623}
624
628 std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
629 unwrap(IRLayer)->emit(
630 std::unique_ptr<MaterializationResponsibility>(unwrap(MR)),
631 std::move(*TmpTSM));
632}
633
636 const char *Name) {
637 return wrap(&unwrap(ES)->createBareJITDylib(Name));
638}
639
643 const char *Name) {
644 auto JD = unwrap(ES)->createJITDylib(Name);
645 if (!JD)
646 return wrap(JD.takeError());
647 *Result = wrap(&*JD);
648 return LLVMErrorSuccess;
649}
650
653 const char *Name) {
654 return wrap(unwrap(ES)->getJITDylibByName(Name));
655}
656
659 std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
660
661 if (auto Err = unwrap(JD)->define(TmpMU)) {
662 TmpMU.release();
663 return wrap(std::move(Err));
664 }
665 return LLVMErrorSuccess;
666}
667
669 return wrap(unwrap(JD)->clear());
670}
671
674 unwrap(JD)->addGenerator(std::unique_ptr<DefinitionGenerator>(unwrap(DG)));
675}
676
680 auto DG = std::make_unique<CAPIDefinitionGenerator>(Dispose, Ctx, F);
681 return wrap(DG.release());
682}
683
685 LLVMErrorRef Err) {
686 LookupState LS;
688 LS.continueLookup(unwrap(Err));
689}
690
693 LLVMOrcSymbolPredicate Filter, void *FilterCtx) {
694 assert(Result && "Result can not be null");
695 assert((Filter || !FilterCtx) &&
696 "if Filter is null then FilterCtx must also be null");
697
699 if (Filter)
700 Pred = [=](const SymbolStringPtr &Name) -> bool {
702 };
703
704 auto ProcessSymsGenerator =
706
707 if (!ProcessSymsGenerator) {
708 *Result = nullptr;
709 return wrap(ProcessSymsGenerator.takeError());
710 }
711
712 *Result = wrap(ProcessSymsGenerator->release());
713 return LLVMErrorSuccess;
714}
715
717 LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,
718 char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx) {
719 assert(Result && "Result can not be null");
720 assert(FileName && "FileName can not be null");
721 assert((Filter || !FilterCtx) &&
722 "if Filter is null then FilterCtx must also be null");
723
725 if (Filter)
726 Pred = [=](const SymbolStringPtr &Name) -> bool {
728 };
729
730 auto LibrarySymsGenerator =
732
733 if (!LibrarySymsGenerator) {
734 *Result = nullptr;
735 return wrap(LibrarySymsGenerator.takeError());
736 }
737
738 *Result = wrap(LibrarySymsGenerator->release());
739 return LLVMErrorSuccess;
740}
741
744 const char *FileName) {
745 assert(Result && "Result can not be null");
746 assert(FileName && "Filename can not be null");
747 assert(ObjLayer && "ObjectLayer can not be null");
748
749 auto LibrarySymsGenerator =
751 if (!LibrarySymsGenerator) {
752 *Result = nullptr;
753 return wrap(LibrarySymsGenerator.takeError());
754 }
755 *Result = wrap(LibrarySymsGenerator->release());
756 return LLVMErrorSuccess;
757}
758
760 return wrap(new ThreadSafeContext(std::make_unique<LLVMContext>()));
761}
762
765 return wrap(unwrap(TSCtx)->getContext());
766}
767
769 delete unwrap(TSCtx);
770}
771
775 void *Ctx) {
776 return wrap(unwrap(TSM)->withModuleDo(
777 [&](Module &M) { return unwrap(F(Ctx, wrap(&M))); }));
778}
779
783 return wrap(
784 new ThreadSafeModule(std::unique_ptr<Module>(unwrap(M)), *unwrap(TSCtx)));
785}
786
788 delete unwrap(TSM);
789}
790
793 assert(Result && "Result can not be null");
794
796 if (!JTMB) {
797 Result = nullptr;
798 return wrap(JTMB.takeError());
799 }
800
801 *Result = wrap(new JITTargetMachineBuilder(std::move(*JTMB)));
802 return LLVMErrorSuccess;
803}
804
807 auto *TemplateTM = unwrap(TM);
808
809 auto JTMB =
810 std::make_unique<JITTargetMachineBuilder>(TemplateTM->getTargetTriple());
811
812 (*JTMB)
813 .setCPU(TemplateTM->getTargetCPU().str())
814 .setRelocationModel(TemplateTM->getRelocationModel())
815 .setCodeModel(TemplateTM->getCodeModel())
816 .setCodeGenOptLevel(TemplateTM->getOptLevel())
817 .setFeatures(TemplateTM->getTargetFeatureString())
818 .setOptions(TemplateTM->Options);
819
821
822 return wrap(JTMB.release());
823}
824
827 delete unwrap(JTMB);
828}
829
832 auto Tmp = unwrap(JTMB)->getTargetTriple().str();
833 char *TargetTriple = (char *)malloc(Tmp.size() + 1);
834 strcpy(TargetTriple, Tmp.c_str());
835 return TargetTriple;
836}
837
839 LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple) {
840 unwrap(JTMB)->getTargetTriple() = Triple(TargetTriple);
841}
842
845 LLVMMemoryBufferRef ObjBuffer) {
846 return wrap(unwrap(ObjLayer)->add(
847 *unwrap(JD), std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
848}
849
852 LLVMMemoryBufferRef ObjBuffer) {
853 return wrap(
854 unwrap(ObjLayer)->add(ResourceTrackerSP(unwrap(RT)),
855 std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
856}
857
860 LLVMMemoryBufferRef ObjBuffer) {
861 unwrap(ObjLayer)->emit(
862 std::unique_ptr<MaterializationResponsibility>(unwrap(R)),
863 std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer)));
864}
865
867 delete unwrap(ObjLayer);
868}
869
872 LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx) {
874 ->setTransform(
875 [=](ThreadSafeModule TSM,
878 wrap(new ThreadSafeModule(std::move(TSM)));
879 if (LLVMErrorRef Err = TransformFunction(Ctx, &TSMRef, wrap(&R))) {
880 assert(!TSMRef && "TSMRef was not reset to null on error");
881 return unwrap(Err);
882 }
883 assert(TSMRef && "Transform succeeded, but TSMRef was set to null");
884 ThreadSafeModule Result = std::move(*unwrap(TSMRef));
886 return std::move(Result);
887 });
888}
889
891 LLVMOrcObjectTransformLayerRef ObjTransformLayer,
892 LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx) {
893 unwrap(ObjTransformLayer)
894 ->setTransform([TransformFunction, Ctx](std::unique_ptr<MemoryBuffer> Obj)
895 -> Expected<std::unique_ptr<MemoryBuffer>> {
896 LLVMMemoryBufferRef ObjBuffer = wrap(Obj.release());
897 if (LLVMErrorRef Err = TransformFunction(Ctx, &ObjBuffer)) {
898 assert(!ObjBuffer && "ObjBuffer was not reset to null on error");
899 return unwrap(Err);
900 }
901 return std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer));
902 });
903}
904
906 const char *IdentifierOverride) {
907 assert(DumpDir && "DumpDir should not be null");
908 assert(IdentifierOverride && "IdentifierOverride should not be null");
909 return wrap(new DumpObjects(DumpDir, IdentifierOverride));
910}
911
913 delete unwrap(DumpObjects);
914}
915
917 LLVMMemoryBufferRef *ObjBuffer) {
918 std::unique_ptr<MemoryBuffer> OB(unwrap(*ObjBuffer));
919 if (auto Result = (*unwrap(DumpObjects))(std::move(OB))) {
920 *ObjBuffer = wrap(Result->release());
921 return LLVMErrorSuccess;
922 } else {
923 *ObjBuffer = nullptr;
924 return wrap(Result.takeError());
925 }
926}
927
929 return wrap(new LLJITBuilder());
930}
931
933 delete unwrap(Builder);
934}
935
938 unwrap(Builder)->setJITTargetMachineBuilder(std::move(*unwrap(JTMB)));
940}
941
945 unwrap(Builder)->setObjectLinkingLayerCreator(
946 [=](ExecutionSession &ES, const Triple &TT) {
947 auto TTStr = TT.str();
948 return std::unique_ptr<ObjectLayer>(
949 unwrap(F(Ctx, wrap(&ES), TTStr.c_str())));
950 });
951}
952
954 LLVMOrcLLJITBuilderRef Builder) {
955 assert(Result && "Result can not be null");
956
957 if (!Builder)
959
960 auto J = unwrap(Builder)->create();
962
963 if (!J) {
964 Result = nullptr;
965 return wrap(J.takeError());
966 }
967
968 *Result = wrap(J->release());
969 return LLVMErrorSuccess;
970}
971
973 delete unwrap(J);
974 return LLVMErrorSuccess;
975}
976
978 return wrap(&unwrap(J)->getExecutionSession());
979}
980
982 return wrap(&unwrap(J)->getMainJITDylib());
983}
984
986 return unwrap(J)->getTargetTriple().str().c_str();
987}
988
990 return unwrap(J)->getDataLayout().getGlobalPrefix();
991}
992
994LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName) {
996 unwrap(J)->mangleAndIntern(UnmangledName)));
997}
998
1000 LLVMMemoryBufferRef ObjBuffer) {
1001 return wrap(unwrap(J)->addObjectFile(
1002 *unwrap(JD), std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
1003}
1004
1007 LLVMMemoryBufferRef ObjBuffer) {
1008 return wrap(unwrap(J)->addObjectFile(
1010 std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
1011}
1012
1016 std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
1017 return wrap(unwrap(J)->addIRModule(*unwrap(JD), std::move(*TmpTSM)));
1018}
1019
1023 std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
1024 return wrap(unwrap(J)->addIRModule(ResourceTrackerSP(unwrap(RT)),
1025 std::move(*TmpTSM)));
1026}
1027
1030 const char *Name) {
1031 assert(Result && "Result can not be null");
1032
1033 auto Sym = unwrap(J)->lookup(Name);
1034 if (!Sym) {
1035 *Result = 0;
1036 return wrap(Sym.takeError());
1037 }
1038
1039 *Result = Sym->getValue();
1040 return LLVMErrorSuccess;
1041}
1042
1044 return wrap(&unwrap(J)->getObjLinkingLayer());
1045}
1046
1049 return wrap(&unwrap(J)->getObjTransformLayer());
1050}
1051
1055 assert(ES && "ES must not be null");
1056 return wrap(new RTDyldObjectLinkingLayer(
1057 *unwrap(ES), [] { return std::make_unique<SectionMemoryManager>(); }));
1058}
1059
1062 LLVMOrcExecutionSessionRef ES, void *CreateContextCtx,
1069
1070 struct MCJITMemoryManagerLikeCallbacks {
1071 MCJITMemoryManagerLikeCallbacks() = default;
1072 MCJITMemoryManagerLikeCallbacks(
1073 void *CreateContextCtx,
1080 : CreateContextCtx(CreateContextCtx), CreateContext(CreateContext),
1081 NotifyTerminating(NotifyTerminating),
1082 AllocateCodeSection(AllocateCodeSection),
1083 AllocateDataSection(AllocateDataSection),
1084 FinalizeMemory(FinalizeMemory), Destroy(Destroy) {}
1085
1086 MCJITMemoryManagerLikeCallbacks(MCJITMemoryManagerLikeCallbacks &&Other) {
1087 std::swap(CreateContextCtx, Other.CreateContextCtx);
1088 std::swap(CreateContext, Other.CreateContext);
1089 std::swap(NotifyTerminating, Other.NotifyTerminating);
1090 std::swap(AllocateCodeSection, Other.AllocateCodeSection);
1091 std::swap(AllocateDataSection, Other.AllocateDataSection);
1092 std::swap(FinalizeMemory, Other.FinalizeMemory);
1093 std::swap(Destroy, Other.Destroy);
1094 }
1095
1096 ~MCJITMemoryManagerLikeCallbacks() {
1097 if (NotifyTerminating)
1098 NotifyTerminating(CreateContextCtx);
1099 }
1100
1101 void *CreateContextCtx = nullptr;
1102 LLVMMemoryManagerCreateContextCallback CreateContext = nullptr;
1103 LLVMMemoryManagerNotifyTerminatingCallback NotifyTerminating = nullptr;
1104 LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection = nullptr;
1105 LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection = nullptr;
1106 LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory = nullptr;
1107 LLVMMemoryManagerDestroyCallback Destroy = nullptr;
1108 };
1109
1110 class MCJITMemoryManagerLikeCallbacksMemMgr : public RTDyldMemoryManager {
1111 public:
1112 MCJITMemoryManagerLikeCallbacksMemMgr(
1113 const MCJITMemoryManagerLikeCallbacks &CBs)
1114 : CBs(CBs) {
1115 Opaque = CBs.CreateContext(CBs.CreateContextCtx);
1116 }
1117 ~MCJITMemoryManagerLikeCallbacksMemMgr() override { CBs.Destroy(Opaque); }
1118
1119 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
1120 unsigned SectionID,
1121 StringRef SectionName) override {
1122 return CBs.AllocateCodeSection(Opaque, Size, Alignment, SectionID,
1123 SectionName.str().c_str());
1124 }
1125
1126 uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
1127 unsigned SectionID, StringRef SectionName,
1128 bool isReadOnly) override {
1129 return CBs.AllocateDataSection(Opaque, Size, Alignment, SectionID,
1130 SectionName.str().c_str(), isReadOnly);
1131 }
1132
1133 bool finalizeMemory(std::string *ErrMsg) override {
1134 char *ErrMsgCString = nullptr;
1135 bool Result = CBs.FinalizeMemory(Opaque, &ErrMsgCString);
1136 assert((Result || !ErrMsgCString) &&
1137 "Did not expect an error message if FinalizeMemory succeeded");
1138 if (ErrMsgCString) {
1139 if (ErrMsg)
1140 *ErrMsg = ErrMsgCString;
1141 free(ErrMsgCString);
1142 }
1143 return Result;
1144 }
1145
1146 private:
1147 const MCJITMemoryManagerLikeCallbacks &CBs;
1148 void *Opaque = nullptr;
1149 };
1150
1151 assert(ES && "ES must not be null");
1152 assert(CreateContext && "CreateContext must not be null");
1153 assert(NotifyTerminating && "NotifyTerminating must not be null");
1154 assert(AllocateCodeSection && "AllocateCodeSection must not be null");
1155 assert(AllocateDataSection && "AllocateDataSection must not be null");
1156 assert(FinalizeMemory && "FinalizeMemory must not be null");
1157 assert(Destroy && "Destroy must not be null");
1158
1159 MCJITMemoryManagerLikeCallbacks CBs(
1160 CreateContextCtx, CreateContext, NotifyTerminating, AllocateCodeSection,
1161 AllocateDataSection, FinalizeMemory, Destroy);
1162
1163 return wrap(new RTDyldObjectLinkingLayer(*unwrap(ES), [CBs = std::move(CBs)] {
1164 return std::make_unique<MCJITMemoryManagerLikeCallbacksMemMgr>(CBs);
1165 }));
1166
1167 return nullptr;
1168}
1169
1171 LLVMOrcObjectLayerRef RTDyldObjLinkingLayer,
1172 LLVMJITEventListenerRef Listener) {
1173 assert(RTDyldObjLinkingLayer && "RTDyldObjLinkingLayer must not be null");
1174 assert(Listener && "Listener must not be null");
1175 reinterpret_cast<RTDyldObjectLinkingLayer *>(unwrap(RTDyldObjLinkingLayer))
1176 ->registerJITEventListener(*unwrap(Listener));
1177}
1178
1180 return wrap(&unwrap(J)->getIRTransformLayer());
1181}
1182
1184 return unwrap(J)->getDataLayout().getStringRepresentation().c_str();
1185}
1186
1190 return wrap(builder().release());
1191}
1192
1194 std::unique_ptr<IndirectStubsManager> TmpISM(unwrap(ISM));
1195}
1196
1198 const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
1199 LLVMOrcJITTargetAddress ErrorHandlerAddr,
1202 Triple(TargetTriple), *unwrap(ES), ExecutorAddr(ErrorHandlerAddr));
1203
1204 if (!LCTM)
1205 return wrap(LCTM.takeError());
1206 *Result = wrap(LCTM->release());
1207 return LLVMErrorSuccess;
1208}
1209
1212 std::unique_ptr<LazyCallThroughManager> TmpLCM(unwrap(LCM));
1213}
@ GlobalPrefix
Definition: AsmWriter.cpp:351
assume builder
assume Assume Builder
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
static void clear(coro::Shape &Shape)
Definition: Coroutines.cpp:149
std::string Name
uint64_t Size
std::optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1269
Symbol * Sym
Definition: ELF_riscv.cpp:463
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
#define P(N)
LLVM_C_EXTERN_C_BEGIN typedef void *(* LLVMMemoryManagerCreateContextCallback)(void *CtxCtx)
Definition: OrcEE.h:35
void(* LLVMMemoryManagerNotifyTerminatingCallback)(void *CtxCtx)
Definition: OrcEE.h:36
LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer, const char *FileName)
const char LLVMTargetMachineRef TM
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
@ Flags
Definition: TextStubV5.cpp:93
@ Names
Definition: TextStubV5.cpp:106
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
Tagged union holding either a T or a Error.
Definition: Error.h:470
Flags for symbols in the JIT.
Definition: JITSymbol.h:74
TargetFlagsType & getTargetFlags()
Return a reference to the target-specific flags.
Definition: JITSymbol.h:172
@ MaterializationSideEffectsOnly
Definition: JITSymbol.h:87
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
virtual uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0
Allocate a memory block of (at least) the given size suitable for data.
virtual uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0
Allocate a memory block of (at least) the given size suitable for executable code.
virtual bool finalizeMemory(std::string *ErrMsg=nullptr)=0
This method is called when object loading is complete and section page permissions can be applied.
size_t size() const
Definition: SmallVector.h:91
void push_back(const T &Elt)
Definition: SmallVector.h:416
pointer data()
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:289
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1200
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:78
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
std::pair< iterator, bool > insert(const ValueT &V)
Definition: DenseSet.h:206
Error tryToGenerate(LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &LookupSet) override
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
CAPIDefinitionGenerator(LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose, void *Ctx, LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction TryToGenerate)
Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolv...
Definition: Core.h:914
A function object that can be used as an ObjectTransformLayer transform to dump object files to disk ...
Definition: DebugUtils.h:100
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > GetForCurrentProcess(char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process.
std::function< bool(const SymbolStringPtr &)> SymbolPredicate
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > Load(const char *FileName, char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenera...
An ExecutionSession represents a running JIT program.
Definition: Core.h:1364
Represents an address in the executor process.
uint64_t getValue() const
Represents a defining location for a JIT symbol.
const JITSymbolFlags & getFlags() const
const ExecutorAddr & getAddress() const
Interface for layers that accept LLVM IR.
Definition: Layer.h:67
A layer that applies a transform to emitted modules.
Base class for managing collections of named indirect stubs.
Represents a JIT'd dynamic library.
Definition: Core.h:950
A utility class for building TargetMachines for JITs.
static Expected< JITTargetMachineBuilder > detectHost()
Create a JITTargetMachineBuilder for the host system.
Constructs LLJIT instances.
Definition: LLJIT.h:479
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
Definition: LLJIT.h:37
Manages a set of 'lazy call-through' trampolines.
Definition: LazyReexports.h:38
Wraps state for a lookup-in-progress.
Definition: Core.h:889
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition: Core.h:526
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
Definition: Core.h:661
virtual StringRef getName() const =0
Return the name of this materialization unit.
virtual void materialize(std::unique_ptr< MaterializationResponsibility > R)=0
Implementations of this method should materialize all symbols in the materialzation unit,...
Interface for Layers that accept object files.
Definition: Layer.h:133
static PoolEntryPtr getRawPoolEntryPtr(const SymbolStringPtr &S)
static SymbolStringPtr moveToSymbolStringPtr(PoolEntryPtr P)
static void releasePoolEntry(PoolEntryPtr P)
static InProgressLookupState * extractLookupState(LookupState &LS)
static PoolEntryPtr moveFromSymbolStringPtr(SymbolStringPtr S)
static void retainPoolEntry(PoolEntryPtr P)
static void resetLookupState(LookupState &LS, InProgressLookupState *IPLS)
static SymbolStringPtr copyToSymbolStringPtr(PoolEntryPtr P)
API to remove / transfer ownership of JIT resources.
Definition: Core.h:55
void transferTo(ResourceTracker &DstRT)
Transfer all resources associated with this key to the given tracker, which must target the same JITD...
Definition: Core.cpp:56
Error remove()
Remove all resources associated with this key.
Definition: Core.cpp:52
static Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > Load(ObjectLayer &L, const char *FileName, GetObjectFileInterface GetObjFileInterface=GetObjectFileInterface())
Try to create a StaticLibraryDefinitionGenerator from the given path.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
Definition: Core.h:182
UnderlyingVector::size_type size() const
Definition: Core.h:258
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
Definition: Core.h:243
String pool for symbol names used by the JIT.
SymbolStringPool::PoolMapEntry PoolEntry
Pointer to a pooled string representing a symbol name.
An LLVMContext together with an associated mutex that can be used to lock the context to prevent conc...
An LLVM Module together with a shared ThreadSafeContext.
#define LLVMErrorSuccess
Definition: Error.h:28
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:33
LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add a buffer representing an object file to the given JITDylib in the given LLJIT instance.
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT instance.
struct LLVMOrcOpaqueLLJIT * LLVMOrcLLJITRef
A reference to an orc::LLJIT instance.
Definition: LLJIT.h:66
LLVMOrcObjectLayerRef(* LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction)(void *Ctx, LLVMOrcExecutionSessionRef ES, const char *Triple)
A function for constructing an ObjectLinkingLayer instance to be used by an LLJIT instance.
Definition: LLJIT.h:55
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB)
Set the JITTargetMachineBuilder to be used when constructing the LLJIT instance.
LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J)
Dispose of an LLJIT instance.
LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given JITDylib in the given LLJIT instance.
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Add a buffer representing an object file to the given ResourceTracker's JITDylib in the given LLJIT i...
LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName)
Mangles the given string according to the LLJIT instance's DataLayout, then interns the result in the...
LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J)
Return a reference to the Main JITDylib.
struct LLVMOrcOpaqueLLJITBuilder * LLVMOrcLLJITBuilderRef
A reference to an orc::LLJITBuilder instance.
Definition: LLJIT.h:61
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(LLVMOrcLLJITBuilderRef Builder, LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx)
Set an ObjectLinkingLayer creator function for this LLJIT instance.
LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's IR transform layer.
const char * LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J)
Return the target triple for this LLJIT instance.
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void)
Create an LLVMOrcLLJITBuilder.
void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder)
Dispose of an LLVMOrcLLJITBuilderRef.
LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J)
Get a reference to the ExecutionSession for this LLJIT instance.
LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result, LLVMOrcLLJITBuilderRef Builder)
Create an LLJIT instance from an LLJITBuilder.
char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J)
Returns the global prefix character according to the LLJIT's DataLayout.
const char * LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J)
Get the LLJIT instance's default data layout string.
LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J, LLVMOrcJITTargetAddress *Result, const char *Name)
Look up the given symbol in the main JITDylib of the given LLJIT instance.
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(LLVMOrcExecutionSessionRef ES, void *CreateContextCtx, LLVMMemoryManagerCreateContextCallback CreateContext, LLVMMemoryManagerNotifyTerminatingCallback NotifyTerminating, LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, LLVMMemoryManagerDestroyCallback Destroy)
Create a RTDyldObjectLinkingLayer instance using MCJIT-memory-manager-like callbacks.
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(LLVMOrcExecutionSessionRef ES)
Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory managem...
void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(LLVMOrcObjectLayerRef RTDyldObjLinkingLayer, LLVMJITEventListenerRef Listener)
Add the given listener to the given RTDyldObjectLinkingLayer.
uint64_t LLVMOrcJITTargetAddress
Represents an address in the executor process.
Definition: Orc.h:46
void LLVMOrcDisposeMaterializationResponsibility(LLVMOrcMaterializationResponsibilityRef MR)
Disposes of the passed MaterializationResponsibility object.
LLVMErrorRef(* LLVMOrcGenericIRModuleOperationFunction)(void *Ctx, LLVMModuleRef M)
A function for inspecting/mutating IR modules, suitable for use with LLVMOrcThreadSafeModuleWithModul...
Definition: Orc.h:388
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES)
Return a reference to the SymbolStringPool for an ExecutionSession.
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP)
Clear all unreferenced symbol string pool entries.
LLVMOrcLookupKind
Lookup kind.
Definition: Orc.h:190
void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs)
Disposes of the passed LLVMOrcCSymbolFlagsMap.
LLVMOrcSymbolStringPoolEntryRef * LLVMOrcMaterializationResponsibilityGetRequestedSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols)
Returns the names of any symbols covered by this MaterializationResponsibility object that have queri...
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(LLVMOrcMaterializationResponsibilityRef MR)
Returns the target JITDylib that these symbols are being materialized into.
LLVMErrorRef LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer using the given ResourceTracker.
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs)
Returns the symbol flags map for this responsibility instance.
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *Result)
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU)
Dispose of a MaterializationUnit.
LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx)
Apply the given function to the module contained in this ThreadSafeModule.
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
Create a custom MaterializationUnit.
struct LLVMOrcOpaqueObjectTransformLayer * LLVMOrcObjectTransformLayerRef
A reference to an orc::ObjectTransformLayer instance.
Definition: Orc.h:434
LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession(LLVMOrcMaterializationResponsibilityRef MR)
Returns the ExecutionSession for this MaterializationResponsibility.
void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM)
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU)
Transfers responsibility to the given MaterializationUnit for all symbols defined by that Materializa...
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to a newly created resource tracker associated with JD.
LLVMErrorRef(* LLVMOrcObjectTransformLayerTransformFunction)(void *Ctx, LLVMMemoryBufferRef *ObjInOut)
A function for applying transformations to an object file buffer.
Definition: Orc.h:450
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw address...
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
Create a ThreadSafeModule wrapper around the given LLVM module.
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT)
Remove all resources associated with the given tracker.
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer)
Dispose of an ObjectLayer.
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM)
Dispose of a ThreadSafeModule.
void LLVMOrcObjectTransformLayerSetTransform(LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function on an LLVMOrcObjectTransformLayer.
void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to all symbols that the MaterializationResponsibility is responsible for.
struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
A reference to an orc::JITTargetMachineBuilder instance.
Definition: Orc.h:394
void LLVMOrcExecutionSessionLookup(LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K, LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize, LLVMOrcCLookupSet Symbols, size_t SymbolsSize, LLVMOrcExecutionSessionLookupHandleResultFunction HandleResult, void *Ctx)
Look up symbols in an execution session.
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG)
Dispose of a JITDylib::DefinitionGenerator.
void(* LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err)
Error reporter function.
Definition: Orc.h:93
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(LLVMOrcJITTargetMachineBuilderRef *Result)
Create a JITTargetMachineBuilder by detecting the host.
struct LLVMOrcOpaqueMaterializationResponsibility * LLVMOrcMaterializationResponsibilityRef
A reference to a uniquely owned orc::MaterializationResponsibility instance.
Definition: Orc.h:262
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(LLVMOrcMaterializationResponsibilityRef MR)
Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by t...
void(* LLVMOrcDisposeCAPIDefinitionGeneratorFunction)(void *Ctx)
Disposer for a custom generator.
Definition: Orc.h:366
struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
A reference to an orc::ThreadSafeModule instance.
Definition: Orc.h:382
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to the default resource tracker for the given JITDylib.
struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
A reference to an orc::ExecutionSession instance.
Definition: Orc.h:88
LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol(LLVMOrcMaterializationResponsibilityRef MR)
Returns the initialization pseudo-symbol, if any.
struct LLVMOrcOpaqueIndirectStubsManager * LLVMOrcIndirectStubsManagerRef
A reference to an orc::IndirectStubsManager instance.
Definition: Orc.h:456
void(* LLVMOrcExecutionSessionLookupHandleResultFunction)(LLVMErrorRef Err, LLVMOrcCSymbolMapPairs Result, size_t NumPairs, void *Ctx)
Callback type for ExecutionSession lookups.
Definition: Orc.h:536
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, const char *FileName, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect library symbols into the J...
void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S, LLVMErrorRef Err)
Continue a lookup that was suspended in a generator (see LLVMOrcCAPIDefinitionGeneratorTryToGenerateF...
LLVMErrorRef(* LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction)(LLVMOrcDefinitionGeneratorRef GeneratorObj, void *Ctx, LLVMOrcLookupStateRef *LookupState, LLVMOrcLookupKind Kind, LLVMOrcJITDylibRef JD, LLVMOrcJITDylibLookupFlags JDLookupFlags, LLVMOrcCLookupSet LookupSet, size_t LookupSetSize)
A custom generator function.
Definition: Orc.h:354
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT)
Reduces the ref-count of a ResourceTracker.
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx)
Dispose of a ThreadSafeContext.
LLVMErrorRef(* LLVMOrcIRTransformLayerTransformFunction)(void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut, LLVMOrcMaterializationResponsibilityRef MR)
A function for applying transformations as part of an transform layer.
Definition: Orc.h:427
struct LLVMOrcOpaqueSymbolStringPool * LLVMOrcSymbolStringPoolRef
A reference to an orc::SymbolStringPool.
Definition: Orc.h:98
void(* LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx)
A MaterializationUnit destruction callback.
Definition: Orc.h:294
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride)
Create a DumpObjects instance.
struct LLVMOrcOpaqueResourceTracker * LLVMOrcResourceTrackerRef
A reference to an orc::ResourceTracker instance.
Definition: Orc.h:299
void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer)
Emit an object buffer to an ObjectLayer.
void LLVMOrcExecutionSessionSetErrorReporter(LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
Attach a custom error reporter function to the ExecutionSession.
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Increments the ref-count for a SymbolStringPool entry.
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result)
Delegates responsibility for the given symbols to the returned materialization responsibility.
LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer)
Dump the contents of the given MemoryBuffer.
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib.
LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple)
Create a LocalIndirectStubsManager from the given target triple.
void LLVMOrcJITTargetMachineBuilderSetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple)
Sets the target triple for the given JITTargetMachineBuilder to the given string.
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
Add a DefinitionGenerator to the given JITDylib.
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM)
Create a JITTargetMachineBuilder from the given TargetMachine template.
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, const char *Name)
Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
const char * LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S)
Return the c-string for the given symbol.
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
Add the given MaterializationUnit to the given JITDylib.
struct LLVMOrcOpaqueObjectLayer * LLVMOrcObjectLayerRef
A reference to an orc::ObjectLayer instance.
Definition: Orc.h:400
void LLVMOrcMaterializationResponsibilityFailMaterialization(LLVMOrcMaterializationResponsibilityRef MR)
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has o...
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void)
Create a ThreadSafeContext containing a new LLVMContext.
int(* LLVMOrcSymbolPredicate)(void *Ctx, LLVMOrcSymbolStringPoolEntryRef Sym)
Predicate function for SymbolStringPoolEntries.
Definition: Orc.h:371
struct LLVMOrcOpaqueDefinitionGenerator * LLVMOrcDefinitionGeneratorRef
A reference to an orc::DefinitionGenerator.
Definition: Orc.h:304
struct LLVMOrcOpaqueSymbolStringPoolEntry * LLVMOrcSymbolStringPoolEntryRef
A reference to an orc::SymbolStringPool table entry.
Definition: Orc.h:103
struct LLVMOrcOpaqueLazyCallThroughManager * LLVMOrcLazyCallThroughManagerRef
A reference to an orc::LazyCallThroughManager instance.
Definition: Orc.h:462
LLVMOrcSymbolLookupFlags
Symbol lookup flags for lookup sets.
Definition: Orc.h:226
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name)
Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it.
void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM)
Dispose of an IndirectStubsManager.
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms)
Attempt to claim responsibility for new definitions.
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer to the given JITDylib.
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumPairs)
Notifies the target JITDylib that the given symbols have been resolved.
void(* LLVMOrcMaterializationUnitDiscardFunction)(void *Ctx, LLVMOrcJITDylibRef JD, LLVMOrcSymbolStringPoolEntryRef Symbol)
A MaterializationUnit discard callback.
Definition: Orc.h:284
void(* LLVMOrcMaterializationUnitMaterializeFunction)(void *Ctx, LLVMOrcMaterializationResponsibilityRef MR)
A MaterializationUnit materialize callback.
Definition: Orc.h:275
void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects)
Dispose of a DumpObjects instance.
char * LLVMOrcJITTargetMachineBuilderGetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB)
Returns the target triple for the given JITTargetMachineBuilder as a string.
struct LLVMOrcOpaqueDumpObjects * LLVMOrcDumpObjectsRef
A reference to an orc::DumpObjects object.
Definition: Orc.h:471
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD)
Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
void LLVMOrcDisposeLazyCallThroughManager(LLVMOrcLazyCallThroughManagerRef LCM)
Dispose of an LazyCallThroughManager.
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name)
Create a "bare" JITDylib.
struct LLVMOrcOpaqueIRTransformLayer * LLVMOrcIRTransformLayerRef
A reference to an orc::IRTransformLayer instance.
Definition: Orc.h:410
struct LLVMOrcOpaqueLookupState * LLVMOrcLookupStateRef
An opaque lookup state object.
Definition: Orc.h:319
void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols)
Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .
void LLVMOrcMaterializationResponsibilityAddDependencies(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef Name, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to a symbol that the MaterializationResponsibility is responsible for.
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx, LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose)
Create a custom generator.
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
Create a JITDylib.
LLVMContextRef LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx)
Get a reference to the wrapped LLVMContext.
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Reduces the ref-count for of a SymbolStringPool entry.
struct LLVMOrcOpaqueMaterializationUnit * LLVMOrcMaterializationUnitRef
A reference to a uniquely owned orc::MaterializationUnit instance.
Definition: Orc.h:255
struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
A reference to an orc::JITDylib instance.
Definition: Orc.h:159
struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
A reference to an orc::ThreadSafeContext instance.
Definition: Orc.h:377
void LLVMOrcIRTransformLayerSetTransform(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function of the provided transform layer, passing through a pointer to user provide...
LLVMOrcJITDylibLookupFlags
JITDylib lookup flags.
Definition: Orc.h:201
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs)
Create a MaterializationUnit to define lazy re-expots.
void LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB)
Dispose of a JITTargetMachineBuilder.
@ LLVMOrcLookupKindDLSym
Definition: Orc.h:192
@ LLVMOrcLookupKindStatic
Definition: Orc.h:191
@ LLVMJITSymbolGenericFlagsWeak
Definition: Orc.h:59
@ LLVMJITSymbolGenericFlagsExported
Definition: Orc.h:58
@ LLVMJITSymbolGenericFlagsCallable
Definition: Orc.h:60
@ LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
Definition: Orc.h:61
@ LLVMOrcSymbolLookupFlagsRequiredSymbol
Definition: Orc.h:227
@ LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
Definition: Orc.h:228
@ LLVMOrcJITDylibLookupFlagsMatchAllSymbols
Definition: Orc.h:203
@ LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
Definition: Orc.h:202
void(* LLVMMemoryManagerDestroyCallback)(void *Opaque)
LLVMBool(* LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque, char **ErrMsg)
uint8_t *(* LLVMMemoryManagerAllocateDataSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName, LLVMBool IsReadOnly)
uint8_t *(* LLVMMemoryManagerAllocateCodeSectionCallback)(void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName)
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:48
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
Definition: Types.h:160
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:34
void LLVMDisposeTargetMachine(LLVMTargetMachineRef T)
Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< std::pair< JITDylib *, JITDylibLookupFlags > > JITDylibSearchOrder
A list of (JITDylib*, JITDylibLookupFlags) pairs to be used as a search order during symbol lookup.
Definition: Core.h:161
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
Definition: Core.h:759
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
Definition: Core.h:49
SymbolLookupFlags
Lookup flags that apply to each symbol in a lookup.
Definition: Core.h:144
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
Definition: Core.h:134
std::function< std::unique_ptr< IndirectStubsManager >()> createLocalIndirectStubsManagerBuilder(const Triple &T)
Create a local indriect stubs manager builder.
Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES, ExecutorAddr ErrorHandlerAddr)
Create a LocalLazyCallThroughManager from the given triple and execution session.
std::unique_ptr< LazyReexportsMaterializationUnit > lazyReexports(LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr)
Define lazy-reexports based on the given SymbolAliasMap.
LookupKind
Describes the kind of lookup being performed.
Definition: Core.h:156
RegisterDependenciesFunction NoDependenciesToRegister
This can be used as the value for a RegisterDependenciesFunction if there are no dependants to regist...
Definition: Core.cpp:35
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
Definition: MemAlloc.h:25
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:290
LLVMAttributeRef wrap(Attribute Attr)
Definition: Attributes.h:285
void replace(Container &Cont, typename Container::iterator ContIt, typename Container::iterator ContEnd, RandomAccessIterator ValIt, RandomAccessIterator ValEnd)
Given a sequence container Cont, replace the range [ContIt, ContEnd) with the range [ValIt,...
Definition: STLExtras.h:2136
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:860
Represents an evaluated symbol address and flags.
Definition: Orc.h:80
Represents the linkage flags for a symbol definition.
Definition: Orc.h:72
Represents a pair of a JITDylib and LLVMOrcCSymbolsList.
Definition: Orc.h:173
LLVMOrcCSymbolsList Names
Definition: Orc.h:175
An element type for a JITDylib search order.
Definition: Orc.h:209
An element type for a symbol lookup set.
Definition: Orc.h:234
Represents a pair of a symbol name and SymbolAliasMapEntry.
Definition: Orc.h:145
Represents a pair of a symbol name and LLVMJITSymbolFlags.
Definition: Orc.h:109
Represents a pair of a symbol name and an evaluated symbol.
Definition: Orc.h:123
LLVMOrcSymbolStringPoolEntryRef * Symbols
Definition: Orc.h:166
size_t Length
Definition: Orc.h:167