[PATCH] [modules] PR20507: Avoid silent textual inclusion.

Richard Smith richard at metafoo.co.uk
Wed Jul 1 15:47:42 PDT 2015


In http://reviews.llvm.org/D10423#198214, @benlangmuir wrote:

> 1. This patch exposes a compatibility issue with our 'Darwin' module map file (the module map that covers most of /usr/include on Darwin platforms). ``` error: module 'Darwin.C.excluded' requires feature 'excluded' ``` This "excluded" submodule was used as a hack for "assert.h" before the explicit support for "exclude" and "textual" headers were added to clang.  After this patch, it won't be possible to include assert.h on Darwin, because the module it is in is missing a requirement.  I think it would be very bad to break compatibility here, so I propose we add a compatibility hack to module map parsing that treats a module with a the requirement "excluded" as if all its headers were declared with "exclude".  What do you think?  I'm happy to implement this.


Should this be `textual` instead of `exclude`? That's generally a better way to handle `assert.h`, I think. (That said, I don't think it really matters, because no-one cares which module `assert.h` is in, and we don't yet build PTH for textual headers.)

> So concretely for the present patch just the change to `isBetterKnownHeader` to take into account of `isAvailable`?


Yes, I think so.


http://reviews.llvm.org/D10423

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list