summaryrefslogtreecommitdiff
path: root/test/Index/Core/index-source.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-201-2/+2
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372368 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][Index] Mark references from Constructors and Destructors to class as ↵Kadir Cetinkaya2019-03-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | 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
* [clang][Index] Fix usage of IndexImplicitInstantiationKadir Cetinkaya2019-02-181-8/+8
| | | | | | | | | | | | | | Summary: Indexing context was skipping explicit template instantiations as well. This patch makes sure it only skips implicit ones. Subscribers: arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58189 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354262 91177308-0d34-0410-b5e6-96231b3b80d8
* [Index] Use locations to uniquify function-scope BindingDecl USRFangrui Song2018-10-091-0/+2
| | | | | | | | | | | | | | | | | | | Summary: This makes BindingDecl's of the same name have different USRs, so that references can be correctly attributed. int a[1] = {}; { auto [x] = a; x; } { auto [x] = a; x; } Reviewers: akyrtzi, arphaman, rsmith, hokein Reviewed By: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52445 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344010 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] tag declarations should use the decl role instead of refAlex Lorenz2017-11-091-3/+3
| | | | | | | | | | 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
* [index] __builtin_offset's field reference is located at the end locationAlex Lorenz2017-11-071-1/+1
| | | | | | | The starting location is the location of the '.' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317596 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] index field references in __builtin_offsetAlex Lorenz2017-11-071-0/+33
| | | | | | | rdar://35109556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317593 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Update indexing to handle CXXDeductionGuideDecls properlyArgyrios Kyrtzidis2017-08-151-0/+13
| | | | | | | | | | | 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/+16
| | | | | | | | | 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-3/+7
| | | | | | | | | | | | | | | 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-0/+17
| | | | | | | | | | | | | | | | | | | | "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-1/+27
| | | | | | | | | 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/+16
| | | | | | | | | | | 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/+59
| | | | | | | 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-0/+8
| | | | | | | 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-1/+17
| | | | | | | 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-0/+11
| | | | | | | | | 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/+7
| | | | | | | rdar://32195226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303048 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Store correct location for namespace nested name qualifiersAlex Lorenz2017-05-151-0/+18
| | | | | | | rdar://32195200 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303046 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index template specialization arguments for function templatsAlex Lorenz2017-05-121-0/+27
| | | | | | | | | 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-27/+26
| | | | | | | | | | | 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] Index type source info for class specializationsAlex Lorenz2017-04-251-0/+33
| | | | | | | 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/+35
| | | | | | | 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-0/+109
| | | | | | | | | | | | | 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] Record class template specializations using a new 'SpecializationOf'Alex Lorenz2017-04-201-0/+20
| | | | | | | | | | | 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] For C++ constructors/destructors, add references to the parent type ↵Argyrios Kyrtzidis2017-03-171-3/+20
| | | | | | | | | 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] C++: Improve handling of typedefs as base names in C++ class ↵Argyrios Kyrtzidis2017-03-041-1/+14
| | | | | | | | | | | declarations Report the typedef as reference, and desugar it to report the underlying class as an implicit 'base' reference. Reporting the underlying base class for 'base' relations matches the ObjC handling and leads to a simpler model. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296975 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] USR generation: use getTemplateArgs() instead of ↵Argyrios Kyrtzidis2017-02-151-0/+10
| | | | | | | | getTemplateInstantiationArgs() Otherwise we may end up creating a different USR for the definition of a function, vs its declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295191 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add 'contained-by' relation between references and their lexical ↵Argyrios Kyrtzidis2017-01-111-4/+4
| | | | | | container. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291700 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Introduce SymbolSubKind for reporting language-specific details.Argyrios Kyrtzidis2017-01-081-0/+11
| | | | | | Initially reports if a constructor symbol is a copy or move constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291409 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Handle properly C++14's template variables.Argyrios Kyrtzidis2016-11-071-1/+12
| | | | | | | | | - Infer the right symbol kind. - Provide a templated USR, similar to how we handle class templates. rdar://28980398 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286154 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Make sure to mark class template symbols as having 'generic' sub-kind.Argyrios Kyrtzidis2016-11-071-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286153 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fix assertion hit when handling a declaration of C++'s 'operator ↵Argyrios Kyrtzidis2016-11-021-0/+6
| | | | | | | | | | | new' function. Part of this is to allow creating a USR for the canonical decl of that which is implicit and does not have a source location. rdar://28978992 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285868 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fix crash with indexing designated init expressions inside templates.Argyrios Kyrtzidis2016-08-031-0/+12
| | | | | | rdar://27452869 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277570 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Remove redundancy between symbol kind and languageBen Langmuir2016-03-251-1/+1
| | | | | | | | | 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
* [index] Use ',' to separate symbol roles when printing.Argyrios Kyrtzidis2016-02-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262205 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis2016-02-151-0/+9
printing policy. Enable it for USRs and names when indexing. Forward references can have different template argument names; including them makes USRs and names unstable, since the name depends on whether we saw a forward reference or not. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260866 91177308-0d34-0410-b5e6-96231b3b80d8