diff options
author | Kim Grasman <kim.grasman@gmail.com> | 2019-08-31 11:33:45 +0200 |
---|---|---|
committer | Kim Gräsman <kim.grasman@gmail.com> | 2019-09-01 16:29:49 +0200 |
commit | c2d74ac67a81734d99b294a182b7de3392b83872 (patch) | |
tree | 2b7b21b9a93ff7c61d9923807e7a74657087dff4 | |
parent | 93be9c04b6cd913dcd8f5cd1566d116f35208b0f (diff) |
Clang r369998: FileSkipped now takes FileEntryRef
Update FileSkipped override to use the new type.
There may be opportunities for us later to store the FileEntryRef to get
at the name as-used-when-opened, but for now just try to get back to a
buildable state.
-rw-r--r-- | iwyu_preprocessor.cc | 11 | ||||
-rw-r--r-- | iwyu_preprocessor.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/iwyu_preprocessor.cc b/iwyu_preprocessor.cc index bacfa70..ada89f3 100644 --- a/iwyu_preprocessor.cc +++ b/iwyu_preprocessor.cc @@ -34,6 +34,7 @@ #include "clang/Lex/MacroInfo.h" using clang::FileEntry; +using clang::FileEntryRef; using clang::FileID; using clang::MacroDefinition; using clang::MacroDirective; @@ -684,7 +685,7 @@ void IwyuPreprocessorInfo::FileChanged(SourceLocation loc, // Called when we see an #include, but decide we don't need to // actually read it because it's already been #included (and is // protected by a header guard). -void IwyuPreprocessorInfo::FileSkipped(const FileEntry& file, +void IwyuPreprocessorInfo::FileSkipped(const FileEntryRef& file, const Token &filename, SrcMgr::CharacteristicKind file_type) { CHECK_(include_filename_loc_.isValid() && @@ -695,11 +696,11 @@ void IwyuPreprocessorInfo::FileSkipped(const FileEntry& file, GetInstantiationLoc(filename.getLocation()); ERRSYM(GetFileEntry(include_loc)) << "[ (#include) ] " << include_name_as_written - << " (" << GetFilePath(&file) << ")\n"; + << " (" << GetFilePath(&file.getFileEntry()) << ")\n"; - AddDirectInclude(include_loc, &file, include_name_as_written); - if (ShouldReportIWYUViolationsFor(&file)) { - files_to_report_iwyu_violations_for_.insert(&file); + AddDirectInclude(include_loc, &file.getFileEntry(), include_name_as_written); + if (ShouldReportIWYUViolationsFor(&file.getFileEntry())) { + files_to_report_iwyu_violations_for_.insert(&file.getFileEntry()); } } diff --git a/iwyu_preprocessor.h b/iwyu_preprocessor.h index 76eabef..2f060e7 100644 --- a/iwyu_preprocessor.h +++ b/iwyu_preprocessor.h @@ -204,7 +204,7 @@ class IwyuPreprocessorInfo : public clang::PPCallbacks, void FileChanged(clang::SourceLocation loc, FileChangeReason reason, clang::SrcMgr::CharacteristicKind file_type, clang::FileID exiting_from_id) override; - void FileSkipped(const clang::FileEntry& file, const clang::Token &filename, + void FileSkipped(const clang::FileEntryRef& file, const clang::Token &filename, clang::SrcMgr::CharacteristicKind file_type) override; // FileChanged is actually a multi-plexer for 4 different callbacks. void FileChanged_EnterFile(clang::SourceLocation file_beginning); |