Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[cxxmodules] Fall back to Header parsing on demand if we have no module.
We assumed that we will always have module file and unconditionally disable
header parsing on demand. However, the major use-case is gradual migration
to modules. In this scenario (tested by root-meta-fwdDecls-fwdDeclarations),
we have a dictionary which has no module file and still relies on the old
behavior. This can realistically happen when users gradually migrate to
modules. For example, we have modules-aware ROOT and untouched third party
code.

This patch enables header parsing on demand when we have no module file
available.
  • Loading branch information
vgvassilev committed Sep 30, 2018
commit e79917b4fdf5d1715e547536f884ce2fc536d024
6 changes: 4 additions & 2 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,6 @@ TCling::TCling(const char *name, const char *title, const char* const argv[])
#ifdef R__USE_CXXMODULES
useCxxModules = true;
#endif
if (useCxxModules)
fHeaderParsingOnDemand = false;

llvm::install_fatal_error_handler(&exceptionErrorHandler);

Expand Down Expand Up @@ -1755,6 +1753,10 @@ void TCling::RegisterModule(const char* modulename,
// I/O; see rootcling.cxx after the call to TCling__GetInterpreter().
if (fromRootCling) return;

// When we cannot provide a module for the library we should enable header
// parsing. This 'mixed' mode ensures gradual migration to modules.
fHeaderParsingOnDemand = !hasCxxModule;

// Treat Aclic Libs in a special way. Do not delay the parsing.
bool hasHeaderParsingOnDemand = fHeaderParsingOnDemand;
bool isACLiC = strstr(modulename, "_ACLiC_dict") != nullptr;
Expand Down