summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index
Commit message (Collapse)AuthorAgeFilesLines
* [index] Introduce 'ProtocolInterface' as part of SymbolPropertySetArgyrios Kyrtzidis2018-08-261-0/+5
| | | | | | | This is useful to directly infer that a method or property is from a protocol interface at the point of the symbol occurrences. llvm-svn: 340696
* [index] For an ObjC message call, also record as receivers the protocols if ↵Argyrios Kyrtzidis2018-08-171-2/+18
| | | | | | they are present in the ObjC type llvm-svn: 340109
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 llvm-svn: 339386
* Port getLocStart -> getBeginLocStephen Kelly2018-08-093-6/+6
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* Remove trailing spaceFangrui Song2018-07-304-25/+25
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [Index] Set OrigD before D is changed.Eric Liu2018-07-201-3/+3
| | | | | | | | | | | | Reviewers: akyrtzi, arphaman Reviewed By: akyrtzi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49476 llvm-svn: 337529
* [Index] Add index::IndexingOptions::IndexImplicitInstantiationFangrui Song2018-07-094-5/+7
| | | | | | | | | | | | | | | | | 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 llvm-svn: 336606
* [Index] Ignore noop #undef's when handling macro occurrences.Eric Liu2018-07-091-0/+2
| | | | llvm-svn: 336584
* [Index] Add clangLex to LINK_LIBSHeejin Ahn2018-07-091-0/+1
| | | | | | Without this, builds with `-DSHARED_LIB=ON` fail. llvm-svn: 336526
* [Index] Add indexing support for MACROs.Eric Liu2018-07-094-34/+128
| | | | | | | | | | | | Reviewers: akyrtzi, arphaman, sammccall Reviewed By: sammccall Subscribers: malaperle, sammccall, cfe-commits Differential Revision: https://reviews.llvm.org/D48961 llvm-svn: 336524
* [Index] Remove unused index::IndexDataConsumer::_anchor()Fangrui Song2018-07-051-2/+0
| | | | | | It was supposed to serve as a key function, but it was invalid as it was not the first out-of-line non-pure virtual function. llvm-svn: 336300
* [Fixed Point Arithmetic] Addition of the remaining fixed point types and ↵Leonard Chan2018-06-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
* This diff includes changes for supporting the following types.Leonard Chan2018-06-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches. The tests included are for asserting that we can declare these types. Fixed the test that was failing by not checking for dso_local on some targets. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333923
* Revert "This diff includes changes for supporting the following types."Leonard Chan2018-06-021-6/+0
| | | | | | | This reverts commit r333814, which fails for a test checking the bit width on ubuntu. llvm-svn: 333815
* This diff includes changes for supporting the following types.Leonard Chan2018-06-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | ``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333814
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-092-3/+3
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 331834
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-0/+2
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [index] Fix methods that take a shared_ptr to just take a reference.Benjamin Kramer2018-04-231-16/+14
| | | | | | | There is no ownership here, passing a shared_ptr just adds confusion. No functionality change intended. llvm-svn: 330595
* [Index] Return SourceLocation to consumers, not FileID/Offset pair.Sam McCall2018-04-092-22/+11
| | | | | | | | | | | | | | | | | | Summary: The FileID/Offset conversion is lossy. The code takes the fileLoc, which loses e.g. the spelling location in some macro cases. Instead, pass the original SourceLocation which preserves all information, and update consumers to match current behavior. This allows us to fix two bugs in clangd that need the spelling location. Reviewers: akyrtzi, arphaman Subscribers: ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D45014 llvm-svn: 329570
* [Index] fix USR generation for namespace{extern{X}}Sam McCall2018-02-021-1/+3
| | | | llvm-svn: 324093
* [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 llvm-svn: 323549
* [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
OpenPOWER on IntegriCloud