[modules] Add support for #include_next.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 Oct 2014 00:15:49 +0000 (00:15 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 Oct 2014 00:15:49 +0000 (00:15 +0000)
commit25d50758f3078f56677f50b8f789dff76c90ed4c
tree83f4c9111a856ddfe96a2de2d1c2418d8946f1a8
parentb5f4c32830f851c9211762b528dccdacfda5fd7a
[modules] Add support for #include_next.

#include_next interacts poorly with modules: it depends on where in the list of
include paths the current file was found. Files covered by module maps are not
found in include search paths when building the module (and are not found in
include search paths when @importing the module either), so this isn't really
meaningful. Instead, we fake up the result that #include_next *should* have
given: find the first path that would have resulted in the given file being
picked, and search from there onwards.

llvm-svn: 220177
15 files changed:
clang/docs/Modules.rst
clang/include/clang/Lex/Preprocessor.h
clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Lex/PPDirectives.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Lex/Pragma.cpp
clang/test/Modules/Inputs/include_next/x/a.h [new file with mode: 0644]
clang/test/Modules/Inputs/include_next/x/module.modulemap [new file with mode: 0644]
clang/test/Modules/Inputs/include_next/x/subdir/b.h [new file with mode: 0644]
clang/test/Modules/Inputs/include_next/y/a.h [new file with mode: 0644]
clang/test/Modules/Inputs/include_next/y/b.h [new file with mode: 0644]
clang/test/Modules/Inputs/include_next/y/module.modulemap [new file with mode: 0644]
clang/test/Modules/cstd.m
clang/test/Modules/include_next.c [new file with mode: 0644]