llvm-project/clang/lib/Frontend/Rewrite
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
..
CMakeLists.txt Attempt to fix shared library build: RewriteFrontend depends on Serialization after r305116. 2017-06-09 22:02:33 +00:00
FixItRewriter.cpp [Edit, Rewrite] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-27 00:01:49 +00:00
FrontendActions.cpp [CMake] Use #cmakedefine01 for CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) 2017-10-18 05:21:17 +00:00
HTMLPrint.cpp Clean up use of C allocation functions 2018-02-21 02:02:39 +00:00
InclusionRewriter.cpp Fix evaluation of `__has_include_next` during -frewrite-includes. 2018-04-13 17:43:15 +00:00
RewriteMacros.cpp Spelling mistakes in comments. NFCI. (PR27635) 2017-03-30 14:13:19 +00:00
RewriteModernObjC.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
RewriteObjC.cpp Remove redundant casts. NFC 2018-03-01 05:43:23 +00:00
RewriteTest.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00