File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1096,10 +1096,18 @@ class IndexPPCallbacks : public PPCallbacks {
10961096 }
10971097 void InclusionDirective (SourceLocation hashLoc, const Token &tok,
10981098 StringRef included, bool isAngled,
1099- CharSourceRange filenameRange, const FileEntry *file,
1099+ CharSourceRange filenameRange,
1100+ #if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
1101+ llvm::Optional<FileEntryRef> fileRef,
1102+ #else
1103+ const FileEntry *file,
1104+ #endif
11001105 StringRef searchPath, StringRef relativePath,
11011106 const Module *imported,
11021107 SrcMgr::CharacteristicKind fileType) override {
1108+ #if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
1109+ const FileEntry *file = fileRef ? &fileRef->getFileEntry () : nullptr ;
1110+ #endif
11031111 if (!file)
11041112 return ;
11051113 auto spell = fromCharSourceRange (sm, param.ctx ->getLangOpts (),
Original file line number Diff line number Diff line change @@ -178,11 +178,19 @@ class StoreInclude : public PPCallbacks {
178178 : sm(sm), out(out) {}
179179 void InclusionDirective (SourceLocation hashLoc, const Token &includeTok,
180180 StringRef fileName, bool isAngled,
181- CharSourceRange filenameRange, const FileEntry *file,
181+ CharSourceRange filenameRange,
182+ #if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
183+ llvm::Optional<FileEntryRef> fileRef,
184+ #else
185+ const FileEntry *file,
186+ #endif
182187 StringRef searchPath, StringRef relativePath,
183188 const clang::Module *imported,
184189 SrcMgr::CharacteristicKind fileKind) override {
185190 (void )sm;
191+ #if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
192+ const FileEntry *file = fileRef ? &fileRef->getFileEntry () : nullptr ;
193+ #endif
186194 if (file && seen.insert (file).second )
187195 out.emplace_back (pathFromFileEntry (*file), file->getModificationTime ());
188196 }
You can’t perform that action at this time.
0 commit comments