-
Notifications
You must be signed in to change notification settings - Fork 1.4k
PCM generation now uses the ROOT modulemap to build modules. #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCM generation now uses the ROOT modulemap to build modules. #504
Conversation
|
Starting build on |
013a0fa to
55e4e37
Compare
core/dictgen/src/rootcling_impl.cxx
Outdated
| /// needed by the given ModuleGenerator. | ||
| /// The names of all header files that are needed by the ModuleGenerator but are | ||
| /// not in the given module will be inserted into the MissingHeader variable. | ||
| static bool moduleContainsHeaders(TModuleGenerator &modGen, clang::Module *module, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding convention calls for CamelCase for funcitons names. thanks.
55e4e37 to
95d1a38
Compare
core/dictgen/src/rootcling_impl.cxx
Outdated
| /// respecting the given isysroot. | ||
| /// If module is not a null pointer, we only write the given module to the | ||
| /// given file and not the whole AST. | ||
| int writeAST(StringRef FileName, clang::CompilerInstance *CI, StringRef ISysRoot, clang::Module *module = nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use CamelCase for function names. thanks.
95d1a38 to
9ffaa42
Compare
vgvassilev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good modulo minor comments.
| // Write the generated bitstream to "Out". | ||
| OS->write((char *)&Buffer.front(), Buffer.size()); | ||
| //////////////////////////////////////////////////////////////////////////////// | ||
| /// Returns true iff a given module (and its submodules) contains all headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo iff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/dictgen/src/rootcling_impl.cxx
Outdated
| int GenerateModule(TModuleGenerator &modGen, clang::CompilerInstance *CI) | ||
| { | ||
| // modGen must not be in PCH mode. Otherwise this is a programming error. | ||
| assert(!modGen.IsPCH()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add && "Comment" to the assert?
core/dictgen/src/rootcling_impl.cxx
Outdated
|
|
||
| // Inform the user and abort if we can't find a module with a given name. | ||
| if (module == nullptr) { | ||
| std::cerr << "error: Couldn't find module with name '" << ModuleName << "' in modulemap!\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ROOT's error reporting facilities, eg Error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROOT::TMetaUtils::Error to be more precise.
core/dictgen/src/rootcling_impl.cxx
Outdated
|
|
||
| // Free up some memory, in case the process is kept alive. | ||
| Buffer.clear(); | ||
| // Check if the loaded modules covers all headers that were specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 'cover'.
core/dictgen/src/rootcling_impl.cxx
Outdated
| std::vector<std::string> MissingHeaders; | ||
| if (!moduleContainsHeaders(modGen, module, MissingHeaders)) { | ||
| // FIXME: Upgrade this to an error once modules are stable. | ||
| std::cerr << "warning: Couldn't find the following specified headers in " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, use Error.
core/dictgen/src/rootcling_impl.cxx
Outdated
| std::cerr << "warning: Couldn't find the following specified headers in " | ||
| << "the module " << module->Name << ":\n"; | ||
| for (auto &H : MissingHeaders) { | ||
| std::cerr << " " << H << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
core/dictgen/src/rootcling_impl.cxx
Outdated
|
|
||
| //////////////////////////////////////////////////////////////////////////////// | ||
| /// Generates a module from the given ModuleGenerator and CompilerInstance. | ||
| int GenerateModule(TModuleGenerator &modGen, clang::CompilerInstance *CI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about returning 'bool', it seems we check only for success.
|
@martinmine, it looks like the build failed due to configuration issues. Could you have a look, this is on a separate branch called |
48afdf8 to
9897568
Compare
This patch also untangles the generation code of PCMs and PCHs. Additionally we enable rootcling warnings during module generation because want them in the future when we try to adjust the working ROOT modulemap to the dictionary layout (i.e. fixing libCore and libThread).
|
@phsft-bot build! |
This patch also untangles the generation code of PCMs and PCHs.