[PATCH] Fix "modular" import when we find the header in the current directory

Dmitri Gribenko gribozavr at gmail.com
Tue Dec 10 12:37:52 PST 2013


Hi doug.gregor, rsmith, djasper,

When searching for a header, Clang will first try to look in the current directory.  But if we find the header in this case, we don't set 'SuggestedModule', so the header is included in non-modular way, even if module.map has an entry for it.  Fixing this issue fixes module tests for -fmodules-decluse, and test/Modules/submodules.cpp.

test/Modules/submodules.cpp already had a FIXME that this patch fixes.

-fmodules-decluse tests had dormant errors that this patch uncovers and fixes.  Specifically, XC and XD #included "b.h", but did not specify the use dependency in module.map.

Please review.

http://llvm-reviews.chandlerc.com/D2374

Files:
  include/clang/Lex/HeaderSearch.h
  include/clang/Lex/Preprocessor.h
  lib/Frontend/VerifyDiagnosticConsumer.cpp
  lib/Lex/HeaderSearch.cpp
  lib/Lex/PPDirectives.cpp
  test/Modules/Inputs/declare-use/h.h
  test/Modules/Inputs/declare-use/module.map
  test/Modules/declare-use2.cpp
  test/Modules/submodules.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2374.1.patch
Type: text/x-patch
Size: 10258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131210/b4e3fa54/attachment.bin>


More information about the cfe-commits mailing list