[PATCH] D23858: Don't diagnose non-modular includes when we are not compiling a module

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 16:33:23 PDT 2016


manmanren created this revision.
manmanren added reviewers: rsmith, benlangmuir.
manmanren added a subscriber: cfe-commits.

We used to have -fmodule-implementation-of and it was merged with -fmodule-name. But this causes some regression on our internal projects. We are now seeing non-modular include warnings.

This is triggered when we have relative includes to a VFS-mapped module, -I that points us to the real header and -F that points us to the vfs. The real header that is part of the umbrella directory will be classified as non-modular.

It seems like we can use CompilingModule to tell if we are compiling the interface of a module or the implementation file of a module. When compiling the implementation file, we don't diagnose non-modular includes. The non-modular includes will be diagnosed when building the interface and writing the pcm file.

Related changes:
http://llvm.org/viewvc/llvm-project?rev=213767&view=rev
http://llvm.org/viewvc/llvm-project?rev=261372&view=rev
http://llvm.org/viewvc/llvm-project?rev=263449&view=rev

https://reviews.llvm.org/D23858

Files:
  lib/Lex/PPDirectives.cpp
  test/VFS/Inputs/Nonmodular/A.h
  test/VFS/Inputs/Nonmodular/Nonmodular.modulemap
  test/VFS/Inputs/Nonmodular/nonmodular-headers.yaml
  test/VFS/Inputs/Nonmodular/test.c
  test/VFS/Inputs/Nonmodular/umbrella.h
  test/VFS/test_nonmodular.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23858.69183.patch
Type: text/x-patch
Size: 3666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160824/db27dc42/attachment-0001.bin>


More information about the cfe-commits mailing list