The libclang
C API has the following function for this purpose:
CXSourceLocation clang_getLocation(
CXTranslationUnit tu,
CXFile file,
unsigned line,
unsigned column
)
I can't find an equivalent for the C++ API. There are many getLocation
functions but none that take this set of arguments.
I am ultimately trying to get the DeclRef
at a given source location, if it exists.