Files
Greg Shuflin 022136d7dc Fix isFromMainFile for macro-argument function names (BZ_API pattern)
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.
2026-05-18 20:08:32 -07:00
..