@@ -2786,18 +2786,6 @@ void ROOT::TMetaUtils::foreachHeaderInModule(const clang::Module &module,
2786
2786
{
2787
2787
// Iterates over all headers in a module and calls the closure on each.
2788
2788
2789
- // FIXME: We currently have to hardcode '4' to do this. Maybe we
2790
- // will have a nicer way to do this in the future.
2791
- // NOTE: This is on purpose '4', not '5' which is the size of the
2792
- // vector. The last element is the list of excluded headers which we
2793
- // obviously don't want to check here.
2794
- const std::size_t publicHeaderIndex = 4 ;
2795
-
2796
- // Integrity check in case this array changes its size at some point.
2797
- const std::size_t maxArrayLength = ((sizeof module.Headers ) / (sizeof *module.Headers ));
2798
- static_assert (publicHeaderIndex + 1 == maxArrayLength,
2799
- " 'Headers' has changed it's size, we need to update publicHeaderIndex" );
2800
-
2801
2789
// Make a list of modules and submodules that we can check for headers.
2802
2790
// We use a SetVector to prevent an infinite loop in unlikely case the
2803
2791
// modules somehow are messed up and don't form a tree...
@@ -2816,8 +2804,10 @@ void ROOT::TMetaUtils::foreachHeaderInModule(const clang::Module &module,
2816
2804
}
2817
2805
}
2818
2806
2819
- for (std::size_t i = 0 ; i < publicHeaderIndex; i++) {
2820
- auto &headerList = m->Headers [i];
2807
+ // We want to check for all headers except the list of excluded headers here.
2808
+ for (auto HK : {clang::Module::HK_Normal, clang::Module::HK_Textual, clang::Module::HK_Private,
2809
+ clang::Module::HK_PrivateTextual}) {
2810
+ auto &headerList = m->Headers [HK];
2821
2811
for (const clang::Module::Header &moduleHeader : headerList) {
2822
2812
closure (moduleHeader);
2823
2813
}
0 commit comments