@@ -113,6 +113,7 @@ class RustMCJITMemoryManager : public JITMemoryManager {
113
113
114
114
virtual uint8_t *allocateDataSection (uintptr_t Size , unsigned Alignment,
115
115
unsigned SectionID, bool isReadOnly);
116
+ bool finalizeMemory (std::string *ErrMsg) { return false ; }
116
117
117
118
virtual bool applyPermissions (std::string *Str);
118
119
@@ -340,7 +341,6 @@ LLVMRustBuildJIT(void* mem,
340
341
341
342
std::string Err;
342
343
TargetOptions Options;
343
- Options.JITExceptionHandling = true ;
344
344
Options.JITEmitDebugInfo = true ;
345
345
Options.NoFramePointerElim = true ;
346
346
Options.EnableSegmentedStacks = EnableSegmentedStacks;
@@ -513,15 +513,6 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
513
513
return wrap (unwrap (B)->CreateAtomicCmpXchg (unwrap (target), unwrap (old),
514
514
unwrap (source), order));
515
515
}
516
- extern " C" LLVMValueRef LLVMBuildAtomicRMW (LLVMBuilderRef B,
517
- AtomicRMWInst::BinOp op,
518
- LLVMValueRef target,
519
- LLVMValueRef source,
520
- AtomicOrdering order) {
521
- return wrap (unwrap (B)->CreateAtomicRMW (op,
522
- unwrap (target), unwrap (source),
523
- order));
524
- }
525
516
526
517
extern " C" void LLVMSetDebug (int Enabled) {
527
518
#ifndef NDEBUG
@@ -565,8 +556,8 @@ extern "C" bool LLVMRustStartMultithreading() {
565
556
typedef DIBuilder* DIBuilderRef;
566
557
567
558
template <typename DIT>
568
- DIT unwrapDI (LLVMValueRef ref) {
569
- return DIT (ref ? unwrap<MDNode>(ref) : NULL );
559
+ DIT unwrapDI (LLVMValueRef ref) {
560
+ return DIT (ref ? unwrap<MDNode>(ref) : NULL );
570
561
}
571
562
572
563
extern " C" DIBuilderRef LLVMDIBuilderCreate (LLVMModuleRef M) {
@@ -604,21 +595,21 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateFile(
604
595
605
596
extern " C" LLVMValueRef LLVMDIBuilderCreateSubroutineType (
606
597
DIBuilderRef Builder,
607
- LLVMValueRef File,
598
+ LLVMValueRef File,
608
599
LLVMValueRef ParameterTypes) {
609
600
return wrap (Builder->createSubroutineType (
610
- unwrapDI<DIFile>(File),
601
+ unwrapDI<DIFile>(File),
611
602
unwrapDI<DIArray>(ParameterTypes)));
612
603
}
613
604
614
605
extern " C" LLVMValueRef LLVMDIBuilderCreateFunction (
615
606
DIBuilderRef Builder,
616
- LLVMValueRef Scope,
607
+ LLVMValueRef Scope,
617
608
const char * Name,
618
609
const char * LinkageName,
619
- LLVMValueRef File,
610
+ LLVMValueRef File,
620
611
unsigned LineNo,
621
- LLVMValueRef Ty,
612
+ LLVMValueRef Ty,
622
613
bool isLocalToUnit,
623
614
bool isDefinition,
624
615
unsigned ScopeLine,
@@ -628,11 +619,11 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateFunction(
628
619
LLVMValueRef TParam,
629
620
LLVMValueRef Decl) {
630
621
return wrap (Builder->createFunction (
631
- unwrapDI<DIScope >(Scope), Name, LinkageName,
632
- unwrapDI<DIFile>(File), LineNo,
633
- unwrapDI<DIType >(Ty), isLocalToUnit, isDefinition, ScopeLine,
622
+ unwrapDI<DIDescriptor >(Scope), Name, LinkageName,
623
+ unwrapDI<DIFile>(File), LineNo,
624
+ unwrapDI<DICompositeType >(Ty), isLocalToUnit, isDefinition, ScopeLine,
634
625
Flags, isOptimized,
635
- unwrap<Function>(Fn),
626
+ unwrap<Function>(Fn),
636
627
unwrapDI<MDNode*>(TParam),
637
628
unwrapDI<MDNode*>(Decl)));
638
629
}
@@ -644,10 +635,10 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateBasicType(
644
635
uint64_t AlignInBits,
645
636
unsigned Encoding) {
646
637
return wrap (Builder->createBasicType (
647
- Name, SizeInBits,
638
+ Name, SizeInBits,
648
639
AlignInBits, Encoding));
649
640
}
650
-
641
+
651
642
extern " C" LLVMValueRef LLVMDIBuilderCreatePointerType (
652
643
DIBuilderRef Builder,
653
644
LLVMValueRef PointeeTy,
@@ -672,11 +663,11 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateStructType(
672
663
unsigned RunTimeLang,
673
664
LLVMValueRef VTableHolder) {
674
665
return wrap (Builder->createStructType (
675
- unwrapDI<DIDescriptor>(Scope), Name,
676
- unwrapDI<DIFile>(File), LineNumber,
677
- SizeInBits, AlignInBits, Flags,
678
- unwrapDI<DIType>(DerivedFrom),
679
- unwrapDI<DIArray>(Elements), RunTimeLang,
666
+ unwrapDI<DIDescriptor>(Scope), Name,
667
+ unwrapDI<DIFile>(File), LineNumber,
668
+ SizeInBits, AlignInBits, Flags,
669
+ unwrapDI<DIType>(DerivedFrom),
670
+ unwrapDI<DIArray>(Elements), RunTimeLang,
680
671
unwrapDI<MDNode*>(VTableHolder)));
681
672
}
682
673
@@ -692,23 +683,23 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateMemberType(
692
683
unsigned Flags,
693
684
LLVMValueRef Ty) {
694
685
return wrap (Builder->createMemberType (
695
- unwrapDI<DIDescriptor>(Scope), Name,
686
+ unwrapDI<DIDescriptor>(Scope), Name,
696
687
unwrapDI<DIFile>(File), LineNo,
697
- SizeInBits, AlignInBits, OffsetInBits, Flags,
688
+ SizeInBits, AlignInBits, OffsetInBits, Flags,
698
689
unwrapDI<DIType>(Ty)));
699
690
}
700
-
691
+
701
692
extern " C" LLVMValueRef LLVMDIBuilderCreateLexicalBlock (
702
693
DIBuilderRef Builder,
703
694
LLVMValueRef Scope,
704
695
LLVMValueRef File,
705
696
unsigned Line,
706
697
unsigned Col) {
707
698
return wrap (Builder->createLexicalBlock (
708
- unwrapDI<DIDescriptor>(Scope),
699
+ unwrapDI<DIDescriptor>(Scope),
709
700
unwrapDI<DIFile>(File), Line, Col));
710
701
}
711
-
702
+
712
703
extern " C" LLVMValueRef LLVMDIBuilderCreateLocalVariable (
713
704
DIBuilderRef Builder,
714
705
unsigned Tag,
@@ -720,45 +711,45 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateLocalVariable(
720
711
bool AlwaysPreserve,
721
712
unsigned Flags,
722
713
unsigned ArgNo) {
723
- return wrap (Builder->createLocalVariable (Tag,
724
- unwrapDI<DIDescriptor>(Scope), Name,
725
- unwrapDI<DIFile>(File),
726
- LineNo,
714
+ return wrap (Builder->createLocalVariable (Tag,
715
+ unwrapDI<DIDescriptor>(Scope), Name,
716
+ unwrapDI<DIFile>(File),
717
+ LineNo,
727
718
unwrapDI<DIType>(Ty), AlwaysPreserve, Flags, ArgNo));
728
719
}
729
720
730
721
extern " C" LLVMValueRef LLVMDIBuilderCreateArrayType (
731
722
DIBuilderRef Builder,
732
- uint64_t Size ,
733
- uint64_t AlignInBits,
734
- LLVMValueRef Ty,
723
+ uint64_t Size ,
724
+ uint64_t AlignInBits,
725
+ LLVMValueRef Ty,
735
726
LLVMValueRef Subscripts) {
736
727
return wrap (Builder->createArrayType (Size , AlignInBits,
737
- unwrapDI<DIType>(Ty),
728
+ unwrapDI<DIType>(Ty),
738
729
unwrapDI<DIArray>(Subscripts)));
739
730
}
740
731
741
732
extern " C" LLVMValueRef LLVMDIBuilderCreateVectorType (
742
733
DIBuilderRef Builder,
743
- uint64_t Size ,
744
- uint64_t AlignInBits,
745
- LLVMValueRef Ty,
734
+ uint64_t Size ,
735
+ uint64_t AlignInBits,
736
+ LLVMValueRef Ty,
746
737
LLVMValueRef Subscripts) {
747
738
return wrap (Builder->createVectorType (Size , AlignInBits,
748
- unwrapDI<DIType>(Ty),
739
+ unwrapDI<DIType>(Ty),
749
740
unwrapDI<DIArray>(Subscripts)));
750
741
}
751
742
752
743
extern " C" LLVMValueRef LLVMDIBuilderGetOrCreateSubrange (
753
- DIBuilderRef Builder,
754
- int64_t Lo,
744
+ DIBuilderRef Builder,
745
+ int64_t Lo,
755
746
int64_t Count) {
756
747
return wrap (Builder->getOrCreateSubrange (Lo, Count));
757
748
}
758
749
759
750
extern " C" LLVMValueRef LLVMDIBuilderGetOrCreateArray (
760
751
DIBuilderRef Builder,
761
- LLVMValueRef* Ptr ,
752
+ LLVMValueRef* Ptr ,
762
753
unsigned Count) {
763
754
return wrap (Builder->getOrCreateArray (
764
755
ArrayRef<Value*>(reinterpret_cast <Value**>(Ptr ), Count)));
@@ -770,8 +761,8 @@ extern "C" LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
770
761
LLVMValueRef VarInfo,
771
762
LLVMBasicBlockRef InsertAtEnd) {
772
763
return wrap (Builder->insertDeclare (
773
- unwrap (Val),
774
- unwrapDI<DIVariable>(VarInfo),
764
+ unwrap (Val),
765
+ unwrapDI<DIVariable>(VarInfo),
775
766
unwrap (InsertAtEnd)));
776
767
}
777
768
@@ -781,7 +772,7 @@ extern "C" LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
781
772
LLVMValueRef VarInfo,
782
773
LLVMValueRef InsertBefore) {
783
774
return wrap (Builder->insertDeclare (
784
- unwrap (Val),
785
- unwrapDI<DIVariable>(VarInfo),
775
+ unwrap (Val),
776
+ unwrapDI<DIVariable>(VarInfo),
786
777
unwrap<Instruction>(InsertBefore)));
787
778
}
0 commit comments