aboutsummaryrefslogtreecommitdiff
path: root/test/Index/c-index-getCursor-pp.c
AgeCommit message (Collapse)Author
2013-01-07[libclang] When getting the cursor for an identifier inside a macro ↵Argyrios Kyrtzidis
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
2012-12-08[libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndefArgyrios Kyrtzidis
directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11[libclang] Fix getting a cursor inside an angled #include directive.Argyrios Kyrtzidis
Fixed by pointing the end location of the preprocessed entity for the #include at the closing '>', instead of the start of '<'. rdar://11113134 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163588 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-08[libclang] Fix annotation and getting a "macro expansion" cursorArgyrios Kyrtzidis
for a builtin macro expansion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139298 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14Update all of the libclang code corresponding to the preprocessorChandler Carruth
MacroInstantiation -> MacroExpansion rename. Internally, everything is switched. Introduce a new cursor kind enum with the new name, but retain the old name as an alias so that we don't break backwards compatibility. Also update the debug printing routine to use 'macro expansions' as its explicitly not guaranteed to be stable, and mechanically switch the test cases over to that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10In clang_getCursor(), don't override a preprocessing cursor withinDouglas Gregor
another preprocessing cursor, since we want the outermost one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30When using a precompiled preamble with detailed preprocessing records,Douglas Gregor
trap the serialized preprocessing records (macro definitions, macro instantiations, macro definitions) from the generation of the precompiled preamble, then replay those when walking the list of preprocessed entities. This eliminates a bug where clang_getCursor() wasn't able to find preprocessed-entity cursors in the preamble. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Update clang_getCursor() test to check searches on include directivesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19Visit preprocessing elements (macro instantiations and macroDouglas Gregor
definitions) as part of the translation unit, so that normal visitation, token-annotation, and cursor-at retrieval all see preprocessing elements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19Revert 98907 since it is breaking buildbots.Bob Wilson
--- Reverse-merging r98907 into '.': D test/Index/c-index-getCursor-pp.c U tools/CIndex/CIndex.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19Visit preprocessing elements (macro instantiations and macroDouglas Gregor
definitions) as part of the translation unit, so that normal visitation, token-annotation, and cursor-at retrieval all see preprocessing elements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98907 91177308-0d34-0410-b5e6-96231b3b80d8