summaryrefslogtreecommitdiffstats
path: root/lib/Index/IndexDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang][Index] Mark references from Constructors and Destructors to class as ↵Kadir Cetinkaya2019-03-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | NameReference Summary: In current indexing logic we get references to class itself when we see a constructor/destructor which is only syntactically true. Semantically this information is not correct. This patch marks that reference as NameReference to let clients deal with it. Reviewers: akyrtzi, gribozavr, nathawes, benlangmuir Reviewed By: gribozavr, nathawes Subscribers: nathawes, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58814 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355668 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Improve indexing support for MSPropertyDecl.Volodymyr Sapsai2019-02-271-0/+1
| | | | | | | | | | | | | | | | | | | Currently the symbol for MSPropertyDecl has kind `SymbolKind::Unknown` which can trip up various indexing tools. rdar://problem/46764224 Reviewers: akyrtzi, benlangmuir, jkorous Reviewed By: jkorous Subscribers: dexonsmith, cfe-commits, jkorous, jdoerfert, arphaman Differential Revision: https://reviews.llvm.org/D57628 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354942 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][Index] Visit UsingDecls and generate USRs for themKadir Cetinkaya2019-02-261-1/+2
| | | | | | | | | | | | | | | | | Summary: Add indexing of UsingDecl itself. Also enable generation of USRs for UsingDecls, using the qualified name of the decl. Reviewers: ilya-biryukov, akyrtzi Subscribers: arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58340 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354878 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][Index] Enable indexing of Template Type Parameters behind a flagKadir Cetinkaya2019-02-211-0/+2
| | | | | | | | | | | | | | | | | Summary: clangd uses indexing api to provide references and it was not possible to perform symbol information for template parameters. This patch enables visiting of TemplateTypeParmTypeLocs. Reviewers: ilya-biryukov, akyrtzi Subscribers: javed.absar, kristof.beyls, ioeric, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58293 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354560 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][Index] Add a knob to index function parameters in declarationsKadir Cetinkaya2019-02-111-4/+4
| | | | | | | | | | | | | | | | | Summary: Parameters in declarations are useful for clangd, so that we can provide symbol information for them as well. It also helps clangd to be consistent whether a function's definition is accessible or not. Reviewers: hokein, akyrtzi Subscribers: ilya-biryukov, ioeric, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57949 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353695 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-1/+1
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339385 91177308-0d34-0410-b5e6-96231b3b80d8
* [Index] Add index::IndexingOptions::IndexImplicitInstantiationFangrui Song2018-07-091-1/+1
| | | | | | | | | | | | | | | | | Summary: With IndexImplicitInstantiation=true, the following case records an occurrence of B::bar in A::foo, which will benefit cross reference tools. template <class T> struct B { void bar() {}}; template <class T> struct A { void foo(B<T> *x) { x->bar(); }}; int main() { A<int> a; a.foo(0); } Reviewers: akyrtzi, arphaman, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49002 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336606 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fix crash when indexing a C++14 PCH/module related to ↵Argyrios Kyrtzidis2018-01-261-2/+5
| | | | | | | | | | | | | TemplateTemplateParmDecls of alias templates TemplateTemplateParmDecls of alias templates ended-up serialized as 'file-level decls' which was causing a crash while trying to index a PCH/module file that contained them. Commit makes sure TemplateTemplateParmDecls are not recorded as such kind of decls. Fixes crash of rdar://36608297 Differential Revision: https://reviews.llvm.org/D42588 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323549 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-3/+2
| | | | | | Convert most uses to range-for loops. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320954 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] tag declarations should use the decl role instead of refAlex Lorenz2017-11-091-4/+2
| | | | | | | | | | The 'decl' role is more canonical than the 'ref'. This helps us establish the 'specialization-of' relation just by looking at decls or defs. rdar://31884960 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317832 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indexer crash for default template template parameter valueJan Korous2017-10-101-2/+1
| | | | | | | | rdar://33058798 Differential Revision: https://reviews.llvm.org/D38755 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315367 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add indexing for unresolved-using declarationsBen Langmuir2017-08-161-0/+18
| | | | | | | | | | | In dependent contexts we end up referencing these, so make sure they have USRs, and have their declarations indexed. For the most part they behave like typedefs, but we also need to worry about having multiple using declarations with the same "name". rdar://problem/33883650 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311053 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Update indexing to handle CXXDeductionGuideDecls properlyArgyrios Kyrtzidis2017-08-151-0/+4
| | | | | | | | | | | CXXDeductionGuideDecls can't be referenced so there's no need to output a symbol occurrence for them. Also handle DeducedTemplateSpecializationTypeLocs in the TypeIndexer so we don't miss the symbol occurrences of the corresponding template decls. Patch by Nathan Hawes! Differential Revision: https://reviews.llvm.org/D36641 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310933 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index nested name qualifiers in a forward declaration of aAlex Lorenz2017-07-041-0/+2
| | | | | | | | | class template specialization rdar://33122110 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307074 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add the "SpecializationOf" relation to the forward declarationsAlex Lorenz2017-06-221-12/+10
| | | | | | | | | | | | | | | of class template specializations This commit fixes an issue where a forward declaration of a class template specialization was not related to the base template. We need to relate even forward declarations because specializations don't have to be defined. rdar://32869409 Differential Revision: https://reviews.llvm.org/D34462 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305996 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Nested class declarations should be annotated with theAlex Lorenz2017-06-211-1/+3
| | | | | | | | | | | | | | | | | | | | "specializationOf" relation if they pseudo-override a type in the base template This commit fixes an issue where Xcode's renaming engine couldn't find the reference to the second occurrence of "InnerClass" in this example: template<typename T> struct Ts { template<typename U> struct InnerClass { }; }; template<> struct Ts<int> { template<typename U> struct InnerClass; // This occurrence wasn't renamed }; rdar://31884960 Differential Revision: https://reviews.llvm.org/D34392 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305911 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Record C++17 global binding declarationsAlex Lorenz2017-06-151-0/+6
| | | | | | | | | The global C++17 binding declarations should be indexed as variable symbols. Differential Revision: https://reviews.llvm.org/D33920 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305508 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index static_assert declarationsAlex Lorenz2017-06-151-0/+7
| | | | | | | | | | | static_assert declarations have to be visited while indexing so that we can gather the references to declarations that are present in their assert expression. Differential Revision: https://reviews.llvm.org/D33913 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305504 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index the default template parameter valuesAlex Lorenz2017-05-221-0/+46
| | | | | | | rdar://32323724 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303568 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index the deleted functionsAlex Lorenz2017-05-221-3/+0
| | | | | | | rdar://32323386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303563 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Visit the default argument values in function definitionsAlex Lorenz2017-05-221-0/+11
| | | | | | | rdar://32323315 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303559 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] 'using namespace' declarations in functions should recordAlex Lorenz2017-05-221-2/+6
| | | | | | | | | the reference to the namespace rdar://32323190 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303555 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Visit and store information about namespace alias declarationsAlex Lorenz2017-05-151-0/+8
| | | | | | | rdar://32195226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303048 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index template specialization arguments for function templatsAlex Lorenz2017-05-121-0/+22
| | | | | | | | | Also ensure that class template specialization arguments are covered rdar://31812032 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302918 91177308-0d34-0410-b5e6-96231b3b80d8
* [Index] The relation between the declarations in templateAlex Lorenz2017-05-041-3/+1
| | | | | | | | | | | specializations that 'override' declarations in the base template should use the 'specializationOf' relation instead of 'specializationOf | overrideOf'. The indexer relations are meant to be orthogonal, so 'specializationOf' is better than the combined relation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302136 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Mark the ObjC implicit accessor method definitions as 'dynamic' as wellArgyrios Kyrtzidis2017-04-271-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301548 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index type source info for class specializationsAlex Lorenz2017-04-251-0/+3
| | | | | | | rdar://31758344 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301315 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Record the 'SpecializationOf' relation for function specializationsAlex Lorenz2017-04-251-0/+4
| | | | | | | rdar://31603531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301310 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The relation between the declarations in template specializationsAlex Lorenz2017-04-241-4/+60
| | | | | | | | | | | | | that 'override' declarations in the base template should be recorded This can be used for improved "go to definition" feature in Xcode. rdar://31604739 Differential Revision: https://reviews.llvm.org/D32020 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301180 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis2017-04-211-28/+24
| | | | | | | | | purposes - Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300949 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] For 'transparent' tag typedefs, ignore their tag referenceArgyrios Kyrtzidis2017-04-211-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300948 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Record class template specializations using a new 'SpecializationOf'Alex Lorenz2017-04-201-2/+12
| | | | | | | | | | | relationship rdar://31603531 Differential Revision: https://reviews.llvm.org/D32010 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300832 91177308-0d34-0410-b5e6-96231b3b80d8
* [index/AST] Determine if a typedef shares a name and spelling location with ↵Argyrios Kyrtzidis2017-03-211-2/+3
| | | | | | | | | | 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
* [index] For C++ constructors/destructors, add references to the parent type ↵Argyrios Kyrtzidis2017-03-171-0/+9
| | | | | | | | | where its name appears in definitions and declarations Patch by Nathan Hawes! https://reviews.llvm.org/D30730 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298170 91177308-0d34-0410-b5e6-96231b3b80d8
* [index/AST] Add references for ObjC getter=/setter= property attributes and ↵Argyrios Kyrtzidis2017-03-161-2/+21
| | | | | | | | | | | 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
* [index] ObjC: Improve handling of typedefs as base names in ObjC interface ↵Argyrios Kyrtzidis2017-03-041-8/+27
| | | | | | | | | 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
* [index] Improvde how we handle synthesized ObjC properties and the ↵Argyrios Kyrtzidis2017-02-171-30/+57
| | | | | | | | | | | | 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
* [index] When indexing an ObjC method declaration use its base name for the ↵Argyrios Kyrtzidis2017-01-261-1/+7
| | | | | | | | | 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
* [index] Ignore invalid ObjC categories.Argyrios Kyrtzidis2017-01-111-5/+6
| | | | | | 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
* [index] Add 'IBTypeOf' relation for ObjC methods marked with IBAction and ↵Argyrios Kyrtzidis2017-01-111-4/+13
| | | | | | properties with IBOutletCollection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291703 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fixes for locations and relations in Objective C categories and ↵Argyrios Kyrtzidis2016-10-251-9/+37
| | | | | | | | | | | 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
* Use more ArrayRefsDavid Majnemer2016-06-241-2/+2
| | | | | | No functional change is intended, just a small refactoring. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273647 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] libclang: Make sure to treat forward ObjC protocols as ↵Argyrios Kyrtzidis2016-03-091-4/+4
| | | | | | | | ObjCProtocolRef declarations, and fix related crash. rdar://25035376 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262985 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Report references of ObjC super class/protocols in interfaces and ↵Argyrios Kyrtzidis2016-03-031-6/+31
| | | | | | protocols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262584 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Separate the underlying indexing functionality of libclang and ↵Argyrios Kyrtzidis2016-02-121-0/+429
introduce it into the clangIndex library. It is a general goodness for libclang itself to mostly be a wrapper of functionality provided by the libraries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260760 91177308-0d34-0410-b5e6-96231b3b80d8