summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/annotate-tokens.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libclang] Fix cursors for functions with trailing return typeIvan Donchevskii2018-01-031-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This one was rolled back as follow-up to the failing commit. Second try. For the function declaration auto foo5(Foo) -> Foo; the parameter tokens were mapped to cursors representing the FunctionDecl: Keyword: "auto" [1:1 - 1:5] FunctionDecl=test5:1:6 Identifier: "test5" [1:6 - 1:11] FunctionDecl=test5:1:6 Punctuation: "(" [1:11 - 1:12] FunctionDecl=test5:1:6 Identifier: "X" [1:12 - 1:13] FunctionDecl=test5:1:6 // Ops, not a TypeRef Punctuation: ")" [1:13 - 1:14] FunctionDecl=test5:1:6 Punctuation: "->" [1:15 - 1:17] FunctionDecl=test5:1:6 Identifier: "X" [1:18 - 1:19] TypeRef=struct X:7:8 Punctuation: ";" [1:19 - 1:20] Fix this by ensuring that the trailing return type is not visited as first. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40561 llvm-svn: 321709
* Revert r321697 "[libclang] Support querying whether a declaration is ↵Hans Wennborg2018-01-031-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invalid" and follow-ups. This broke test/Index/opencl-types.cl on several buildbots: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/3294 http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/6498 http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/5239 > [libclang] Support querying whether a declaration is invalid > > This is useful for e.g. highlighting purposes in an IDE. > > Patch by Nikolai Kosjar. > > Differential Revision: https://reviews.llvm.org/D40072 Also reverting follow-ups that otherwise caused conflicts for the revert: r321700 "Fix line endings." r321701 "Fix more line endings." r321698 "[libclang] Fix cursors for functions with trailing return type" > For the function declaration > > auto foo5(Foo) -> Foo; > the parameter tokens were mapped to cursors representing the > FunctionDecl: > > Keyword: "auto" [1:1 - 1:5] FunctionDecl=test5:1:6 > Identifier: "test5" [1:6 - 1:11] FunctionDecl=test5:1:6 > Punctuation: "(" [1:11 - 1:12] FunctionDecl=test5:1:6 > Identifier: "X" [1:12 - 1:13] FunctionDecl=test5:1:6 // Ops, not a TypeRef > Punctuation: ")" [1:13 - 1:14] FunctionDecl=test5:1:6 > Punctuation: "->" [1:15 - 1:17] FunctionDecl=test5:1:6 > Identifier: "X" [1:18 - 1:19] TypeRef=struct X:7:8 > Punctuation: ";" [1:19 - 1:20] > > Fix this by ensuring that the trailing return type is not visited as > first. > > Patch by Nikolai Kosjar. > > Differential Revision: https://reviews.llvm.org/D40561 llvm-svn: 321708
* Fix line endings.Ivan Donchevskii2018-01-031-23/+23
| | | | llvm-svn: 321700
* [libclang] Fix cursors for functions with trailing return typeIvan Donchevskii2018-01-031-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | For the function declaration auto foo5(Foo) -> Foo; the parameter tokens were mapped to cursors representing the FunctionDecl: Keyword: "auto" [1:1 - 1:5] FunctionDecl=test5:1:6 Identifier: "test5" [1:6 - 1:11] FunctionDecl=test5:1:6 Punctuation: "(" [1:11 - 1:12] FunctionDecl=test5:1:6 Identifier: "X" [1:12 - 1:13] FunctionDecl=test5:1:6 // Ops, not a TypeRef Punctuation: ")" [1:13 - 1:14] FunctionDecl=test5:1:6 Punctuation: "->" [1:15 - 1:17] FunctionDecl=test5:1:6 Identifier: "X" [1:18 - 1:19] TypeRef=struct X:7:8 Punctuation: ";" [1:19 - 1:20] Fix this by ensuring that the trailing return type is not visited as first. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40561 llvm-svn: 321698
* [libclang] While visiting a C++ destructor decl, keep the type identifier ↵Argyrios Kyrtzidis2014-02-091-1/+7
| | | | | | | | | | associated with the decl, don't turn it into a type ref. rdar://15907618 llvm-svn: 201042
* Report a correct end location for nameless parameters.Benjamin Kramer2014-02-021-4/+4
| | | | | | | | | | | | | | | Ranges before: void test(void (*)(int), int, float); ~~~~~~~~~~~~~ ~~~~ ~~~~~~ Ranges after: void test(void (*)(int), int, float); ~~~~~~~~~~~~~ ~~~ ~~~~~ This does not change the actual location of the ParmVarDecl, it still points to the location where the name would be. PR17970. llvm-svn: 200640
* [libclang] Make sure we don't access past the tokens buffer while token ↵Argyrios Kyrtzidis2013-11-271-0/+12
| | | | | | | | annotation. Also disable crash recovery using 'LIBCLANG_DISABLE_CRASH_RECOVERY' environment variable. llvm-svn: 195819
* clang/test/Index/annotate-tokens.cpp: Appease msvc-targets with ↵NAKAMURA Takumi2013-04-081-1/+1
| | | | | | -fno-delayed-template-parsing. llvm-svn: 179065
* [libclang] Fix cursor visitation to not ignore template arguments in ↵Argyrios Kyrtzidis2013-04-051-1/+54
| | | | | | | | out-of-line member functions. rdar://13535645 llvm-svn: 178911
* [libclang] For CXXOperatorCallExprs, give a valid source location to the ↵Argyrios Kyrtzidis2012-02-081-3/+3
| | | | | | | | | | DeclRefExpr that is referencing the member function, so we can index the referenced function. Fixes rdar://10762375&10324915 & http://llvm.org/PR11192 llvm-svn: 150033
* Expose more statement, expression, and declaration kinds in libclang,Douglas Gregor2011-10-051-16/+16
| | | | | | from Manuel Holtgrewe! llvm-svn: 141200
* [libclang] Avoid having the cursor of an expression "overwrite" the ↵Argyrios Kyrtzidis2011-06-271-2/+6
| | | | | | | | | | | | | | | annotation of the variable declaration that it belongs to. This can happen for C++ constructor expressions whose range generally include the variable declaration, e.g.: MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor. rdar://9124499. llvm-svn: 133929
* Apply a bug-fix patch from Marcin Kowalczyk to the source locations forChandler Carruth2011-04-021-1/+88
| | | | | | | | | | | a couple of operator overloads which form interesting expressions in the AST. I added test cases for both bugs with the c-index-test's token annotation feature. Also, thanks to John McCall for confirming that this is the correct solution. llvm-svn: 128768
* add missing newlines at end of file.Chris Lattner2010-12-211-1/+1
| | | | llvm-svn: 122309
* Fix bug where annotate tokens was not working for BinaryTypeTraitExpr.Francois Pichet2010-12-081-2/+10
| | | | | | CIndex's EnqueueVisitor must visit elements backward apparently. llvm-svn: 121247
* Fix test that didn't really test anything.Francois Pichet2010-12-081-2/+2
| | | | llvm-svn: 121246
* Visit the children of CXXOperatorCallExprs in source order withinDouglas Gregor2010-07-291-0/+23
libclang, so that clang_annotateTokens() doesn't get confused and miss annotations. llvm-svn: 109706
OpenPOWER on IntegriCloud