For declarations whose names are macro arguments (e.g. BZ_API(func) in
bzip2), the raw CXSourceLocation is a MacroID. When
clang_Location_isFromMainFile dereferences that MacroID it follows the
expansion chain, which can land in an intermediate scratch buffer rather
than the main file, incorrectly returning false.
Fix: use clang_getExpansionLocation to get the concrete file/line/col,
then reconstruct a file-based location via clang_getLocation and check
clang_Location_isFromMainFile on that instead.