mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-30 11:27:07 +00:00
Fix spell for clang < 7
This commit is contained in:
parent
73ac788f9e
commit
af54645e5e
@ -572,17 +572,20 @@ public:
|
|||||||
const FileEntry *FE;
|
const FileEntry *FE;
|
||||||
Range loc;
|
Range loc;
|
||||||
#if LLVM_VERSION_MAJOR < 7
|
#if LLVM_VERSION_MAJOR < 7
|
||||||
auto P = SM.getExpansionRange(Loc);
|
CharSourceRange R;
|
||||||
loc = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second));
|
if (SM.isMacroArgExpansion(Loc))
|
||||||
LocFID = SM.getFileID(P.first);
|
R = CharSourceRange::getTokenRange(Spell);
|
||||||
FE = SM.getFileEntryForID(LocFID);
|
else {
|
||||||
|
auto P = SM.getExpansionRange(Loc);
|
||||||
|
R = CharSourceRange::getTokenRange(P.first, P.second);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
auto R = SM.isMacroArgExpansion(Loc) ? CharSourceRange::getTokenRange(Spell)
|
auto R = SM.isMacroArgExpansion(Loc) ? CharSourceRange::getTokenRange(Spell)
|
||||||
: SM.getExpansionRange(Loc);
|
: SM.getExpansionRange(Loc);
|
||||||
|
#endif
|
||||||
loc = FromTokenRange(SM, Lang, R.getAsRange());
|
loc = FromTokenRange(SM, Lang, R.getAsRange());
|
||||||
LocFID = SM.getFileID(R.getBegin());
|
LocFID = SM.getFileID(R.getBegin());
|
||||||
FE = SM.getFileEntryForID(LocFID);
|
FE = SM.getFileEntryForID(LocFID);
|
||||||
#endif
|
|
||||||
if (!FE)
|
if (!FE)
|
||||||
return true;
|
return true;
|
||||||
IndexFile *db = param.ConsumeFile(*FE);
|
IndexFile *db = param.ConsumeFile(*FE);
|
||||||
|
Loading…
Reference in New Issue
Block a user