@@ -481,22 +481,12 @@ JL_DLLEXPORT void ORCNotifyObjectEmitted(JITEventListener *Listener,
481
481
const RuntimeDyld::LoadedObjectInfo &L,
482
482
RTDyldMemoryManager *memmgr);
483
483
484
- #if JL_LLVM_VERSION >= 120000
485
484
template <typename ObjT, typename LoadResult>
486
485
void JuliaOJIT::registerObject (const ObjT &Obj, const LoadResult &LO)
487
486
{
488
487
const ObjT* Object = &Obj;
489
488
ORCNotifyObjectEmitted (JuliaListener.get (), *Object, *LO, MemMgr.get ());
490
489
}
491
- #else
492
- template <typename ObjT, typename LoadResult>
493
- void JuliaOJIT::registerObject (RTDyldObjHandleT H, const ObjT &Obj, const LoadResult &LO)
494
- {
495
- const ObjT* Object = &Obj;
496
- NotifyFinalizer (H, *Object, *LO);
497
- ORCNotifyObjectEmitted (JuliaListener.get (), *Object, *LO, MemMgr.get ());
498
- }
499
- #endif
500
490
501
491
CodeGenOpt::Level CodeGenOptLevelFor (int optlevel)
502
492
{
@@ -636,21 +626,12 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM, LLVMContext *LLVMCtx)
636
626
),
637
627
CompileLayer (ES, ObjectLayer, std::make_unique<CompilerT>(this ))
638
628
{
639
- #if JL_LLVM_VERSION >= 120000
640
629
ObjectLayer.setNotifyLoaded (
641
630
[this ](orc::MaterializationResponsibility &MR,
642
631
const object::ObjectFile &Object,
643
632
const RuntimeDyld::LoadedObjectInfo &LOS) {
644
633
registerObject (Object, &LOS);
645
634
});
646
- #else
647
- ObjectLayer.setNotifyLoaded (
648
- [this ](RTDyldObjHandleT H,
649
- const object::ObjectFile &Object,
650
- const RuntimeDyld::LoadedObjectInfo &LOS) {
651
- registerObject (H, Object, &LOS);
652
- });
653
- #endif
654
635
for (int i = 0 ; i < 4 ; i++) {
655
636
TMs[i] = TM.getTarget ().createTargetMachine (TM.getTargetTriple ().getTriple (), TM.getTargetCPU (),
656
637
TM.getTargetFeatureString (), TM.Options , Reloc::Static, TM.getCodeModel (),
@@ -734,28 +715,15 @@ void JuliaOJIT::addModule(std::unique_ptr<Module> M)
734
715
}
735
716
}
736
717
#endif
737
- #if JL_LLVM_VERSION >= 120000
738
718
// TODO: what is the performance characteristics of this?
739
719
cantFail (CompileLayer.add (JD, orc::ThreadSafeModule (std::move (M), TSCtx)));
740
- #else
741
- auto key = ES.allocateVModule ();
742
- // TODO: what is the performance characteristics of this?
743
- cantFail (CompileLayer.add (JD, orc::ThreadSafeModule (std::move (M), TSCtx), key));
744
- #endif
745
720
// force eager compilation (for now), due to memory management specifics
746
721
// (can't handle compilation recursion)
747
722
for (auto Name : NewExports)
748
723
cantFail (ES.lookup ({&JD}, Name));
749
724
750
725
}
751
726
752
- #if JL_LLVM_VERSION < 120000
753
- void JuliaOJIT::removeModule (ModuleHandleT H)
754
- {
755
- // (void)CompileLayer.remove(H);
756
- }
757
- #endif
758
-
759
727
JL_JITSymbol JuliaOJIT::findSymbol (StringRef Name, bool ExportedSymbolsOnly)
760
728
{
761
729
orc::JITDylib* SearchOrders[2 ] = {&GlobalJD, &JD};
@@ -825,22 +793,8 @@ void JuliaOJIT::RegisterJITEventListener(JITEventListener *L)
825
793
{
826
794
if (!L)
827
795
return ;
828
- #if JL_LLVM_VERSION >= 120000
829
796
this ->ObjectLayer .registerJITEventListener (*L);
830
- #else
831
- EventListeners.push_back (L);
832
- #endif
833
- }
834
-
835
- #if JL_LLVM_VERSION < 120000
836
- void JuliaOJIT::NotifyFinalizer (RTDyldObjHandleT Key,
837
- const object::ObjectFile &Obj,
838
- const RuntimeDyld::LoadedObjectInfo &LoadedObjectInfo)
839
- {
840
- for (auto &Listener : EventListeners)
841
- Listener->notifyObjectLoaded (Key, Obj, LoadedObjectInfo);
842
797
}
843
- #endif
844
798
845
799
const DataLayout& JuliaOJIT::getDataLayout () const
846
800
{
0 commit comments