ΒΆCXCursor clang_getCursorDefinition(CXCursor)

Description

For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity. Some entities can be declared multiple times within a translation unit, but only one of those declarations can also be a definition. For example, given: there are three declarations of the function "f", but only the second one is a definition. The clang_getCursorDefinition() function will take any cursor pointing to a declaration of "f" (the first or fourth lines of the example) or a cursor referenced that uses "f" (the call to "f' inside "g") and will return a declaration cursor pointing to the definition (the second "f" declaration). If given a cursor for which there is no corresponding definition, e.g., because there is no definition of that entity within this translation unit, returns a NULL cursor.

Declared at: clang/include/clang-c/Index.h:4548

Parameters

CXCursor