[clang compat] Adopt OptionalFileEntryRef

Clang 854c10f8d185286d941307e1033eb492e085c203 changed
PPCallbacks::InclusionDirective and Preprocessor::LookupFile to use
clang::OptionalFileEntryRef instead of llvm::Optional<FileEntryRef>.

Update our overrides and calls to match.
This commit is contained in:
Kim Gräsman 2022-12-20 19:13:34 +01:00
parent 3511ccdedd
commit e28a2853e7
3 changed files with 4 additions and 5 deletions

View File

@ -2421,10 +2421,9 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
// parse it to '<new>' before using, so any path that does
// that, and is clearly a c++ path, is fine; its exact
// contents don't matter that much.
using clang::Optional;
using clang::FileEntryRef;
using clang::OptionalFileEntryRef;
const FileEntry* use_file = CurrentFileEntry();
Optional<FileEntryRef> file = compiler()->getPreprocessor().LookupFile(
OptionalFileEntryRef file = compiler()->getPreprocessor().LookupFile(
CurrentLoc(), "new", true, nullptr, use_file, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, false);
if (file) {

View File

@ -701,7 +701,7 @@ void IwyuPreprocessorInfo::InclusionDirective(
StringRef filename,
bool is_angled,
clang::CharSourceRange filename_range,
Optional<FileEntryRef> file,
clang::OptionalFileEntryRef file,
StringRef search_path,
StringRef relative_path,
const clang::Module* imported,

View File

@ -202,7 +202,7 @@ class IwyuPreprocessorInfo : public clang::PPCallbacks,
llvm::StringRef filename,
bool is_angled,
clang::CharSourceRange filename_range,
llvm::Optional<clang::FileEntryRef> file,
clang::OptionalFileEntryRef file,
llvm::StringRef search_path,
llvm::StringRef relative_path,
const clang::Module* imported,