@@ -335,14 +335,17 @@ class ReflectionContext
335
335
ObjectFileFormat.getSectionName (ReflectionSectionKind::reflstr));
336
336
auto ConformMdSec = findMachOSectionByName (
337
337
ObjectFileFormat.getSectionName (ReflectionSectionKind::conform));
338
+ auto MPEnumMdSec = findMachOSectionByName (
339
+ ObjectFileFormat.getSectionName (ReflectionSectionKind::mpenum));
338
340
339
341
if (FieldMdSec.first == nullptr &&
340
342
AssocTySec.first == nullptr &&
341
343
BuiltinTySec.first == nullptr &&
342
344
CaptureSec.first == nullptr &&
343
345
TypeRefMdSec.first == nullptr &&
344
346
ReflStrMdSec.first == nullptr &&
345
- ConformMdSec.first == nullptr )
347
+ ConformMdSec.first == nullptr &&
348
+ MPEnumMdSec.first == nullptr )
346
349
return {};
347
350
348
351
ReflectionInfo info = {{FieldMdSec.first , FieldMdSec.second },
@@ -352,6 +355,7 @@ class ReflectionContext
352
355
{TypeRefMdSec.first , TypeRefMdSec.second },
353
356
{ReflStrMdSec.first , ReflStrMdSec.second },
354
357
{ConformMdSec.first , ConformMdSec.second },
358
+ {MPEnumMdSec.first , MPEnumMdSec.second },
355
359
PotentialModuleNames};
356
360
357
361
auto InfoID = this ->addReflectionInfo (info);
@@ -466,14 +470,17 @@ class ReflectionContext
466
470
ObjectFileFormat.getSectionName (ReflectionSectionKind::reflstr));
467
471
auto ConformMdSec = findCOFFSectionByName (
468
472
ObjectFileFormat.getSectionName (ReflectionSectionKind::conform));
473
+ auto MPEnumMdSec = findCOFFSectionByName (
474
+ ObjectFileFormat.getSectionName (ReflectionSectionKind::mpenum));
469
475
470
476
if (FieldMdSec.first == nullptr &&
471
477
AssocTySec.first == nullptr &&
472
478
BuiltinTySec.first == nullptr &&
473
479
CaptureSec.first == nullptr &&
474
480
TypeRefMdSec.first == nullptr &&
475
481
ReflStrMdSec.first == nullptr &&
476
- ConformMdSec.first == nullptr )
482
+ ConformMdSec.first == nullptr &&
483
+ MPEnumMdSec.first == nullptr )
477
484
return {};
478
485
479
486
ReflectionInfo Info = {{FieldMdSec.first , FieldMdSec.second },
@@ -483,6 +490,7 @@ class ReflectionContext
483
490
{TypeRefMdSec.first , TypeRefMdSec.second },
484
491
{ReflStrMdSec.first , ReflStrMdSec.second },
485
492
{ConformMdSec.first , ConformMdSec.second },
493
+ {MPEnumMdSec.first , MPEnumMdSec.second },
486
494
PotentialModuleNames};
487
495
return this ->addReflectionInfo (Info);
488
496
}
@@ -679,6 +687,9 @@ class ReflectionContext
679
687
ObjectFileFormat.getSectionName (ReflectionSectionKind::reflstr), true );
680
688
auto ConformMdSec = findELFSectionByName (
681
689
ObjectFileFormat.getSectionName (ReflectionSectionKind::conform), true );
690
+ auto MPEnumMdSec = findELFSectionByName (
691
+ ObjectFileFormat.getSectionName (ReflectionSectionKind::mpenum), true );
692
+
682
693
if (Error)
683
694
return {};
684
695
@@ -688,14 +699,15 @@ class ReflectionContext
688
699
// ELF executable.
689
700
if (FieldMdSec.first || AssocTySec.first || BuiltinTySec.first ||
690
701
CaptureSec.first || TypeRefMdSec.first || ReflStrMdSec.first ||
691
- ConformMdSec.first ) {
702
+ ConformMdSec.first || MPEnumMdSec. first ) {
692
703
ReflectionInfo info = {{FieldMdSec.first , FieldMdSec.second },
693
704
{AssocTySec.first , AssocTySec.second },
694
705
{BuiltinTySec.first , BuiltinTySec.second },
695
706
{CaptureSec.first , CaptureSec.second },
696
707
{TypeRefMdSec.first , TypeRefMdSec.second },
697
708
{ReflStrMdSec.first , ReflStrMdSec.second },
698
709
{ConformMdSec.first , ConformMdSec.second },
710
+ {MPEnumMdSec.first , MPEnumMdSec.second },
699
711
PotentialModuleNames};
700
712
result = this ->addReflectionInfo (info);
701
713
}
@@ -718,20 +730,23 @@ class ReflectionContext
718
730
ObjectFileFormat.getSectionName (ReflectionSectionKind::reflstr), false );
719
731
ConformMdSec = findELFSectionByName (
720
732
ObjectFileFormat.getSectionName (ReflectionSectionKind::conform), false );
733
+ MPEnumMdSec = findELFSectionByName (
734
+ ObjectFileFormat.getSectionName (ReflectionSectionKind::mpenum), false );
721
735
722
736
if (Error)
723
737
return {};
724
738
725
739
if (FieldMdSec.first || AssocTySec.first || BuiltinTySec.first ||
726
740
CaptureSec.first || TypeRefMdSec.first || ReflStrMdSec.first ||
727
- ConformMdSec.first ) {
741
+ ConformMdSec.first || MPEnumMdSec. first ) {
728
742
ReflectionInfo info = {{FieldMdSec.first , FieldMdSec.second },
729
743
{AssocTySec.first , AssocTySec.second },
730
744
{BuiltinTySec.first , BuiltinTySec.second },
731
745
{CaptureSec.first , CaptureSec.second },
732
746
{TypeRefMdSec.first , TypeRefMdSec.second },
733
747
{ReflStrMdSec.first , ReflStrMdSec.second },
734
748
{ConformMdSec.first , ConformMdSec.second },
749
+ {MPEnumMdSec.first , MPEnumMdSec.second },
735
750
PotentialModuleNames};
736
751
auto rid = this ->addReflectionInfo (info);
737
752
if (!result)
@@ -846,8 +861,7 @@ class ReflectionContext
846
861
ReflectionSectionKind::fieldmd, ReflectionSectionKind::assocty,
847
862
ReflectionSectionKind::builtin, ReflectionSectionKind::capture,
848
863
ReflectionSectionKind::typeref, ReflectionSectionKind::reflstr,
849
- ReflectionSectionKind::conform
850
- };
864
+ ReflectionSectionKind::conform, ReflectionSectionKind::mpenum};
851
865
852
866
llvm::SmallVector<std::pair<RemoteRef<void >, uint64_t >, 6 > Pairs;
853
867
for (auto Section : Sections) {
@@ -873,6 +887,7 @@ class ReflectionContext
873
887
{Pairs[4 ].first , Pairs[4 ].second },
874
888
{Pairs[5 ].first , Pairs[5 ].second },
875
889
{Pairs[6 ].first , Pairs[6 ].second },
890
+ {Pairs[7 ].first , Pairs[7 ].second },
876
891
PotentialModuleNames};
877
892
return addReflectionInfo (Info);
878
893
}
0 commit comments