Bug 1282172 - Detect enum constants generated by macros when generating the Searchfox index. r=billm

MozReview-Commit-ID: 5RUsVSMTU8

--HG--
extra : rebase_source : 32f803de363aaaaa8df9c3d0eac31653ecb3de48
This commit is contained in:
Kartikaya Gupta 2017-11-18 20:05:53 -05:00
Родитель c633ffa4c4
Коммит 4cf3084e60
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -1042,6 +1042,16 @@ public:
bool VisitNamedDecl(NamedDecl *D) {
SourceLocation Loc = D->getLocation();
if (isa<EnumConstantDecl>(D) && SM.isMacroBodyExpansion(Loc)) {
// for enum constants generated by macro expansion, update location
// to point to the expansion location as that is more useful. We might
// want to do this for more token types but until we have good regression
// testing for the Indexer it's best to be as conservative and explicit
// as possible with the changes.
Loc = SM.getFileLoc(Loc);
}
normalizeLocation(&Loc);
if (!isInterestingLocation(Loc)) {
return true;