Skip to content

Commit

Permalink
[Dict] Correct dicts with rootcling+sel xml
Browse files Browse the repository at this point in the history
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 #13543
  • Loading branch information
dpiparo committed Oct 20, 2023
1 parent 94a6e70 commit bb2a310
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/dictgen/src/rootcling_impl.cxx
Expand Up @@ -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());
Expand Down Expand Up @@ -2703,7 +2704,7 @@ int GenerateFullDict(std::ostream &dictStream,

if (clang::CXXRecordDecl *CXXRD =
llvm::dyn_cast<clang::CXXRecordDecl>(const_cast<clang::RecordDecl *>(selClass.GetRecordDecl()))) {
AnnotateDecl(*CXXRD, scan.GetDeclsSelRulesMap() , interp, isGenreflex);
AnnotateDecl(*CXXRD, scan.GetDeclsSelRulesMap() , interp, isSelXML);
}

const clang::CXXRecordDecl *CRD = llvm::dyn_cast<clang::CXXRecordDecl>(selClass.GetRecordDecl());
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -4947,6 +4954,7 @@ int RootClingMain(int argc,
constructorTypes,
gOptSplit,
isGenreflex,
isSelXML,
gOptWriteEmptyRootPCM);
}

Expand Down

0 comments on commit bb2a310

Please sign in to comment.