From 7ecd19ecded872b97e3fcc839ba9d3516d153d8e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 21 Dec 2010 07:55:45 +0000 Subject: Teach clang_getCursorSemanticParent() and clang_getCursorLexicalParent() to cope with class and function templates, along with the parent of the translation unit. Fixes PR8761 and PR8766. llvm-svn: 122324 --- clang/include/clang-c/Index.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/include/clang-c') diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 0be4d4a02c1..9bf492d5f80 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -1522,6 +1522,8 @@ CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset, * In the example above, both declarations of \c C::f have \c C as their * semantic context, while the lexical context of the first \c C::f is \c C * and the lexical context of the second \c C::f is the translation unit. + * + * For global declarations, the semantic parent is the translation unit. */ CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor); @@ -1555,6 +1557,9 @@ CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor); * In the example above, both declarations of \c C::f have \c C as their * semantic context, while the lexical context of the first \c C::f is \c C * and the lexical context of the second \c C::f is the translation unit. + * + * For declarations written in the global scope, the lexical parent is + * the translation unit. */ CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor); -- cgit v1.2.3