Locations under a conditional directive

Hi all,

Is there a way given a SourceLocation to determine if this location is under a preprocessor conditional directive (e.g., #ifdef, #if, etc.). I tried adding the PPConditionalDirectiveRecord as a preprocessor callback and then calling the rangeIntersectsConditionalDirective, but that didn’t work.

Cheers,
Kostas

SourceManager::getExpansionLoc maybe work.