summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-08-27 17:32:42 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-08-27 17:32:42 +0000
commit1c8a4b7204d311ecd7681ef907c4aab99fd91308 (patch)
tree048842701bd54ec5becd7ea88a192834e4e00c2a /clang/lib
parent3d9b39b733df56a97f47cf88d09b327e78d3d21c (diff)
downloadbcm5719-llvm-1c8a4b7204d311ecd7681ef907c4aab99fd91308.tar.gz
bcm5719-llvm-1c8a4b7204d311ecd7681ef907c4aab99fd91308.zip
Use FileEntryRef for PPCallbacks::HasInclude
This fixes the issue where a filename dependendency was missing if the file that was referenced with __has_include() was accessed through a symlink in an earlier run, if the file manager was reused between runs. llvm-svn: 370081
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/DependencyFile.cpp2
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index 86e9ccfe3a4..b9c753d909a 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -83,7 +83,7 @@ struct DepCollectorPPCallbacks : public PPCallbacks {
}
void HasInclude(SourceLocation Loc, StringRef SpelledFilename, bool IsAngled,
- const FileEntry *File,
+ Optional<FileEntryRef> File,
SrcMgr::CharacteristicKind FileType) override {
if (!File)
return;
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 3f5ee08b743..dfbcaedcacf 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -1219,8 +1219,7 @@ static bool EvaluateHasIncludeCommon(Token &Tok,
if (File)
FileType =
PP.getHeaderSearchInfo().getFileDirFlavor(&File->getFileEntry());
- Callbacks->HasInclude(FilenameLoc, Filename, isAngled,
- File ? &File->getFileEntry() : nullptr, FileType);
+ Callbacks->HasInclude(FilenameLoc, Filename, isAngled, File, FileType);
}
// Get the result value. A result of true means the file exists.
OpenPOWER on IntegriCloud