Skip to content

Commit 6ee456b

Browse files
committed
[cxxmodules] Do not generate rdict files if we have a module.
The rdict file does not show performance benefits anymore and we are as good as having only a C++ module.
1 parent a3dc434 commit 6ee456b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

cmake/modules/RootNewMacros.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
389389

390390
if(cpp_module_file)
391391
set(newargs -cxxmodule ${newargs})
392+
set(pcm_name)
392393
endif()
393394

394395
#---what rootcling command to use--------------------------

core/dictgen/src/rootcling_impl.cxx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,8 +2984,8 @@ int CheckClassesForInterpreterOnlyDicts(cling::Interpreter &interp,
29842984
////////////////////////////////////////////////////////////////////////////////
29852985
/// Make up for skipping RegisterModule, now that dictionary parsing
29862986
/// is done and these headers cannot be selected anymore.
2987-
2988-
int FinalizeStreamerInfoWriting(cling::Interpreter &interp, bool writeEmptyRootPCM=false)
2987+
///
2988+
int MaybeEmitROOTPCM(cling::Interpreter &interp, bool writeEmptyRootPCM=false)
29892989
{
29902990
if (!gDriverConfig->fCloseStreamerInfoROOTFile)
29912991
return 0;
@@ -3022,7 +3022,8 @@ int GenerateFullDict(std::ostream &dictStream,
30223022
const ROOT::TMetaUtils::RConstructorTypes &ctorTypes,
30233023
bool isSplit,
30243024
bool isGenreflex,
3025-
bool writeEmptyRootPCM)
3025+
bool writeEmptyRootPCM,
3026+
bool hasCxxModule)
30263027
{
30273028
ROOT::TMetaUtils::TNormalizedCtxt normCtxt(interp.getLookupHelper());
30283029

@@ -3134,12 +3135,12 @@ int GenerateFullDict(std::ostream &dictStream,
31343135
// coverity[fun_call_w_exception] - that's just fine.
31353136
ROOT::Internal::RStl::Instance().WriteClassInit(dictStream, interp, normCtxt, ctorTypes, needsCollectionProxy, EmitStreamerInfo);
31363137

3137-
if (!gDriverConfig->fBuildingROOTStage1) {
3138+
if (!hasCxxModule && !gDriverConfig->fBuildingROOTStage1) {
31383139
EmitTypedefs(scan.fSelectedTypedefs);
31393140
EmitEnums(scan.fSelectedEnums);
31403141
// Make up for skipping RegisterModule, now that dictionary parsing
31413142
// is done and these headers cannot be selected anymore.
3142-
int finRetCode = FinalizeStreamerInfoWriting(interp, writeEmptyRootPCM);
3143+
int finRetCode = MaybeEmitROOTPCM(interp, writeEmptyRootPCM);
31433144
if (finRetCode != 0) return finRetCode;
31443145
}
31453146

@@ -5013,17 +5014,18 @@ int RootClingMain(int argc,
50135014
rootclingRetCode += CheckClassesForInterpreterOnlyDicts(interp, scan);
50145015
// generate an empty pcm nevertheless for consistency
50155016
// Negate as true is 1 and true is returned in case of success.
5016-
if (!gDriverConfig->fBuildingROOTStage1) {
5017-
rootclingRetCode += FinalizeStreamerInfoWriting(interp);
5017+
if (!cxxmodule && !gDriverConfig->fBuildingROOTStage1) {
5018+
rootclingRetCode += MaybeEmitROOTPCM(interp);
50185019
}
50195020
} else {
50205021
rootclingRetCode += GenerateFullDict(splitDictStream,
5021-
interp,
5022-
scan,
5023-
constructorTypes,
5024-
doSplit,
5025-
isGenreflex,
5026-
writeEmptyRootPCM);
5022+
interp,
5023+
scan,
5024+
constructorTypes,
5025+
doSplit,
5026+
isGenreflex,
5027+
writeEmptyRootPCM,
5028+
cxxmodule);
50275029
}
50285030

50295031
if (rootclingRetCode != 0) {

0 commit comments

Comments
 (0)