@@ -2240,31 +2240,6 @@ static bool GenerateAllDict(TModuleGenerator &modGen, clang::CompilerInstance *c
22402240 return WriteAST (modGen.GetModuleFileName (), compilerInstance, iSysRoot);
22412241}
22422242
2243- static void
2244- foreachHeaderInModule (const clang::Module &module , const std::function<void (const clang::Module::Header &)> &closure)
2245- {
2246- // Iterates over all headers in a module and calls the closure on each.
2247-
2248- // FIXME: We currently have to hardcode '4' to do this. Maybe we
2249- // will have a nicer way to do this in the future.
2250- // NOTE: This is on purpose '4', not '5' which is the size of the
2251- // vector. The last element is the list of excluded headers which we
2252- // obviously don't want to check here.
2253- const std::size_t publicHeaderIndex = 4 ;
2254-
2255- // Integrity check in case this array changes its size at some point.
2256- const std::size_t maxArrayLength = ((sizeof module .Headers ) / (sizeof *module .Headers ));
2257- static_assert (publicHeaderIndex + 1 == maxArrayLength,
2258- " 'Headers' has changed it's size, we need to update publicHeaderIndex" );
2259-
2260- for (std::size_t i = 0 ; i < publicHeaderIndex; i++) {
2261- auto &headerList = module .Headers [i];
2262- for (const clang::Module::Header &moduleHeader : headerList) {
2263- closure (moduleHeader);
2264- }
2265- }
2266- }
2267-
22682243// //////////////////////////////////////////////////////////////////////////////
22692244// / Includes all headers in the given module from this interpreter.
22702245static void IncludeModuleHeaders (TModuleGenerator &modGen, clang::Module *module , cling::Interpreter &interpreter)
@@ -2287,7 +2262,7 @@ static void IncludeModuleHeaders(TModuleGenerator &modGen, clang::Module *module
22872262 // of doing this and 'import' each header in its own submodule, then let
22882263 // the visibility of the decls handle this situation nicely.
22892264 for (clang::Module *module : modules) {
2290- foreachHeaderInModule (*module , [&includes](const clang::Module::Header &h) {
2265+ ROOT::TMetaUtils:: foreachHeaderInModule (*module , [&includes](const clang::Module::Header &h) {
22912266 includes << " #include \" " << h.NameAsWritten << " \"\n " ;
22922267 });
22932268 }
@@ -2319,7 +2294,7 @@ static bool ModuleContainsHeaders(TModuleGenerator &modGen, clang::Module *modul
23192294 // Now we collect all header files from the previously collected modules.
23202295 std::set<std::string> moduleHeaders;
23212296 for (clang::Module *module : modules) {
2322- foreachHeaderInModule (
2297+ ROOT::TMetaUtils:: foreachHeaderInModule (
23232298 *module , [&moduleHeaders](const clang::Module::Header &h) { moduleHeaders.insert (h.NameAsWritten ); });
23242299 }
23252300
0 commit comments