Skip to content

Conversation

@Teemperor
Copy link
Contributor

This patch also untangles the generation code of PCMs and PCHs.

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1011/native, slc6/gcc49, slc6/gcc62, ubuntu14/native and CMake flags -Dccache=ON -Dimt=OFF

@Teemperor Teemperor changed the base branch from master to runtime-cxxmodules April 13, 2017 13:51
@Teemperor Teemperor force-pushed the NewModuleMapGeneration branch from 013a0fa to 55e4e37 Compare April 13, 2017 13:54
/// 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,
Copy link
Member

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.

@Teemperor Teemperor force-pushed the NewModuleMapGeneration branch from 55e4e37 to 95d1a38 Compare April 13, 2017 13:57
/// 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)
Copy link
Member

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.

@Teemperor Teemperor force-pushed the NewModuleMapGeneration branch from 95d1a38 to 9ffaa42 Compare April 13, 2017 13:59
Copy link
Member

@vgvassilev vgvassilev left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo iff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int GenerateModule(TModuleGenerator &modGen, clang::CompilerInstance *CI)
{
// modGen must not be in PCH mode. Otherwise this is a programming error.
assert(!modGen.IsPCH());
Copy link
Member

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?


// 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";
Copy link
Member

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.

Copy link
Member

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.


// Free up some memory, in case the process is kept alive.
Buffer.clear();
// Check if the loaded modules covers all headers that were specified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: 'cover'.

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 "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, use Error.

std::cerr << "warning: Couldn't find the following specified headers in "
<< "the module " << module->Name << ":\n";
for (auto &H : MissingHeaders) {
std::cerr << " " << H << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.


////////////////////////////////////////////////////////////////////////////////
/// Generates a module from the given ModuleGenerator and CompilerInstance.
int GenerateModule(TModuleGenerator &modGen, clang::CompilerInstance *CI)
Copy link
Member

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.

@vgvassilev
Copy link
Member

@martinmine, it looks like the build failed due to configuration issues. Could you have a look, this is on a separate branch called runtime-cxxmodules.

@vgvassilev vgvassilev self-assigned this Apr 13, 2017
@Teemperor Teemperor force-pushed the NewModuleMapGeneration branch 3 times, most recently from 48afdf8 to 9897568 Compare April 18, 2017 09:18
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).
@vgvassilev
Copy link
Member

@phsft-bot build!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants