Easy way to find out if the SourceLoc is in main file

Hi Guys,
I know there is a function to find out if SourceLoc is in system headers and also if it is before some other SourceLoc.

My Question is there anyway to tell if it is in the main file that we are parsing (typically a cpp but could be a header)?


Is SourceManager::isFromMainFile what you’re looking for?