]> granicus.if.org Git - clang/commit
[libclang] When getting the cursor for an identifier inside a macro definition, check if
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 7 Jan 2013 19:16:25 +0000 (19:16 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 7 Jan 2013 19:16:25 +0000 (19:16 +0000)
commit664b06f9bd2ea83443ddc8553feba8ba48880752
tree32ee70458994744d3be3d967d541dfe84bea86ab
parent8169b671974fc15b6059b1e9532f7f3207d79786
[libclang] When getting the cursor for an identifier inside a macro definition, check if
this was ever a macro name and return a specific CXCursor_MacroExpansion cursor in such a case,
instead of the generic CXCursor_MacroDefinition.

Checking for macro name makes sure the identifier is not part of the identifier list in a
function macro.
While, in general, resolving identifiers in macro definitions to other macros may not be completely accurate,
it greatly improves functionality such as give-me-the-definition-of-this, which was not working at all
inside macro definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171773 91177308-0d34-0410-b5e6-96231b3b80d8
test/Index/c-index-getCursor-pp.c
tools/libclang/CIndex.cpp
tools/libclang/CIndexHigh.cpp
tools/libclang/CIndexer.h
tools/libclang/CXCursor.cpp
tools/libclang/CXCursor.h