Skip to content

Commit

Permalink
[cxxmodules] Do not generate rdict files if we have a module.
Browse files Browse the repository at this point in the history
The rdict file does not show performance benefits anymore and
we are as good as having only a C++ module.
  • Loading branch information
vgvassilev committed Nov 21, 2018
1 parent a3dc434 commit 6ee456b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions cmake/modules/RootNewMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)

if(cpp_module_file)
set(newargs -cxxmodule ${newargs})
set(pcm_name)
endif()

#---what rootcling command to use--------------------------
Expand Down
28 changes: 15 additions & 13 deletions core/dictgen/src/rootcling_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2984,8 +2984,8 @@ int CheckClassesForInterpreterOnlyDicts(cling::Interpreter &interp,
////////////////////////////////////////////////////////////////////////////////
/// Make up for skipping RegisterModule, now that dictionary parsing
/// is done and these headers cannot be selected anymore.

int FinalizeStreamerInfoWriting(cling::Interpreter &interp, bool writeEmptyRootPCM=false)
///
int MaybeEmitROOTPCM(cling::Interpreter &interp, bool writeEmptyRootPCM=false)
{
if (!gDriverConfig->fCloseStreamerInfoROOTFile)
return 0;
Expand Down Expand Up @@ -3022,7 +3022,8 @@ int GenerateFullDict(std::ostream &dictStream,
const ROOT::TMetaUtils::RConstructorTypes &ctorTypes,
bool isSplit,
bool isGenreflex,
bool writeEmptyRootPCM)
bool writeEmptyRootPCM,
bool hasCxxModule)
{
ROOT::TMetaUtils::TNormalizedCtxt normCtxt(interp.getLookupHelper());

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

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

Expand Down Expand Up @@ -5013,17 +5014,18 @@ int RootClingMain(int argc,
rootclingRetCode += CheckClassesForInterpreterOnlyDicts(interp, scan);
// generate an empty pcm nevertheless for consistency
// Negate as true is 1 and true is returned in case of success.
if (!gDriverConfig->fBuildingROOTStage1) {
rootclingRetCode += FinalizeStreamerInfoWriting(interp);
if (!cxxmodule && !gDriverConfig->fBuildingROOTStage1) {
rootclingRetCode += MaybeEmitROOTPCM(interp);
}
} else {
rootclingRetCode += GenerateFullDict(splitDictStream,
interp,
scan,
constructorTypes,
doSplit,
isGenreflex,
writeEmptyRootPCM);
interp,
scan,
constructorTypes,
doSplit,
isGenreflex,
writeEmptyRootPCM,
cxxmodule);
}

if (rootclingRetCode != 0) {
Expand Down

0 comments on commit 6ee456b

Please sign in to comment.