From bb2a31000f6e09e4436f59d3507a8680dba614fc Mon Sep 17 00:00:00 2001 From: Danilo Piparo Date: Mon, 18 Sep 2023 23:43:17 +0200 Subject: [PATCH] [Dict] Correct dicts with rootcling+sel xml These changes allow the user to generate a dictionary with rootcling and selecting classes with a selection XML file, the selection file format of genreflex, instead of a traditional LinkDef file. Fixes https://github.com/root-project/root/issues/13543 --- core/dictgen/src/rootcling_impl.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/dictgen/src/rootcling_impl.cxx b/core/dictgen/src/rootcling_impl.cxx index 9e550d41bb8b9..fef82af1050b6 100644 --- a/core/dictgen/src/rootcling_impl.cxx +++ b/core/dictgen/src/rootcling_impl.cxx @@ -2657,6 +2657,7 @@ int GenerateFullDict(std::ostream &dictStream, const ROOT::TMetaUtils::RConstructorTypes &ctorTypes, bool isSplit, bool isGenreflex, + bool isSelXML, bool writeEmptyRootPCM) { ROOT::TMetaUtils::TNormalizedCtxt normCtxt(interp.getLookupHelper()); @@ -2703,7 +2704,7 @@ int GenerateFullDict(std::ostream &dictStream, if (clang::CXXRecordDecl *CXXRD = llvm::dyn_cast(const_cast(selClass.GetRecordDecl()))) { - AnnotateDecl(*CXXRD, scan.GetDeclsSelRulesMap() , interp, isGenreflex); + AnnotateDecl(*CXXRD, scan.GetDeclsSelRulesMap() , interp, isSelXML); } const clang::CXXRecordDecl *CRD = llvm::dyn_cast(selClass.GetRecordDecl()); @@ -2775,6 +2776,12 @@ int GenerateFullDict(std::ostream &dictStream, // Loop to write all the ClassCode if (!gOptIgnoreExistingDict) { for (auto const &selClass : scan.fSelectedClasses) { + // The "isGenreflex" parameter allows the distinction between + // genreflex and rootcling only for the treatment of collections which + // are data members. To preserve the behaviour of the original + // genreflex and rootcling tools, if the selection is performed with + // genreflex, data members with collection type do not trigger the + // selection of the collection type ROOT::TMetaUtils::WriteClassCode(&CallWriteStreamer, selClass, interp, @@ -4947,6 +4954,7 @@ int RootClingMain(int argc, constructorTypes, gOptSplit, isGenreflex, + isSelXML, gOptWriteEmptyRootPCM); }