LLVM  15.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"
12 #include "llvm-c/TargetMachine.h"
13 
19 
20 using namespace llvm;
21 using namespace llvm::orc;
22 
23 namespace llvm {
24 namespace orc {
25 
27 
29 public:
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 
109 namespace llvm {
110 namespace orc {
111 
112 class CAPIDefinitionGenerator final : public DefinitionGenerator {
113 public:
114  CAPIDefinitionGenerator(
115  void *Ctx,
117  : Ctx(Ctx), TryToGenerate(TryToGenerate) {}
118 
119  Error tryToGenerate(LookupState &LS, LookupKind K, JITDylib &JD,
120  JITDylibLookupFlags JDLookupFlags,
121  const SymbolLookupSet &LookupSet) override {
122 
123  // Take the lookup state.
125 
126  // Translate the lookup kind.
127  LLVMOrcLookupKind CLookupKind;
128  switch (K) {
129  case LookupKind::Static:
130  CLookupKind = LLVMOrcLookupKindStatic;
131  break;
132  case LookupKind::DLSym:
133  CLookupKind = LLVMOrcLookupKindDLSym;
134  break;
135  }
136 
137  // Translate the JITDylibSearchFlags.
138  LLVMOrcJITDylibLookupFlags CJDLookupFlags;
139  switch (JDLookupFlags) {
142  break;
145  break;
146  }
147 
148  // Translate the lookup set.
149  std::vector<LLVMOrcCLookupSetElement> CLookupSet;
150  CLookupSet.reserve(LookupSet.size());
151  for (auto &KV : LookupSet) {
155  switch (KV.second) {
158  break;
161  break;
162  }
163  CLookupSet.push_back({Name, SLF});
164  }
165 
166  // Run the C TryToGenerate function.
167  auto Err = unwrap(TryToGenerate(::wrap(this), Ctx, &LSR, CLookupKind,
168  ::wrap(&JD), CJDLookupFlags,
169  CLookupSet.data(), CLookupSet.size()));
170 
171  // Restore the lookup state.
173 
174  return Err;
175  }
176 
177 private:
178  void *Ctx;
180 };
181 
182 } // end namespace orc
183 } // end namespace llvm
184 
185 namespace {
186 
187 class OrcCAPIMaterializationUnit : public llvm::orc::MaterializationUnit {
188 public:
189  OrcCAPIMaterializationUnit(
190  std::string Name, SymbolFlagsMap InitialSymbolFlags,
191  SymbolStringPtr InitSymbol, void *Ctx,
195  : llvm::orc::MaterializationUnit(
196  Interface(std::move(InitialSymbolFlags), std::move(InitSymbol))),
197  Name(std::move(Name)), Ctx(Ctx), Materialize(Materialize),
198  Discard(Discard), Destroy(Destroy) {}
199 
200  ~OrcCAPIMaterializationUnit() {
201  if (Ctx)
202  Destroy(Ctx);
203  }
204 
205  StringRef getName() const override { return Name; }
206 
207  void materialize(std::unique_ptr<MaterializationResponsibility> R) override {
208  void *Tmp = Ctx;
209  Ctx = nullptr;
210  Materialize(Tmp, wrap(R.release()));
211  }
212 
213 private:
214  void discard(const JITDylib &JD, const SymbolStringPtr &Name) override {
215  Discard(Ctx, wrap(&JD), wrap(OrcV2CAPIHelper::getRawPoolEntryPtr(Name)));
216  }
217 
218  std::string Name;
219  void *Ctx = nullptr;
220  LLVMOrcMaterializationUnitMaterializeFunction Materialize = nullptr;
223 };
224 
225 static JITSymbolFlags toJITSymbolFlags(LLVMJITSymbolFlags F) {
226 
227  JITSymbolFlags JSF;
228 
229  if (F.GenericFlags & LLVMJITSymbolGenericFlagsExported)
231  if (F.GenericFlags & LLVMJITSymbolGenericFlagsWeak)
232  JSF |= JITSymbolFlags::Weak;
233  if (F.GenericFlags & LLVMJITSymbolGenericFlagsCallable)
237 
238  JSF.getTargetFlags() = F.TargetFlags;
239 
240  return JSF;
241 }
242 
243 static LLVMJITSymbolFlags fromJITSymbolFlags(JITSymbolFlags JSF) {
244  LLVMJITSymbolFlags F = {0, 0};
245  if (JSF & JITSymbolFlags::Exported)
246  F.GenericFlags |= LLVMJITSymbolGenericFlagsExported;
247  if (JSF & JITSymbolFlags::Weak)
248  F.GenericFlags |= LLVMJITSymbolGenericFlagsWeak;
249  if (JSF & JITSymbolFlags::Callable)
250  F.GenericFlags |= LLVMJITSymbolGenericFlagsCallable;
253 
254  F.TargetFlags = JSF.getTargetFlags();
255 
256  return F;
257 }
258 
259 static SymbolMap toSymbolMap(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs) {
260  SymbolMap SM;
261  for (size_t I = 0; I != NumPairs; ++I) {
262  JITSymbolFlags Flags = toJITSymbolFlags(Syms[I].Sym.Flags);
264  JITEvaluatedSymbol(Syms[I].Sym.Address, Flags);
265  }
266  return SM;
267 }
268 
269 static SymbolDependenceMap
270 toSymbolDependenceMap(LLVMOrcCDependenceMapPairs Pairs, size_t NumPairs) {
272  for (size_t I = 0; I != NumPairs; ++I) {
273  JITDylib *JD = unwrap(Pairs[I].JD);
274  SymbolNameSet Names;
275 
276  for (size_t J = 0; J != Pairs[I].Names.Length; ++J) {
277  auto Sym = Pairs[I].Names.Symbols[J];
279  }
280  SDM[JD] = Names;
281  }
282  return SDM;
283 }
284 
285 } // end anonymous namespace
286 
289  void *Ctx) {
290  unwrap(ES)->setErrorReporter(
291  [=](Error Err) { ReportError(Ctx, wrap(std::move(Err))); });
292 }
293 
296  return wrap(
297  unwrap(ES)->getExecutorProcessControl().getSymbolStringPool().get());
298 }
299 
301  unwrap(SSP)->clearDeadEntries();
302 }
303 
306  return wrap(
308 }
309 
312 }
313 
316 }
317 
319  return unwrap(S)->getKey().data();
320 }
321 
324  auto RT = unwrap(JD)->createResourceTracker();
325  // Retain the pointer for the C API client.
326  RT->Retain();
327  return wrap(RT.get());
328 }
329 
332  auto RT = unwrap(JD)->getDefaultResourceTracker();
333  // Retain the pointer for the C API client.
334  return wrap(RT.get());
335 }
336 
338  ResourceTrackerSP TmpRT(unwrap(RT));
339  TmpRT->Release();
340 }
341 
344  ResourceTrackerSP TmpRT(unwrap(SrcRT));
345  TmpRT->transferTo(*unwrap(DstRT));
346 }
347 
349  ResourceTrackerSP TmpRT(unwrap(RT));
350  return wrap(TmpRT->remove());
351 }
352 
354  std::unique_ptr<DefinitionGenerator> TmpDG(unwrap(DG));
355 }
356 
358  std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
359 }
360 
362  const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,
363  size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,
367  SymbolFlagsMap SFM;
368  for (size_t I = 0; I != NumSyms; ++I)
370  toJITSymbolFlags(Syms[I].Flags);
371 
373 
374  return wrap(new OrcCAPIMaterializationUnit(
375  Name, std::move(SFM), std::move(IS), Ctx, Materialize, Discard, Destroy));
376 }
377 
380  SymbolMap SM = toSymbolMap(Syms, NumPairs);
381  return wrap(absoluteSymbols(std::move(SM)).release());
382 }
383 
386  LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases,
387  size_t NumPairs) {
388 
389  SymbolAliasMap SAM;
390  for (size_t I = 0; I != NumPairs; ++I) {
391  auto pair = CallableAliases[I];
392  JITSymbolFlags Flags = toJITSymbolFlags(pair.Entry.Flags);
396  SymbolAliasMapEntry(Name, Flags);
397  }
398 
399  return wrap(lazyReexports(*unwrap(LCTM), *unwrap(ISM), *unwrap(SourceJD),
400  std::move(SAM))
401  .release());
402 }
403 
406  std::unique_ptr<MaterializationResponsibility> TmpMR(unwrap(MR));
407 }
408 
411  return wrap(&unwrap(MR)->getTargetJITDylib());
412 }
413 
417  return wrap(&unwrap(MR)->getExecutionSession());
418 }
419 
421  LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs) {
422 
423  auto Symbols = unwrap(MR)->getSymbols();
425  safe_malloc(Symbols.size() * sizeof(LLVMOrcCSymbolFlagsMapPair)));
426  size_t I = 0;
427  for (auto const &pair : Symbols) {
428  auto Name = wrap(OrcV2CAPIHelper::getRawPoolEntryPtr(pair.first));
429  auto Flags = pair.second;
430  Result[I] = {Name, fromJITSymbolFlags(Flags)};
431  I++;
432  }
433  *NumPairs = Symbols.size();
434  return Result;
435 }
436 
438  free(Pairs);
439 }
440 
444  auto Sym = unwrap(MR)->getInitializerSymbol();
446 }
447 
450  LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols) {
451 
452  auto Symbols = unwrap(MR)->getRequestedSymbols();
455  Symbols.size() * sizeof(LLVMOrcSymbolStringPoolEntryRef)));
456  size_t I = 0;
457  for (auto &Name : Symbols) {
459  I++;
460  }
461  *NumSymbols = Symbols.size();
462  return Result;
463 }
464 
466  free(Symbols);
467 }
468 
471  size_t NumPairs) {
472  SymbolMap SM = toSymbolMap(Symbols, NumPairs);
473  return wrap(unwrap(MR)->notifyResolved(std::move(SM)));
474 }
475 
478  return wrap(unwrap(MR)->notifyEmitted());
479 }
480 
483  LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms) {
484  SymbolFlagsMap SFM;
485  for (size_t I = 0; I != NumSyms; ++I)
487  toJITSymbolFlags(Syms[I].Flags);
488 
489  return wrap(unwrap(MR)->defineMaterializing(std::move(SFM)));
490 }
491 
495  std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
496  return wrap(unwrap(MR)->replace(std::move(TmpMU)));
497 }
498 
501  LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,
503  SymbolNameSet Syms;
504  for (size_t I = 0; I != NumSymbols; I++) {
506  }
507  auto OtherMR = unwrap(MR)->delegate(Syms);
508 
509  if (!OtherMR) {
510  return wrap(OtherMR.takeError());
511  }
512  *Result = wrap(OtherMR->release());
513  return LLVMErrorSuccess;
514 }
515 
519  LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs) {
520 
521  SymbolDependenceMap SDM = toSymbolDependenceMap(Dependencies, NumPairs);
523  unwrap(MR)->addDependencies(Sym, SDM);
524 }
525 
528  LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs) {
529 
530  SymbolDependenceMap SDM = toSymbolDependenceMap(Dependencies, NumPairs);
531  unwrap(MR)->addDependenciesForAll(SDM);
532 }
533 
536  unwrap(MR)->failMaterialization();
537 }
538 
542  std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
543  unwrap(IRLayer)->emit(
544  std::unique_ptr<MaterializationResponsibility>(unwrap(MR)),
545  std::move(*TmpTSM));
546 }
547 
550  const char *Name) {
551  return wrap(&unwrap(ES)->createBareJITDylib(Name));
552 }
553 
556  LLVMOrcJITDylibRef *Result,
557  const char *Name) {
558  auto JD = unwrap(ES)->createJITDylib(Name);
559  if (!JD)
560  return wrap(JD.takeError());
561  *Result = wrap(&*JD);
562  return LLVMErrorSuccess;
563 }
564 
567  const char *Name) {
568  return wrap(unwrap(ES)->getJITDylibByName(Name));
569 }
570 
573  std::unique_ptr<MaterializationUnit> TmpMU(unwrap(MU));
574 
575  if (auto Err = unwrap(JD)->define(TmpMU)) {
576  TmpMU.release();
577  return wrap(std::move(Err));
578  }
579  return LLVMErrorSuccess;
580 }
581 
583  return wrap(unwrap(JD)->clear());
584 }
585 
588  unwrap(JD)->addGenerator(std::unique_ptr<DefinitionGenerator>(unwrap(DG)));
589 }
590 
593  auto DG = std::make_unique<CAPIDefinitionGenerator>(Ctx, F);
594  return wrap(DG.release());
595 }
596 
599  LLVMOrcSymbolPredicate Filter, void *FilterCtx) {
600  assert(Result && "Result can not be null");
601  assert((Filter || !FilterCtx) &&
602  "if Filter is null then FilterCtx must also be null");
603 
605  if (Filter)
606  Pred = [=](const SymbolStringPtr &Name) -> bool {
608  };
609 
610  auto ProcessSymsGenerator =
612 
613  if (!ProcessSymsGenerator) {
614  *Result = nullptr;
615  return wrap(ProcessSymsGenerator.takeError());
616  }
617 
618  *Result = wrap(ProcessSymsGenerator->release());
619  return LLVMErrorSuccess;
620 }
621 
623  LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,
624  char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx) {
625  assert(Result && "Result can not be null");
626  assert(FileName && "FileName can not be null");
627  assert((Filter || !FilterCtx) &&
628  "if Filter is null then FilterCtx must also be null");
629 
631  if (Filter)
632  Pred = [=](const SymbolStringPtr &Name) -> bool {
634  };
635 
636  auto LibrarySymsGenerator =
638 
639  if (!LibrarySymsGenerator) {
640  *Result = nullptr;
641  return wrap(LibrarySymsGenerator.takeError());
642  }
643 
644  *Result = wrap(LibrarySymsGenerator->release());
645  return LLVMErrorSuccess;
646 }
647 
650  const char *FileName, const char *TargetTriple) {
651  assert(Result && "Result can not be null");
652  assert(FileName && "Filename can not be null");
653  assert(ObjLayer && "ObjectLayer can not be null");
654 
655  if (TargetTriple) {
656  auto TT = Triple(TargetTriple);
657  auto LibrarySymsGenerator =
658  StaticLibraryDefinitionGenerator::Load(*unwrap(ObjLayer), FileName, TT);
659  if (!LibrarySymsGenerator) {
660  *Result = nullptr;
661  return wrap(LibrarySymsGenerator.takeError());
662  }
663  *Result = wrap(LibrarySymsGenerator->release());
664  return LLVMErrorSuccess;
665  } else {
666  auto LibrarySymsGenerator =
667  StaticLibraryDefinitionGenerator::Load(*unwrap(ObjLayer), FileName);
668  if (!LibrarySymsGenerator) {
669  *Result = nullptr;
670  return wrap(LibrarySymsGenerator.takeError());
671  }
672  *Result = wrap(LibrarySymsGenerator->release());
673  return LLVMErrorSuccess;
674  }
675 }
676 
678  return wrap(new ThreadSafeContext(std::make_unique<LLVMContext>()));
679 }
680 
683  return wrap(unwrap(TSCtx)->getContext());
684 }
685 
687  delete unwrap(TSCtx);
688 }
689 
693  void *Ctx) {
694  return wrap(unwrap(TSM)->withModuleDo(
695  [&](Module &M) { return unwrap(F(Ctx, wrap(&M))); }));
696 }
697 
701  return wrap(
702  new ThreadSafeModule(std::unique_ptr<Module>(unwrap(M)), *unwrap(TSCtx)));
703 }
704 
706  delete unwrap(TSM);
707 }
708 
711  assert(Result && "Result can not be null");
712 
714  if (!JTMB) {
715  Result = nullptr;
716  return wrap(JTMB.takeError());
717  }
718 
719  *Result = wrap(new JITTargetMachineBuilder(std::move(*JTMB)));
720  return LLVMErrorSuccess;
721 }
722 
725  auto *TemplateTM = unwrap(TM);
726 
727  auto JTMB =
728  std::make_unique<JITTargetMachineBuilder>(TemplateTM->getTargetTriple());
729 
730  (*JTMB)
731  .setCPU(TemplateTM->getTargetCPU().str())
732  .setRelocationModel(TemplateTM->getRelocationModel())
733  .setCodeModel(TemplateTM->getCodeModel())
734  .setCodeGenOptLevel(TemplateTM->getOptLevel())
735  .setFeatures(TemplateTM->getTargetFeatureString())
736  .setOptions(TemplateTM->Options);
737 
739 
740  return wrap(JTMB.release());
741 }
742 
745  delete unwrap(JTMB);
746 }
747 
750  auto Tmp = unwrap(JTMB)->getTargetTriple().str();
751  char *TargetTriple = (char *)malloc(Tmp.size() + 1);
752  strcpy(TargetTriple, Tmp.c_str());
753  return TargetTriple;
754 }
755 
757  LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple) {
758  unwrap(JTMB)->getTargetTriple() = Triple(TargetTriple);
759 }
760 
763  LLVMMemoryBufferRef ObjBuffer) {
764  return wrap(unwrap(ObjLayer)->add(
765  *unwrap(JD), std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
766 }
767 
770  LLVMMemoryBufferRef ObjBuffer) {
771  return wrap(
772  unwrap(ObjLayer)->add(ResourceTrackerSP(unwrap(RT)),
773  std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
774 }
775 
778  LLVMMemoryBufferRef ObjBuffer) {
779  unwrap(ObjLayer)->emit(
780  std::unique_ptr<MaterializationResponsibility>(unwrap(R)),
781  std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer)));
782 }
783 
785  delete unwrap(ObjLayer);
786 }
787 
790  LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx) {
792  ->setTransform(
793  [=](ThreadSafeModule TSM,
796  wrap(new ThreadSafeModule(std::move(TSM)));
797  if (LLVMErrorRef Err = TransformFunction(Ctx, &TSMRef, wrap(&R))) {
798  assert(!TSMRef && "TSMRef was not reset to null on error");
799  return unwrap(Err);
800  }
801  return std::move(*unwrap(TSMRef));
802  });
803 }
804 
806  LLVMOrcObjectTransformLayerRef ObjTransformLayer,
807  LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx) {
808  unwrap(ObjTransformLayer)
809  ->setTransform([TransformFunction, Ctx](std::unique_ptr<MemoryBuffer> Obj)
810  -> Expected<std::unique_ptr<MemoryBuffer>> {
811  LLVMMemoryBufferRef ObjBuffer = wrap(Obj.release());
812  if (LLVMErrorRef Err = TransformFunction(Ctx, &ObjBuffer)) {
813  assert(!ObjBuffer && "ObjBuffer was not reset to null on error");
814  return unwrap(Err);
815  }
816  return std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer));
817  });
818 }
819 
821  const char *IdentifierOverride) {
822  assert(DumpDir && "DumpDir should not be null");
823  assert(IdentifierOverride && "IdentifierOverride should not be null");
824  return wrap(new DumpObjects(DumpDir, IdentifierOverride));
825 }
826 
828  delete unwrap(DumpObjects);
829 }
830 
832  LLVMMemoryBufferRef *ObjBuffer) {
833  std::unique_ptr<MemoryBuffer> OB(unwrap(*ObjBuffer));
834  if (auto Result = (*unwrap(DumpObjects))(std::move(OB))) {
835  *ObjBuffer = wrap(Result->release());
836  return LLVMErrorSuccess;
837  } else {
838  *ObjBuffer = nullptr;
839  return wrap(Result.takeError());
840  }
841 }
842 
844  return wrap(new LLJITBuilder());
845 }
846 
848  delete unwrap(Builder);
849 }
850 
853  unwrap(Builder)->setJITTargetMachineBuilder(std::move(*unwrap(JTMB)));
855 }
856 
860  unwrap(Builder)->setObjectLinkingLayerCreator(
861  [=](ExecutionSession &ES, const Triple &TT) {
862  auto TTStr = TT.str();
863  return std::unique_ptr<ObjectLayer>(
864  unwrap(F(Ctx, wrap(&ES), TTStr.c_str())));
865  });
866 }
867 
870  assert(Result && "Result can not be null");
871 
872  if (!Builder)
874 
875  auto J = unwrap(Builder)->create();
877 
878  if (!J) {
879  Result = nullptr;
880  return wrap(J.takeError());
881  }
882 
883  *Result = wrap(J->release());
884  return LLVMErrorSuccess;
885 }
886 
888  delete unwrap(J);
889  return LLVMErrorSuccess;
890 }
891 
893  return wrap(&unwrap(J)->getExecutionSession());
894 }
895 
897  return wrap(&unwrap(J)->getMainJITDylib());
898 }
899 
901  return unwrap(J)->getTargetTriple().str().c_str();
902 }
903 
905  return unwrap(J)->getDataLayout().getGlobalPrefix();
906 }
907 
909 LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName) {
911  unwrap(J)->mangleAndIntern(UnmangledName)));
912 }
913 
915  LLVMMemoryBufferRef ObjBuffer) {
916  return wrap(unwrap(J)->addObjectFile(
917  *unwrap(JD), std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
918 }
919 
922  LLVMMemoryBufferRef ObjBuffer) {
923  return wrap(unwrap(J)->addObjectFile(
925  std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
926 }
927 
931  std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
932  return wrap(unwrap(J)->addIRModule(*unwrap(JD), std::move(*TmpTSM)));
933 }
934 
938  std::unique_ptr<ThreadSafeModule> TmpTSM(unwrap(TSM));
939  return wrap(unwrap(J)->addIRModule(ResourceTrackerSP(unwrap(RT)),
940  std::move(*TmpTSM)));
941 }
942 
944  LLVMOrcJITTargetAddress *Result,
945  const char *Name) {
946  assert(Result && "Result can not be null");
947 
948  auto Sym = unwrap(J)->lookup(Name);
949  if (!Sym) {
950  *Result = 0;
951  return wrap(Sym.takeError());
952  }
953 
954  *Result = Sym->getValue();
955  return LLVMErrorSuccess;
956 }
957 
959  return wrap(&unwrap(J)->getObjLinkingLayer());
960 }
961 
964  return wrap(&unwrap(J)->getObjTransformLayer());
965 }
966 
970  assert(ES && "ES must not be null");
971  return wrap(new RTDyldObjectLinkingLayer(
972  *unwrap(ES), [] { return std::make_unique<SectionMemoryManager>(); }));
973 }
974 
976  LLVMOrcObjectLayerRef RTDyldObjLinkingLayer,
977  LLVMJITEventListenerRef Listener) {
978  assert(RTDyldObjLinkingLayer && "RTDyldObjLinkingLayer must not be null");
979  assert(Listener && "Listener must not be null");
980  reinterpret_cast<RTDyldObjectLinkingLayer *>(unwrap(RTDyldObjLinkingLayer))
981  ->registerJITEventListener(*unwrap(Listener));
982 }
983 
985  return wrap(&unwrap(J)->getIRTransformLayer());
986 }
987 
989  return unwrap(J)->getDataLayout().getStringRepresentation().c_str();
990 }
991 
993 LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple) {
995  return wrap(builder().release());
996 }
997 
999  std::unique_ptr<IndirectStubsManager> TmpISM(unwrap(ISM));
1000 }
1001 
1003  const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
1004  LLVMOrcJITTargetAddress ErrorHandlerAddr,
1006  auto LCTM = createLocalLazyCallThroughManager(Triple(TargetTriple),
1007  *unwrap(ES), ErrorHandlerAddr);
1008 
1009  if (!LCTM)
1010  return wrap(LCTM.takeError());
1011  *Result = wrap(LCTM->release());
1012  return LLVMErrorSuccess;
1013 }
1014 
1017  std::unique_ptr<LazyCallThroughManager> TmpLCM(unwrap(LCM));
1018 }
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
@ LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly
Definition: Orc.h:60
LLVMOrcDisposeLLJIT
LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J)
Dispose of an LLJIT instance.
Definition: OrcV2CBindings.cpp:887
LLVMOrcLookupStateRef
struct LLVMOrcOpaqueLookupState * LLVMOrcLookupStateRef
An opaque lookup state object.
Definition: Orc.h:302
LLVMOrcMaterializationResponsibilityGetRequestedSymbols
LLVMOrcSymbolStringPoolEntryRef * LLVMOrcMaterializationResponsibilityGetRequestedSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols)
Returns the names of any symbols covered by this MaterializationResponsibility object that have queri...
Definition: OrcV2CBindings.cpp:449
LLVMOrcDisposeJITTargetMachineBuilder
void LLVMOrcDisposeJITTargetMachineBuilder(LLVMOrcJITTargetMachineBuilderRef JTMB)
Dispose of a JITTargetMachineBuilder.
Definition: OrcV2CBindings.cpp:743
LLVMOrcDisposeThreadSafeModule
void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM)
Dispose of a ThreadSafeModule.
Definition: OrcV2CBindings.cpp:705
llvm::orc::MaterializationResponsibility
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition: Core.h:520
getName
static StringRef getName(Value *V)
Definition: ProvenanceAnalysisEvaluator.cpp:42
LLVMOrcCDependenceMapPair
Represents a pair of a JITDylib and LLVMOrcCSymbolsList.
Definition: Orc.h:172
LLVMOrcObjectLayerRef
struct LLVMOrcOpaqueObjectLayer * LLVMOrcObjectLayerRef
A reference to an orc::ObjectLayer instance.
Definition: Orc.h:375
llvm::orc::JITTargetMachineBuilder
A utility class for building TargetMachines for JITs.
Definition: JITTargetMachineBuilder.h:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::orc::JITDylib
Represents a JIT'd dynamic library.
Definition: Core.h:947
LLVMOrcMaterializationResponsibilityAddDependenciesForAll
void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to all symbols that the MaterializationResponsibility is responsible for.
Definition: OrcV2CBindings.cpp:526
LLVMContextRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
LLVMOrcCreateDynamicLibrarySearchGeneratorForPath
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, const char *FileName, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect library symbols into the J...
Definition: OrcV2CBindings.cpp:622
llvm::orc::RTDyldObjectLinkingLayer
Definition: RTDyldObjectLinkingLayer.h:37
llvm::orc::OrcV2CAPIHelper::retainPoolEntry
static void retainPoolEntry(PoolEntryPtr P)
Definition: OrcV2CBindings.cpp:56
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition: StringMapEntry.h:101
LLVMOrcCSymbolsList::Symbols
LLVMOrcSymbolStringPoolEntryRef * Symbols
Definition: Orc.h:165
LLVMOrcSymbolPredicate
int(* LLVMOrcSymbolPredicate)(void *Ctx, LLVMOrcSymbolStringPoolEntryRef Sym)
Predicate function for SymbolStringPoolEntries.
Definition: Orc.h:346
llvm::orc::InProgressLookupState
Definition: Core.cpp:486
LLVMOrcIRTransformLayerRef
struct LLVMOrcOpaqueIRTransformLayer * LLVMOrcIRTransformLayerRef
A reference to an orc::IRTransformLayer instance.
Definition: Orc.h:385
LLVMOrcLLJITGetExecutionSession
LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J)
Get a reference to the ExecutionSession for this LLJIT instance.
Definition: OrcV2CBindings.cpp:892
llvm::orc::LLJITBuilder
Constructs LLJIT instances.
Definition: LLJIT.h:392
LLVMOrcJITDylibClear
LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD)
Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
Definition: OrcV2CBindings.cpp:582
LLVMOrcSymbolStringPoolRef
struct LLVMOrcOpaqueSymbolStringPool * LLVMOrcSymbolStringPoolRef
A reference to an orc::SymbolStringPool.
Definition: Orc.h:97
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
LLVMOrcIndirectStubsManagerRef
struct LLVMOrcOpaqueIndirectStubsManager * LLVMOrcIndirectStubsManagerRef
A reference to an orc::IndirectStubsManager instance.
Definition: Orc.h:431
LLVMOrcJITTargetMachineBuilderDetectHost
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(LLVMOrcJITTargetMachineBuilderRef *Result)
Create a JITTargetMachineBuilder by detecting the host.
Definition: OrcV2CBindings.cpp:709
llvm::orc::IndirectStubsManager
Base class for managing collections of named indirect stubs.
Definition: IndirectionUtils.h:282
llvm::orc::SymbolLookupSet
A set of symbols to look up, each associated with a SymbolLookupFlags value.
Definition: Core.h:175
llvm::orc::LookupKind::Static
@ Static
llvm::orc::SymbolStringPtr
Pointer to a pooled string representing a symbol name.
Definition: SymbolStringPool.h:50
builder
assume builder
Definition: AssumeBundleBuilder.cpp:650
llvm::orc::OrcV2CAPIHelper::releasePoolEntry
static void releasePoolEntry(PoolEntryPtr P)
Definition: OrcV2CBindings.cpp:61
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
LLJIT.h
GlobalPrefix
@ GlobalPrefix
Definition: AsmWriter.cpp:343
llvm::orc::LazyCallThroughManager
Manages a set of 'lazy call-through' trampolines.
Definition: LazyReexports.h:38
llvm::orc::OrcV2CAPIHelper::moveFromSymbolStringPtr
static PoolEntryPtr moveFromSymbolStringPtr(SymbolStringPtr S)
Definition: OrcV2CBindings.cpp:34
LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction
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:337
LLVMOrcObjectTransformLayerSetTransform
void LLVMOrcObjectTransformLayerSetTransform(LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function on an LLVMOrcObjectTransformLayer.
Definition: OrcV2CBindings.cpp:805
LLVMOrcLookupKindDLSym
@ LLVMOrcLookupKindDLSym
Definition: Orc.h:191
llvm::AtomicOrderingCABI::release
@ release
LLVMOrcDisposeLazyCallThroughManager
void LLVMOrcDisposeLazyCallThroughManager(LLVMOrcLazyCallThroughManagerRef LCM)
Dispose of an LazyCallThroughManager.
Definition: OrcV2CBindings.cpp:1015
LLVMOrcThreadSafeModuleWithModuleDo
LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx)
Apply the given function to the module contained in this ThreadSafeModule.
Definition: OrcV2CBindings.cpp:691
llvm::orc::ResourceTracker
API to remove / transfer ownership of JIT resources.
Definition: Core.h:53
LLVMErrorSuccess
return LLVMErrorSuccess
Definition: PassBuilderBindings.cpp:79
llvm::orc::LLJIT
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
Definition: LLJIT.h:37
LLVMOrcLookupKind
LLVMOrcLookupKind
Lookup kind.
Definition: Orc.h:189
LLVMOrcMaterializationUnitDiscardFunction
void(* LLVMOrcMaterializationUnitDiscardFunction)(void *Ctx, LLVMOrcJITDylibRef JD, LLVMOrcSymbolStringPoolEntryRef Symbol)
A MaterializationUnit discard callback.
Definition: Orc.h:267
llvm::orc::lazyReexports
std::unique_ptr< LazyReexportsMaterializationUnit > lazyReexports(LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr)
Define lazy-reexports based on the given SymbolAliasMap.
Definition: LazyReexports.h:168
ObjectTransformLayer.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
LLVMOrcMaterializationResponsibilityRef
struct LLVMOrcOpaqueMaterializationResponsibility * LLVMOrcMaterializationResponsibilityRef
A reference to a uniquely owned orc::MaterializationResponsibility instance.
Definition: Orc.h:245
LLVMOrcLLJITAddLLVMIRModuleWithRT
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT instance.
Definition: OrcV2CBindings.cpp:935
LLVMOrcExecutionSessionGetSymbolStringPool
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES)
Return a reference to the SymbolStringPool for an ExecutionSession.
Definition: OrcV2CBindings.cpp:295
llvm::orc::LookupKind
LookupKind
Describes the kind of lookup being performed.
Definition: Core.h:149
llvm::detail::DenseSetImpl::insert
std::pair< iterator, bool > insert(const ValueT &V)
Definition: DenseSet.h:206
LLVMOrcMaterializationResponsibilityNotifyEmitted
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(LLVMOrcMaterializationResponsibilityRef MR)
Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by t...
Definition: OrcV2CBindings.cpp:476
llvm::JITSymbolFlags
Flags for symbols in the JIT.
Definition: JITSymbol.h:74
LLVMOrcJITDylibLookupFlagsMatchAllSymbols
@ LLVMOrcJITDylibLookupFlagsMatchAllSymbols
Definition: Orc.h:202
llvm::orc::MaterializationUnit
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
Definition: Core.h:666
llvm::JITEvaluatedSymbol
Represents a symbol that has been evaluated to an address already.
Definition: JITSymbol.h:229
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:240
LLVMOrcIRTransformLayerEmit
void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM)
Definition: OrcV2CBindings.cpp:539
LLVMOrcCSymbolFlagsMapPair
Represents a pair of a symbol name and LLVMJITSymbolFlags.
Definition: Orc.h:108
LLVMOrcLazyReexports
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs)
Create a MaterializationUnit to define lazy re-expots.
Definition: OrcV2CBindings.cpp:384
clear
static void clear(coro::Shape &Shape)
Definition: Coroutines.cpp:149
LLVMOrcJITDylibGetDefaultResourceTracker
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to the default resource tracker for the given JITDylib.
Definition: OrcV2CBindings.cpp:331
LLVMOrcJITDylibLookupFlags
LLVMOrcJITDylibLookupFlags
JITDylib lookup flags.
Definition: Orc.h:200
LLVMOrcDisposeCSymbolFlagsMap
void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs)
Disposes of the passed LLVMOrcCSymbolFlagsMap.
Definition: OrcV2CBindings.cpp:437
LLVMOrcCreateCustomMaterializationUnit
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
Create a custom MaterializationUnit.
Definition: OrcV2CBindings.cpp:361
LLVMOrcSymbolStringPoolEntryRef
struct LLVMOrcOpaqueSymbolStringPoolEntry * LLVMOrcSymbolStringPoolEntryRef
A reference to an orc::SymbolStringPool table entry.
Definition: Orc.h:102
LLVMOrcIRTransformLayerSetTransform
void LLVMOrcIRTransformLayerSetTransform(LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx)
Set the transform function of the provided transform layer, passing through a pointer to user provide...
Definition: OrcV2CBindings.cpp:788
llvm::JITSymbolFlags::getTargetFlags
TargetFlagsType & getTargetFlags()
Return a reference to the target-specific flags.
Definition: JITSymbol.h:172
LLVMOrcDumpObjects_CallOperator
LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer)
Dump the contents of the given MemoryBuffer.
Definition: OrcV2CBindings.cpp:831
LLVMOrcLookupKindStatic
@ LLVMOrcLookupKindStatic
Definition: Orc.h:190
llvm::JITSymbolFlags::MaterializationSideEffectsOnly
@ MaterializationSideEffectsOnly
Definition: JITSymbol.h:87
llvm::orc::SymbolStringPool
String pool for symbol names used by the JIT.
Definition: SymbolStringPool.h:27
LLVMOrcMaterializationUnitRef
struct LLVMOrcOpaqueMaterializationUnit * LLVMOrcMaterializationUnitRef
A reference to a uniquely owned orc::MaterializationUnit instance.
Definition: Orc.h:238
LLVMOrcExecutionSessionCreateBareJITDylib
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES, const char *Name)
Create a "bare" JITDylib.
Definition: OrcV2CBindings.cpp:549
llvm::orc
Definition: CompileOnDemandLayer.h:54
LLVMOrcThreadSafeModuleRef
struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
A reference to an orc::ThreadSafeModule instance.
Definition: Orc.h:357
llvm::replace
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:1818
LLVMJITSymbolGenericFlagsCallable
@ LLVMJITSymbolGenericFlagsCallable
Definition: Orc.h:59
LLVMOrcLazyCallThroughManagerRef
struct LLVMOrcOpaqueLazyCallThroughManager * LLVMOrcLazyCallThroughManagerRef
A reference to an orc::LazyCallThroughManager instance.
Definition: Orc.h:437
llvm::AArch64_AM::LSR
@ LSR
Definition: AArch64AddressingModes.h:36
LLVMOrcLLJITLookup
LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J, LLVMOrcJITTargetAddress *Result, const char *Name)
Look up the given symbol in the main JITDylib of the given LLJIT instance.
Definition: OrcV2CBindings.cpp:943
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:264
llvm::orc::ObjectLayer
Interface for Layers that accept object files.
Definition: Layer.h:133
LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(LLVMOrcExecutionSessionRef ES)
Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory managem...
Definition: OrcV2CBindings.cpp:968
llvm::orc::LookupKind::DLSym
@ DLSym
LLVMOrcDisposeDumpObjects
void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects)
Dispose of a DumpObjects instance.
Definition: OrcV2CBindings.cpp:827
LLVMJITSymbolGenericFlagsExported
@ LLVMJITSymbolGenericFlagsExported
Definition: Orc.h:57
LLVMOrcThreadSafeContextGetContext
LLVMContextRef LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx)
Get a reference to the wrapped LLVMContext.
Definition: OrcV2CBindings.cpp:682
LLVMOrcObjectTransformLayerRef
struct LLVMOrcOpaqueObjectTransformLayer * LLVMOrcObjectTransformLayerRef
A reference to an orc::ObjectTransformLayer instance.
Definition: Orc.h:409
LLVMOrcMaterializationResponsibilityAddDependencies
void LLVMOrcMaterializationResponsibilityAddDependencies(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef Name, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
Adds dependencies to a symbol that the MaterializationResponsibility is responsible for.
Definition: OrcV2CBindings.cpp:516
LLVMOrcCSymbolsList::Length
size_t Length
Definition: Orc.h:166
Orc.h
LLVMOrcMaterializationUnitMaterializeFunction
void(* LLVMOrcMaterializationUnitMaterializeFunction)(void *Ctx, LLVMOrcMaterializationResponsibilityRef MR)
A MaterializationUnit materialize callback.
Definition: Orc.h:258
llvm::orc::JITTargetMachineBuilder::detectHost
static Expected< JITTargetMachineBuilder > detectHost()
Create a JITTargetMachineBuilder for the host system.
Definition: JITTargetMachineBuilder.cpp:24
LLVMOrcMaterializationResponsibilityGetSymbols
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs)
Returns the symbol flags map for this responsibility instance.
Definition: OrcV2CBindings.cpp:420
llvm::codeview::WindowsRTClassKind::Interface
@ Interface
LLVMOrcLLJITMangleAndIntern
LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName)
Mangles the given string according to the LLJIT instance's DataLayout, then interns the result in the...
Definition: OrcV2CBindings.cpp:909
LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction
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
LLVMOrcMaterializationResponsibilityGetTargetDylib
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(LLVMOrcMaterializationResponsibilityRef MR)
Returns the target JITDylib that these symbols are being materialized into.
Definition: OrcV2CBindings.cpp:409
llvm::orc::SymbolLookupFlags::WeaklyReferencedSymbol
@ WeaklyReferencedSymbol
RTDyldObjectLinkingLayer.h
llvm::orc::OrcV2CAPIHelper::extractLookupState
static InProgressLookupState * extractLookupState(LookupState &LS)
Definition: OrcV2CBindings.cpp:66
LLVMOrcJITTargetMachineBuilderGetTargetTriple
char * LLVMOrcJITTargetMachineBuilderGetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB)
Returns the target triple for the given JITTargetMachineBuilder as a string.
Definition: OrcV2CBindings.cpp:748
llvm::orc::SymbolLookupSet::size
UnderlyingVector::size_type size() const
Definition: Core.h:251
LLVMOrcErrorReporterFunction
void(* LLVMOrcErrorReporterFunction)(void *Ctx, LLVMErrorRef Err)
Error reporter function.
Definition: Orc.h:92
LLVMOrcObjectLayerEmit
void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer)
Emit an object buffer to an ObjectLayer.
Definition: OrcV2CBindings.cpp:776
LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM)
Create a JITTargetMachineBuilder from the given TargetMachine template.
Definition: OrcV2CBindings.cpp:724
LLVMOrcLLJITGetObjTransformLayer
LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
Definition: OrcV2CBindings.cpp:963
LLVMOrcJITDylibRef
struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
A reference to an orc::JITDylib instance.
Definition: Orc.h:158
llvm::DenseSet< SymbolStringPtr >
LLVMOrcDisposeIndirectStubsManager
void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM)
Dispose of an IndirectStubsManager.
Definition: OrcV2CBindings.cpp:998
llvm::ClrHandlerType::Filter
@ Filter
LLVMOrcResourceTrackerRef
struct LLVMOrcOpaqueResourceTracker * LLVMOrcResourceTrackerRef
A reference to an orc::ResourceTracker instance.
Definition: Orc.h:282
LLVMJITSymbolGenericFlagsWeak
@ LLVMJITSymbolGenericFlagsWeak
Definition: Orc.h:58
LLVMOrcCreateNewThreadSafeModule
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
Create a ThreadSafeModule wrapper around the given LLVM module.
Definition: OrcV2CBindings.cpp:699
LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib.
Definition: OrcV2CBindings.cpp:597
LLVMOrcExecutionSessionRef
struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
A reference to an orc::ExecutionSession instance.
Definition: Orc.h:87
llvm::orc::createLocalIndirectStubsManagerBuilder
std::function< std::unique_ptr< IndirectStubsManager >)> createLocalIndirectStubsManagerBuilder(const Triple &T)
Create a local indriect stubs manager builder.
Definition: IndirectionUtils.cpp:174
llvm::ARM_AM::add
@ add
Definition: ARMAddressingModes.h:39
LLVMOrcReleaseSymbolStringPoolEntry
void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Reduces the ref-count for of a SymbolStringPool entry.
Definition: OrcV2CBindings.cpp:314
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::DenseMap< SymbolStringPtr, JITSymbolFlags >
LLVMOrcCreateLLJITBuilder
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void)
Create an LLVMOrcLLJITBuilder.
Definition: OrcV2CBindings.cpp:843
I
#define I(x, y, z)
Definition: MD5.cpp:58
LLVMOrcMaterializationResponsibilityNotifyResolved
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumPairs)
Definition: OrcV2CBindings.cpp:469
LLVMOrcSymbolLookupFlagsRequiredSymbol
@ LLVMOrcSymbolLookupFlagsRequiredSymbol
Definition: Orc.h:210
llvm::JITSymbolFlags::Callable
@ Callable
Definition: JITSymbol.h:86
LLVMOrcLLJITGetDataLayoutStr
const char * LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J)
Get the LLJIT instance's default data layout string.
Definition: OrcV2CBindings.cpp:988
LLVMOrcMaterializationResponsibilityDelegate
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result)
Delegates responsibility for the given symbols to the returned materialization responsibility.
Definition: OrcV2CBindings.cpp:499
LLVMOrcMaterializationResponsibilityReplace
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU)
Transfers responsibility to the given MaterializationUnit for all symbols defined by that Materializa...
Definition: OrcV2CBindings.cpp:492
LLVMOrcLLJITRef
struct LLVMOrcOpaqueLLJIT * LLVMOrcLLJITRef
A reference to an orc::LLJIT instance.
Definition: LLJIT.h:66
llvm::orc::ResourceTrackerSP
uint8_t IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
Definition: Core.h:47
LLVMOrcExecutionSessionCreateJITDylib
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
Create a JITDylib.
Definition: OrcV2CBindings.cpp:555
LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener
void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(LLVMOrcObjectLayerRef RTDyldObjLinkingLayer, LLVMJITEventListenerRef Listener)
Add the given listener to the given RTDyldObjectLinkingLayer.
Definition: OrcV2CBindings.cpp:975
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1663
LLVMOrcSymbolLookupFlags
LLVMOrcSymbolLookupFlags
Symbol lookup flags for lookup sets.
Definition: Orc.h:209
std::swap
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:853
LLVMOrcCreateDumpObjects
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir, const char *IdentifierOverride)
Create a DumpObjects instance.
Definition: OrcV2CBindings.cpp:820
LLVMOrcExecutionSessionIntern
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name)
Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it.
Definition: OrcV2CBindings.cpp:305
llvm::orc::OrcV2CAPIHelper::resetLookupState
static void resetLookupState(LookupState &LS, InProgressLookupState *IPLS)
Definition: OrcV2CBindings.cpp:70
llvm::orc::ThreadSafeContext
An LLVMContext together with an associated mutex that can be used to lock the context to prevent conc...
Definition: ThreadSafeModule.h:29
LLVMOrcJITDylibDefine
LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
Add the given MaterializationUnit to the given JITDylib.
Definition: OrcV2CBindings.cpp:571
LLVMOrcSymbolStringPoolClearDeadEntries
void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP)
Clear all unreferenced symbol string pool entries.
Definition: OrcV2CBindings.cpp:300
LLVMOrcObjectLayerAddObjectFile
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add an object to an ObjectLayer to the given JITDylib.
Definition: OrcV2CBindings.cpp:761
LLVMOrcDisposeObjectLayer
void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer)
Dispose of an ObjectLayer.
Definition: OrcV2CBindings.cpp:784
LLVMOrcAbsoluteSymbols
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw address...
Definition: OrcV2CBindings.cpp:379
LLVMOrcExecutionSessionSetErrorReporter
void LLVMOrcExecutionSessionSetErrorReporter(LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
Attach a custom error reporter function to the ExecutionSession.
Definition: OrcV2CBindings.cpp:287
llvm::orc::DumpObjects
A function object that can be used as an ObjectTransformLayer transform to dump object files to disk ...
Definition: DebugUtils.h:97
llvm::orc::DefinitionGenerator
Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolv...
Definition: Core.h:912
LLVMOrcDisposeMaterializationUnit
void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU)
Dispose of a MaterializationUnit.
Definition: OrcV2CBindings.cpp:357
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
LLVMOrcCSymbolAliasMapPair
Represents a pair of a symbol name and SymbolAliasMapEntry.
Definition: Orc.h:144
LLVMOrcCreateCustomCAPIDefinitionGenerator
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx)
Create a custom generator.
Definition: OrcV2CBindings.cpp:591
LLVMOrcLLJITBuilderRef
struct LLVMOrcOpaqueLLJITBuilder * LLVMOrcLLJITBuilderRef
A reference to an orc::LLJITBuilder instance.
Definition: LLJIT.h:61
Builder
assume Assume Builder
Definition: AssumeBundleBuilder.cpp:651
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition: Attributes.h:259
LLVMDisposeTargetMachine
void LLVMDisposeTargetMachine(LLVMTargetMachineRef T)
Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.
Definition: TargetMachineC.cpp:150
LLVMOrcCreateLLJIT
LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result, LLVMOrcLLJITBuilderRef Builder)
Create an LLJIT instance from an LLJITBuilder.
Definition: OrcV2CBindings.cpp:868
llvm::JITSymbolFlags::Weak
@ Weak
Definition: JITSymbol.h:82
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr
static SymbolStringPtr moveToSymbolStringPtr(PoolEntryPtr P)
Definition: OrcV2CBindings.cpp:41
LLVMOrcCreateNewThreadSafeContext
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void)
Create a ThreadSafeContext containing a new LLVMContext.
Definition: OrcV2CBindings.cpp:677
llvm::orc::createLocalLazyCallThroughManager
Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES, JITTargetAddress ErrorHandlerAddr)
Create a LocalLazyCallThroughManager from the given triple and execution session.
Definition: LazyReexports.cpp:106
LLJIT.h
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
LLVMJITSymbolFlags
Represents the linkage flags for a symbol definition.
Definition: Orc.h:71
llvm::orc::LookupState
Wraps state for a lookup-in-progress.
Definition: Core.h:887
LLVMOrcJITDylibAddGenerator
void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
Add a DefinitionGenerator to the given JITDylib.
Definition: OrcV2CBindings.cpp:586
llvm::orc::StaticLibraryDefinitionGenerator::Load
static Expected< std::unique_ptr< StaticLibraryDefinitionGenerator > > Load(ObjectLayer &L, const char *FileName, GetObjectFileInterface GetObjFileInterface=GetObjectFileInterface())
Try to create a StaticLibraryDefinitionGenerator from the given path.
Definition: ExecutionUtils.cpp:273
LLVMOrcDisposeThreadSafeContext
void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx)
Dispose of a ThreadSafeContext.
Definition: OrcV2CBindings.cpp:686
llvm::orc::SymbolAliasMapEntry
Definition: Core.h:382
LLVMOrcLLJITGetTripleString
const char * LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J)
Return the target triple for this LLJIT instance.
Definition: OrcV2CBindings.cpp:900
LLVMOrcObjectTransformLayerTransformFunction
LLVMErrorRef(* LLVMOrcObjectTransformLayerTransformFunction)(void *Ctx, LLVMMemoryBufferRef *ObjInOut)
A function for applying transformations to an object file buffer.
Definition: Orc.h:425
LLVMOrcDisposeLLJITBuilder
void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder)
Dispose of an LLVMOrcLLJITBuilderRef.
Definition: OrcV2CBindings.cpp:847
LLVMOrcMaterializationUnitDestroyFunction
void(* LLVMOrcMaterializationUnitDestroyFunction)(void *Ctx)
A MaterializationUnit destruction callback.
Definition: Orc.h:277
LLVMOrcMaterializationResponsibilityDefineMaterializing
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms)
Attempt to claim responsibility for new definitions.
Definition: OrcV2CBindings.cpp:481
llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess
static Expected< std::unique_ptr< DynamicLibrarySearchGenerator > > GetForCurrentProcess(char GlobalPrefix, SymbolPredicate Allow=SymbolPredicate())
Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process.
Definition: ExecutionUtils.h:239
llvm::orc::OrcV2CAPIHelper::copyToSymbolStringPtr
static SymbolStringPtr copyToSymbolStringPtr(PoolEntryPtr P)
Definition: OrcV2CBindings.cpp:48
LLVMOrcReleaseResourceTracker
void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT)
Reduces the ref-count of a ResourceTracker.
Definition: OrcV2CBindings.cpp:337
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
std
Definition: BitVector.h:851
TargetMachine.h
LLVMOrcCDependenceMapPair::Names
LLVMOrcCSymbolsList Names
Definition: Orc.h:174
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
llvm::orc::OrcV2CAPIHelper
Definition: OrcV2CBindings.cpp:28
LLVMOrcDumpObjectsRef
struct LLVMOrcOpaqueDumpObjects * LLVMOrcDumpObjectsRef
A reference to an orc::DumpObjects object.
Definition: Orc.h:446
LLVMOrcGenericIRModuleOperationFunction
LLVMErrorRef(* LLVMOrcGenericIRModuleOperationFunction)(void *Ctx, LLVMModuleRef M)
A function for inspecting/mutating IR modules, suitable for use with LLVMOrcThreadSafeModuleWithModul...
Definition: Orc.h:363
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::orc::ExecutionSession
An ExecutionSession represents a running JIT program.
Definition: Core.h:1359
llvm::orc::JITDylibLookupFlags::MatchExportedSymbolsOnly
@ MatchExportedSymbolsOnly
llvm::AArch64CC::LS
@ LS
Definition: AArch64BaseInfo.h:264
LLVMOrcDisposeMaterializationResponsibility
void LLVMOrcDisposeMaterializationResponsibility(LLVMOrcMaterializationResponsibilityRef MR)
Disposes of the passed MaterializationResponsibility object.
Definition: OrcV2CBindings.cpp:404
LLVMOrcLLJITGetIRTransformLayer
LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's IR transform layer.
Definition: OrcV2CBindings.cpp:984
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(OrcV2CAPIHelper::PoolEntry, LLVMOrcSymbolStringPoolEntryRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MaterializationUnit
LLVMOrcLLJITBuilderSetJITTargetMachineBuilder
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB)
Set the JITTargetMachineBuilder to be used when constructing the LLJIT instance.
Definition: OrcV2CBindings.cpp:851
llvm::orc::absoluteSymbols
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
Definition: Core.h:757
LLVMOrcSymbolStringPoolEntryStr
const char * LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S)
Definition: OrcV2CBindings.cpp:318
LLVMOrcDefinitionGeneratorRef
struct LLVMOrcOpaqueDefinitionGenerator * LLVMOrcDefinitionGeneratorRef
A reference to an orc::DefinitionGenerator.
Definition: Orc.h:287
LLVMOrcResourceTrackerTransferTo
void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
Definition: OrcV2CBindings.cpp:342
LLVMOrcJITDylibCreateResourceTracker
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD)
Return a reference to a newly created resource tracker associated with JD.
Definition: OrcV2CBindings.cpp:323
LLVMOrcMaterializationResponsibilityGetExecutionSession
LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession(LLVMOrcMaterializationResponsibilityRef MR)
Returns the ExecutionSession for this MaterializationResponsibility.
Definition: OrcV2CBindings.cpp:415
LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
@ LLVMOrcSymbolLookupFlagsWeaklyReferencedSymbol
Definition: Orc.h:211
llvm::orc::IRTransformLayer
A layer that applies a transform to emitted modules.
Definition: IRTransformLayer.h:27
LLVMOrcJITTargetMachineBuilderSetTargetTriple
void LLVMOrcJITTargetMachineBuilderSetTargetTriple(LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple)
Sets the target triple for the given JITTargetMachineBuilder to the given string.
Definition: OrcV2CBindings.cpp:756
llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr
static PoolEntryPtr getRawPoolEntryPtr(const SymbolStringPtr &S)
Definition: OrcV2CBindings.cpp:52
LLVMOrcDisposeDefinitionGenerator
void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG)
Dispose of a JITDylib::DefinitionGenerator.
Definition: OrcV2CBindings.cpp:353
LLVMOrcCreateLocalIndirectStubsManager
LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple)
Create a LocalIndirectStubsManager from the given target triple.
Definition: OrcV2CBindings.cpp:993
llvm::orc::DynamicLibrarySearchGenerator::SymbolPredicate
std::function< bool(const SymbolStringPtr &)> SymbolPredicate
Definition: ExecutionUtils.h:218
LLVMOrcLLJITAddObjectFile
LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
Add a buffer representing an object file to the given JITDylib in the given LLJIT instance.
Definition: OrcV2CBindings.cpp:914
OrcEE.h
SectionMemoryManager.h
LLVMErrorRef
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
Definition: Error.h:33
llvm::orc::DynamicLibrarySearchGenerator::Load
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...
Definition: ExecutionUtils.cpp:228
LLVMOrcJITTargetMachineBuilderRef
struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
A reference to an orc::JITTargetMachineBuilder instance.
Definition: Orc.h:369
LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
@ LLVMOrcJITDylibLookupFlagsMatchExportedSymbolsOnly
Definition: Orc.h:201
llvm::orc::ObjectTransformLayer
Definition: ObjectTransformLayer.h:24
LLVMOrcCreateStaticLibrarySearchGeneratorForPath
LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer, const char *FileName, const char *TargetTriple)
Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect static library symbols into ...
Definition: OrcV2CBindings.cpp:648
LLVMOrcIRTransformLayerTransformFunction
LLVMErrorRef(* LLVMOrcIRTransformLayerTransformFunction)(void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut, LLVMOrcMaterializationResponsibilityRef MR)
A function for applying transformations as part of an transform layer.
Definition: Orc.h:402
LLVMOrcExecutionSessionGetJITDylibByName
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, const char *Name)
Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
Definition: OrcV2CBindings.cpp:566
LLVMMemoryBufferRef
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:48
llvm::orc::ThreadSafeModule
An LLVM Module together with a shared ThreadSafeContext.
Definition: ThreadSafeModule.h:77
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
LLVMOrcMaterializationResponsibilityFailMaterialization
void LLVMOrcMaterializationResponsibilityFailMaterialization(LLVMOrcMaterializationResponsibilityRef MR)
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has o...
Definition: OrcV2CBindings.cpp:534
llvm::orc::JITDylibLookupFlags
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
Definition: Core.h:127
LLVMOrcLLJITAddLLVMIRModule
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM)
Add an IR module to the given JITDylib in the given LLJIT instance.
Definition: OrcV2CBindings.cpp:928
LLVMOrcRetainSymbolStringPoolEntry
void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S)
Increments the ref-count for a SymbolStringPool entry.
Definition: OrcV2CBindings.cpp:310
LLVMOrcDisposeSymbols
void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols)
Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .
Definition: OrcV2CBindings.cpp:465
LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(LLVMOrcLLJITBuilderRef Builder, LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx)
Set an ObjectLinkingLayer creator function for this LLJIT instance.
Definition: OrcV2CBindings.cpp:857
llvm::orc::JITDylibLookupFlags::MatchAllSymbols
@ MatchAllSymbols
LLVMOrcResourceTrackerRemove
LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT)
Remove all resources associated with the given tracker.
Definition: OrcV2CBindings.cpp:348
llvm::orc::SymbolLookupFlags::RequiredSymbol
@ RequiredSymbol
LLVMJITCSymbolMapPair
Represents a pair of a symbol name and an evaluated symbol.
Definition: Orc.h:122
LLVMOrcThreadSafeContextRef
struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
A reference to an orc::ThreadSafeContext instance.
Definition: Orc.h:352
LLVMOrcMaterializationResponsibilityGetInitializerSymbol
LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol(LLVMOrcMaterializationResponsibilityRef MR)
Returns the initialization pseudo-symbol, if any.
Definition: OrcV2CBindings.cpp:442
llvm::orc::IRLayer
Interface for layers that accept LLVM IR.
Definition: Layer.h:67
LLVMJITEventListenerRef
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
Definition: Types.h:163
LLVMOrcLLJITAddObjectFileWithRT
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
Definition: OrcV2CBindings.cpp:768
JITTargetMachineBuilder.h
llvm::safe_malloc
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
Definition: MemAlloc.h:25
LLVMTargetMachineRef
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:34
LLVMOrcLLJITGetObjLinkingLayer
LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J)
Returns a non-owning reference to the LLJIT instance's object linking layer.
Definition: OrcV2CBindings.cpp:958
LLVMOrcLLJITGetMainJITDylib
LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J)
Return a reference to the Main JITDylib.
Definition: OrcV2CBindings.cpp:896
LLVMOrcLLJITGetGlobalPrefix
char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J)
Returns the global prefix character according to the LLJIT's DataLayout.
Definition: OrcV2CBindings.cpp:904
LLVMOrcJITTargetAddress
uint64_t LLVMOrcJITTargetAddress
Represents an address in the executor process.
Definition: Orc.h:46
LLVMModuleRef
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
llvm::JITSymbolFlags::Exported
@ Exported
Definition: JITSymbol.h:85
LLVMOrcCreateLocalLazyCallThroughManager
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *Result)
Definition: OrcV2CBindings.cpp:1002