Commit Graph

36 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 1e8f9cd0c0 [index] Introduce 'ProtocolInterface' as part of SymbolPropertySet
This is useful to directly infer that a method or property is from a protocol interface
at the point of the symbol occurrences.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340696 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-26 06:27:23 +00:00
Argyrios Kyrtzidis 712a70e658 [index] For an ObjC message call, also record as receivers the protocols if they are present in the ObjC type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340109 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 23:50:59 +00:00
Ben Langmuir a50011f98b [index] Set SymbolSubKind::Accessor[GS]etter on class methods
We have the same relation between class properties and getter/setters
that we have for instance properties, so set the same symbol sub-kind.

rdar://problem/32376404

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308800 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 23:04:27 +00:00
Alex Lorenz 19c24885af [index] Objective-C method declarations and message sends with
an empty first selector piece should store the location of the first ':'

rdar://33188656


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13 10:50:21 +00:00
Alex Lorenz 0305311a4e [index] Remove 'implicit' role for message sends in implicit ObjC
property references

rdar://32375673


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-03 10:34:46 +00:00
Alex Lorenz fa589cc930 [index] The references to explicit class properties should be recorded
rdar://32376363


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303751 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24 14:23:40 +00:00
Alex Lorenz d195511ec2 [index] Record references to class receivers used in property references
rdar://32250025


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18 10:43:11 +00:00
Argyrios Kyrtzidis bf5a77287b [index] Mark the ObjC implicit accessor method definitions as 'dynamic' as well
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301548 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 15:05:18 +00:00
Argyrios Kyrtzidis 4802bbed82 [index] For 'transparent' tag typedefs, ignore their tag reference
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 05:42:40 +00:00
Argyrios Kyrtzidis 8cf917cee9 [index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type
In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298392 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 16:56:02 +00:00
Argyrios Kyrtzidis 10eccfa5a0 [index/AST] Add references for ObjC getter=/setter= property attributes and related property getter/setter role fixes
This enhances the AST to keep track of locations of the names in those ObjC property attributes, and reports them for indexing.

Patch by Nathan Hawes!
https://reviews.llvm.org/D30907

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 18:25:40 +00:00
Argyrios Kyrtzidis ce79a7c720 [AST/ObjC] Make ObjCCategoryImplDecl consistent with ObjCCategoryDecl and use the category name as its DeclName
This also addresses the badness in ObjCCategoryImplDecl's API, which was hiding NamedDecl's APIs with different meaning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 09:26:07 +00:00
Argyrios Kyrtzidis ea71a9a14a [index] ObjC: Improve handling of typedefs as base names in ObjC interface declarations
- Report the typedef reference occurrence
- Mark super or protocol references as 'implicit' when they come from a typedef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 17:54:53 +00:00
Argyrios Kyrtzidis 1d680d2459 [index] Add 'Parameter' symbol kind and 'Local' symbol property to distinguish function-local symbols
Parameters have a 'child' relation to their function/method.
Also add an option '-include-locals' to 'c-index-test core' to enable indexing of function-local symbols.

Original patch from Nathan Hawes with some changes by me.
https://reviews.llvm.org/D30304

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 05:37:56 +00:00
Argyrios Kyrtzidis 10d3537953 [index] Improvde how we handle synthesized ObjC properties and the associated ivars.
Related synthesized properties with the ivar they use with the 'accessor' relation, and make sure
we mark them 'implicit' when appropriate.

Patch by Nathan Hawes!
https://reviews.llvm.org/D30012

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 04:49:41 +00:00
Argyrios Kyrtzidis 9a249fca06 [index] When indexing an ObjC method declaration use its base name for the location.
Instead of using the location of the beginning '-'/'+'.
This is consistent with location used for function decls and ObjC method calls where we use the base name as the location as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293134 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 02:11:50 +00:00
Argyrios Kyrtzidis 4a19ab5950 [index] Introduce symbol subkinds to mark an accessor getter or setter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:42:48 +00:00
Argyrios Kyrtzidis 4cb22979c5 [index] Ignore invalid ObjC categories.
We currently are unable to get a USR for those and it doesn't seem useful to try to index them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:08:31 +00:00
Argyrios Kyrtzidis 8293248be4 [index] Add 'IBTypeOf' relation for ObjC methods marked with IBAction and properties with IBOutletCollection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291703 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:01:07 +00:00
Argyrios Kyrtzidis 231cda663b [index] Add 'contained-by' relation between references and their lexical container.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291700 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:51:10 +00:00
Argyrios Kyrtzidis a70b01bf32 [index] Fix issue with protocol name locations in conformance list of an ObjC class when they come from a typedef.
The ObjC class protocol list assumes there is an associated location for each protocol but no location is provided
when the protocol list comes from a typedef, and we end up with a buffer overflow when trying to get locations for the protocol names.

Fixes crash of rdar://28980278.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 02:47:07 +00:00
Argyrios Kyrtzidis 5692230ed4 [index] Fixes for locations and relations in Objective C categories and getters/setters
- Add entries for protocols on categories
- Add relation between categories and class they extend
- Add relation between getters/setters and their corresponding property
- Use category name location as the location of category decls/defs if it has one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:11:22 +00:00
Argyrios Kyrtzidis 0a54c8e0a3 [index] Fix regression where ObjC method declarations may mistakenly get indexed as definition.
rdar://25372906

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-31 20:18:22 +00:00
Ben Langmuir eacdb14b4d [index] Remove redundancy between symbol kind and language
Condense the ObjCKIND and CXXKIND options into just KIND, since the
language was already specified on a per-symbol basis and this
information was redundant. This only changes the internal
representation; naturally the libclang interface remains the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:01:59 +00:00
Argyrios Kyrtzidis 8afb9a8644 [index] Make sure that declarations of builtin functions are indexed.
rdar://25154630

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 04:28:19 +00:00
Argyrios Kyrtzidis 09c709832b [index] Fix assertion hit when indexing re-declarations of built-in functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 02:12:40 +00:00
Argyrios Kyrtzidis 4885d08982 [index] Distinguish USRs of anonymous enums by using their first enumerator.
rdar://24609949.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 07:17:53 +00:00
Argyrios Kyrtzidis f68c28fb05 [index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 07:17:48 +00:00
Argyrios Kyrtzidis 11af75bd5e [index] Ignore ObjCTypeParamDecls during indexing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 04:24:32 +00:00
Argyrios Kyrtzidis e85a1ce362 [index] Report references of ObjC super class/protocols in interfaces and protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 05:33:54 +00:00
Argyrios Kyrtzidis 46f43fd040 [index] Add a caller relation for a call reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 07:56:00 +00:00
Argyrios Kyrtzidis 7a94864d1b [AST/RecursiveASTVisitor] Correction so that dataTraverseStmtPost will get called after the statement has been visited.
Fixes the indexing client of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 07:55:55 +00:00
Argyrios Kyrtzidis 340ce98984 [index] Use ',' to separate symbol roles when printing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 07:55:51 +00:00
Argyrios Kyrtzidis dfb482d55e [test/Index] Set a specific target for the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 22:38:38 +00:00
Argyrios Kyrtzidis 62caeb12d2 [index] Factor libclang's functionality to determing the mangled name of symbols into the clangIndex library.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 22:30:14 +00:00
Argyrios Kyrtzidis 4d8332ae58 [index] Enhance c-index-test tool and have it link and test the clangIndex library directly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 06:39:11 +00:00