summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index
Commit message (Collapse)AuthorAgeFilesLines
* [Index] Reduce size of SymbolInfo struct.Sam McCall2017-12-231-30/+35
| | | | | | | | | | | | | | | | | | | | | Summary: This is currently 16 bytes, the patch reduces it to 4. (Building with clang on linux x84, I guess others are similar) The only subfield that might need a bigger type is SymbolPropertySet, I've moved it to the end of the struct so if it grows, SymbolInfo will only be 8 bytes. With a full index of namespace-scope symbols from the LLVM project (200k) loaded into clangd, this saves ~2MB of RAM. Reviewers: akyrtzi Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41514 llvm-svn: 321411
* 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. llvm-svn: 320954
* [Index] Add setPreprocessor member to IndexDataConsumer.Eric Liu2017-12-071-8/+14
| | | | | | | | | | | | | | | | Summary: This enables us to use information in Preprocessor when handling symbol occurrences. Reviewers: arphaman, hokein Reviewed By: hokein Subscribers: malaperle, cfe-commits Differential Revision: https://reviews.llvm.org/D40884 llvm-svn: 320030
* [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 llvm-svn: 317832
* [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 '.' llvm-svn: 317596
* [index] index field references in __builtin_offsetAlex Lorenz2017-11-071-0/+11
| | | | | | rdar://35109556 llvm-svn: 317593
* Fix indexer crash for default template template parameter valueJan Korous2017-10-101-2/+1
| | | | | | | | rdar://33058798 Differential Revision: https://reviews.llvm.org/D38755 llvm-svn: 315367
* R13575: Fix USR mangling for function pointer typesJan Korous2017-10-101-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D38707 llvm-svn: 315255
* PR13575: Fix USR mangling for fixed-size arraysJan Korous2017-10-091-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D38643 llvm-svn: 315236
* [index] Generate class & metaclass manglings for objcDave Lee2017-09-221-3/+36
| | | | | | | | | | | | | | | | | | | | | | | Summary: ObjC classes have two associated symbols, one for the class and one for the metaclass. This change overloads `CodegenNameGenerator::getAllManglings` to produce both class and metaclass symbols. While this function is called by `clang_Cursor_getCXXManglings`, it's only called for CXXRecordDecl and CXXMethodDecl, and so libclang's behavior is unchanged. Reviewers: arphaman, abdulras, alexshap, compnerd Reviewed By: compnerd Subscribers: compnerd Differential Revision: https://reviews.llvm.org/D37671 llvm-svn: 313997
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-0/+1
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-1/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-0/+1
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* Print enum constant values using the original source formattingAlex Lorenz2017-08-171-0/+1
| | | | | | | | if possible when creating "Declaration" nodes in XML comments rdar://14765746 llvm-svn: 311085
* [index] Add indexing for unresolved-using declarationsBen Langmuir2017-08-163-15/+66
| | | | | | | | | | | 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 llvm-svn: 311053
* [index] Update indexing to handle CXXDeductionGuideDecls properlyArgyrios Kyrtzidis2017-08-153-4/+17
| | | | | | | | | | | 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 llvm-svn: 310933
* [index] Set SymbolSubKind::Accessor[GS]etter on class methodsBen Langmuir2017-07-211-13/+10
| | | | | | | | | 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 llvm-svn: 308800
* [Index] Prevent canonical decl becoming nullptrKrasimir Georgiev2017-07-181-2/+4
| | | | | | | | | | | | | | | | | | Summary: This patch prevents getCanonicalDecl returning nullptr in case it finds a canonical TemplateDeclaration with no attached TemplatedDecl. Found by running the indexer over a version of the standard library deep inside a template metaprogramming mess. Reviewers: klimek, vsk Reviewed By: vsk Subscribers: vsk, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D35212 llvm-svn: 308269
* [index] Added a method indexTopLevelDecls to run indexing on a list of Decls.Ilya Biryukov2017-07-141-0/+12
| | | | | | | | | | | | | | | | Summary: We need it in clangd for refactoring that replaces ASTUnit with manual AST management. Reviewers: akyrtzi, benlangmuir, arphaman, klimek Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35405 llvm-svn: 308016
* [index] Don't add relation to a NamedDecl with no nameBen Langmuir2017-07-121-5/+9
| | | | | | | | | | | | Unless it's one of the special cases (tag, category) that we can handle. This syncs up the check between handling a decl and handling a relation. This would cause invalid nameless decls to end up in relations despite having no name or USR. rdar://problem/32474406 llvm-svn: 307855
* [modules ts] Basic for module linkage.Richard Smith2017-07-071-1/+3
| | | | | | | | | | In addition to the formal linkage rules, the Modules TS includes cases where internal-linkage symbols within a module interface unit can be referenced from outside the module via exported inline functions / templates. We give such declarations "module-internal linkage", which is formally internal linkage, but results in an externally-visible symbol. llvm-svn: 307434
* [index] Index nested name qualifiers in a forward declaration of aAlex Lorenz2017-07-041-0/+2
| | | | | | | | class template specialization rdar://33122110 llvm-svn: 307074
* [index] Remove 'implicit' role for message sends in implicit ObjCAlex Lorenz2017-07-031-1/+25
| | | | | | | | property references rdar://32375673 llvm-svn: 307016
* [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 llvm-svn: 305996
* [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 llvm-svn: 305911
* [index] Record C++17 global binding declarationsAlex Lorenz2017-06-152-0/+10
| | | | | | | | The global C++17 binding declarations should be indexed as variable symbols. Differential Revision: https://reviews.llvm.org/D33920 llvm-svn: 305508
* [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 llvm-svn: 305504
* [index] The references to explicit class properties should be recordedAlex Lorenz2017-05-241-0/+12
| | | | | | rdar://32376363 llvm-svn: 303751
* [index] The references to enum constants from member enums that areAlex Lorenz2017-05-231-1/+9
| | | | | | | | | from template instantiations should refer to the enum constant in the pattern enum in the base template rdar://32325459 llvm-svn: 303651
* [index] The references to member enums from template instantiations shouldAlex Lorenz2017-05-231-0/+5
| | | | | | | | refer to the pattern member enum in the base template rdar://32325459 llvm-svn: 303650
* [index] The references to type aliases and typedefs from templateAlex Lorenz2017-05-231-7/+8
| | | | | | | | | instantiations should refer to the pattern type aliases / typedefs in the base templates rdar://32325459 llvm-svn: 303648
* [index] The references to fields from nested records in template instantiationsAlex Lorenz2017-05-231-6/+14
| | | | | | | | should refer to the pattern fields in the nested records in the base templates rdar://32352429 llvm-svn: 303647
* [index] The references to records from template instantiations should referAlex Lorenz2017-05-231-0/+5
| | | | | | | | to the pattern records in the base templates rdar://32325459 llvm-svn: 303646
* [index] Index the default template parameter valuesAlex Lorenz2017-05-221-0/+46
| | | | | | rdar://32323724 llvm-svn: 303568
* [index] Index the deleted functionsAlex Lorenz2017-05-221-3/+0
| | | | | | rdar://32323386 llvm-svn: 303563
* [index] Visit the default argument values in function definitionsAlex Lorenz2017-05-221-0/+11
| | | | | | rdar://32323315 llvm-svn: 303559
* [index] 'using namespace' declarations in functions should recordAlex Lorenz2017-05-222-2/+8
| | | | | | | | the reference to the namespace rdar://32323190 llvm-svn: 303555
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-202-11/+2
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
* [index] Record references to class receivers used in property referencesAlex Lorenz2017-05-181-0/+3
| | | | | | rdar://32250025 llvm-svn: 303343
* [index] References to fields from template instantiations should refer toAlex Lorenz2017-05-151-0/+15
| | | | | | | | fields in base templates rdar://32197158 llvm-svn: 303068
* [index] Visit and store information about namespace alias declarationsAlex Lorenz2017-05-151-0/+8
| | | | | | rdar://32195226 llvm-svn: 303048
* [index] Store correct location for namespace nested name qualifiersAlex Lorenz2017-05-151-1/+1
| | | | | | rdar://32195200 llvm-svn: 303046
* [index] Avoid a crash that happens when looking up a dependent nameAlex Lorenz2017-05-152-0/+6
| | | | | | | | in a record that has no definition rdar://32194921 llvm-svn: 303045
* [index] Index template specialization arguments for function templatsAlex Lorenz2017-05-121-0/+22
| | | | | | | | Also ensure that class template specialization arguments are covered rdar://31812032 llvm-svn: 302918
* [index] Index simple dependent declaration referencesAlex Lorenz2017-05-102-0/+69
| | | | | | | | | | | | This commit implements basic support for indexing of dependent declaration references. Now the indexer tries to find a suitable match in the base template for a dependent member ref/decl ref/dependent type. rdar://29158210 Differential Revision: https://reviews.llvm.org/D32972 llvm-svn: 302632
* [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. llvm-svn: 302136
* [index] Handle vector types in USR generatorAlex Lorenz2017-04-281-1/+7
| | | | | | rdar://25339187 llvm-svn: 301635
* [index] Mark the ObjC implicit accessor method definitions as 'dynamic' as wellArgyrios Kyrtzidis2017-04-271-4/+4
| | | | llvm-svn: 301548
* [index] Index type source info for class specializationsAlex Lorenz2017-04-251-0/+3
| | | | | | rdar://31758344 llvm-svn: 301315
* [index] Record the 'SpecializationOf' relation for function specializationsAlex Lorenz2017-04-251-0/+4
| | | | | | rdar://31603531 llvm-svn: 301310
OpenPOWER on IntegriCloud