hanchenye-llvm-project/clang/test/Frontend
Volodymyr Sapsai 1f70bddb83 Fix evaluation of `__has_include_next` during -frewrite-includes.
`__has_include_next` requires correct DirectoryLookup for being
evaluated correctly. We were using Preprocessor::GetCurDirLookup() but
we were calling it after the preprocessor finished its work. And in this
case CurDirLookup is always nullptr which makes `__has_include_next`
behave as `__has_include`.

Fix by storing and using CurDirLookup when preprocessor enters a file,
not when we rewrite the includes.

rdar://problem/36305026

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D45603

llvm-svn: 330041
2018-04-13 17:43:15 +00:00
..
Inputs Fix evaluation of `__has_include_next` during -frewrite-includes. 2018-04-13 17:43:15 +00:00
Weverything.c
Wno-everything.c
aarch64-target-cpu.c
absolute-paths.c
ast-codegen.c Recommit r324107 again. 2018-02-07 22:15:33 +00:00
ast-main.c
ast-main.cpp
backend-diagnostic.c
cc1-return-codes.c
clang-abi-compat.cpp Add flag to request Clang is ABI-compatible with older versions of itself 2017-08-26 01:04:35 +00:00
cpp-output.c
darwin-eabi.c
darwin-version.c
dependency-gen-escaping.c
dependency-gen.c
dependency-generation-crash.c
diagnostics-option-names.c
diagnostics-order.c [VerifyDiagnosticConsumer] support -verify=<prefixes> 2017-12-16 02:23:22 +00:00
disable-output.c
embed-bitcode.ll
exceptions.c
float16.cpp Re-commit r321223, which adds a printing policy to the ASTDumper. 2017-12-21 21:42:42 +00:00
force-include-not-found.c
gnu-inline.c
gnu-mcount.c Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter attributes 2017-11-14 21:13:27 +00:00
hexagon-target-basic.c
iframework.c
include-duplicate-removal.c
int128.cpp
invalid-o-level.c
ir-support-codegen.ll
ir-support-errors.ll
ir-support.c
lit.local.cfg
macros.c
mfpmath.c
mips-long-double.c
objc-bool-is-bool.m
opencl.cl [OpenCL] Added -std/-cl-std=c++ 2018-04-12 14:17:04 +00:00
optimization-remark-analysis.c
optimization-remark-extra-analysis.c Fix ClangDiagnosticHandler::is*RemarkEnabled members 2017-09-19 17:59:40 +00:00
optimization-remark-line-directive.c
optimization-remark-options.c [ValueTracking] Enabling ValueTracking patch by default (recommit). Part 1. 2017-08-10 11:22:52 +00:00
optimization-remark-with-hotness.c Fix the second part of the broken comment from r306079 2017-12-01 19:59:45 +00:00
optimization-remark.c [clang] Fix tests for Emitting Single Inline Remark 2017-08-21 16:40:35 +00:00
output-failures.c
plugin-annotate-functions.c
plugin-delayed-template.cpp
plugin-vs-debug-info.cpp
plugins.c
pp-only-no-editor-placeholders.c [PR33394] Avoid lexing editor placeholders when Clang is used only 2017-06-16 20:13:39 +00:00
preprocessed-input.i
preprocessed-output-macro-first-token.c
print-header-includes.c
profile-sample-use-loc-tracking.c
region-pragmas.c Always allow "#pragma region". 2018-01-27 00:25:29 +00:00
remove-file-on-signal.c [Support] Use FILE_SHARE_DELETE to fix RemoveFileOnSignal on Windows 2017-08-04 21:52:00 +00:00
rewrite-includes-bom.c
rewrite-includes-cli-include.c
rewrite-includes-eof.c
rewrite-includes-filenotfound.c PR32848: There isn't necessarily a FileChanged or FileSkipped for every InclusionDirective callback. 2017-06-02 01:05:44 +00:00
rewrite-includes-header-cmd-line.c
rewrite-includes-invalid-hasinclude.c
rewrite-includes-line-markers.c
rewrite-includes-messages.c Use POSIX argument syntax in test rewrite-includes-messages.c 2018-01-04 23:03:48 +00:00
rewrite-includes-missing.c
rewrite-includes-modules.c
rewrite-includes-warnings.c
rewrite-includes.c Fix evaluation of `__has_include_next` during -frewrite-includes. 2018-04-13 17:43:15 +00:00
rewrite-macros.c
source-col-map.c
stats-file.c
stdin.c
stdlang.c [OpenCL] Added -std/-cl-std=c++ 2018-04-12 14:17:04 +00:00
system-header-line-directive-ms-lineendings.c Remove .gitattributes, add comment to lineendings. 2017-08-24 23:25:05 +00:00
system-header-line-directive.c
system-header-prefix.c
trigraphs.cpp
undef.c
unknown-arg.c [Driver] Suggest correctly spelled driver options 2018-01-06 00:25:40 +00:00
unknown-pragmas.c
verify-directive.h
verify-fatal.c
verify-ignore-unexpected.c
verify-prefixes.c [VerifyDiagnosticConsumer] support -verify=<prefixes> 2017-12-16 02:23:22 +00:00
verify-unknown-arg.c
verify.c
verify2.c
verify2.h
verify3.c
warning-mapping-1.c
warning-mapping-2.c
warning-mapping-3.c
warning-mapping-4.c
warning-mapping-5.c
warning-options.cpp
windows-nul.c
x86-target-cpu.c [X86] Split up -march=icelake to -client & -server 2018-04-10 18:58:26 +00:00
x86_64-nacl-types.cpp