mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Adapt llvmorg-15-init-7692-gd79ad2f1dbc2: PPCallbacks::InclusionDirective parameter
This commit is contained in:
parent
790daca4b2
commit
74458915b3
@ -1096,10 +1096,18 @@ public:
|
|||||||
}
|
}
|
||||||
void InclusionDirective(SourceLocation hashLoc, const Token &tok,
|
void InclusionDirective(SourceLocation hashLoc, const Token &tok,
|
||||||
StringRef included, bool isAngled,
|
StringRef included, bool isAngled,
|
||||||
CharSourceRange filenameRange, const FileEntry *file,
|
CharSourceRange filenameRange,
|
||||||
|
#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
|
||||||
|
llvm::Optional<FileEntryRef> fileRef,
|
||||||
|
#else
|
||||||
|
const FileEntry *file,
|
||||||
|
#endif
|
||||||
StringRef searchPath, StringRef relativePath,
|
StringRef searchPath, StringRef relativePath,
|
||||||
const Module *imported,
|
const Module *imported,
|
||||||
SrcMgr::CharacteristicKind fileType) override {
|
SrcMgr::CharacteristicKind fileType) override {
|
||||||
|
#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
|
||||||
|
const FileEntry *file = fileRef ? &fileRef->getFileEntry() : nullptr;
|
||||||
|
#endif
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
auto spell = fromCharSourceRange(sm, param.ctx->getLangOpts(),
|
auto spell = fromCharSourceRange(sm, param.ctx->getLangOpts(),
|
||||||
|
@ -178,11 +178,19 @@ public:
|
|||||||
: sm(sm), out(out) {}
|
: sm(sm), out(out) {}
|
||||||
void InclusionDirective(SourceLocation hashLoc, const Token &includeTok,
|
void InclusionDirective(SourceLocation hashLoc, const Token &includeTok,
|
||||||
StringRef fileName, bool isAngled,
|
StringRef fileName, bool isAngled,
|
||||||
CharSourceRange filenameRange, const FileEntry *file,
|
CharSourceRange filenameRange,
|
||||||
|
#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
|
||||||
|
llvm::Optional<FileEntryRef> fileRef,
|
||||||
|
#else
|
||||||
|
const FileEntry *file,
|
||||||
|
#endif
|
||||||
StringRef searchPath, StringRef relativePath,
|
StringRef searchPath, StringRef relativePath,
|
||||||
const clang::Module *imported,
|
const clang::Module *imported,
|
||||||
SrcMgr::CharacteristicKind fileKind) override {
|
SrcMgr::CharacteristicKind fileKind) override {
|
||||||
(void)sm;
|
(void)sm;
|
||||||
|
#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2
|
||||||
|
const FileEntry *file = fileRef ? &fileRef->getFileEntry() : nullptr;
|
||||||
|
#endif
|
||||||
if (file && seen.insert(file).second)
|
if (file && seen.insert(file).second)
|
||||||
out.emplace_back(pathFromFileEntry(*file), file->getModificationTime());
|
out.emplace_back(pathFromFileEntry(*file), file->getModificationTime());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user