summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index
Commit message (Collapse)AuthorAgeFilesLines
* [Wdocumentation] Implement \anchorMark de Wever2019-12-211-0/+8
| | | | Differential revision: https://reviews.llvm.org/D69223
* [NFC] Fix typos in Clangd and ClangKirill Bobyrev2019-12-162-9/+8
| | | | | | Reviewed by: Jim Differential Revision: https://reviews.llvm.org/D71455
* Remove Expr.h include from ASTContext.h, NFCReid Kleckner2019-12-064-4/+8
| | | | | | | ASTContext.h is popular, prune its includes. Expr.h brings in Attr.h, which is also expensive. Move BlockVarCopyInit to Expr.h to accomplish this.
* Redeclare Objective-C property accessors inside the ObjCImplDecl in which ↵Adrian Prantl2019-11-081-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are synthesized. This patch is motivated by (and factored out from) https://reviews.llvm.org/D66121 which is a debug info bugfix. Starting with DWARF 5 all Objective-C methods are nested inside their containing type, and that patch implements this for synthesized Objective-C properties. 1. SemaObjCProperty populates a list of synthesized accessors that may need to inserted into an ObjCImplDecl. 2. SemaDeclObjC::ActOnEnd inserts forward-declarations for all accessors for which no override was provided into their ObjCImplDecl. This patch does *not* synthesize AST function *bodies*. Moving that code from the static analyzer into Sema may be a good idea though. 3. Places that expect all methods to have bodies have been updated. I did not update the static analyzer's inliner for synthesized properties to point back to the property declaration (see test/Analysis/Inputs/expected-plists/nullability-notes.m.plist), which I believed to be more bug than a feature. Differential Revision: https://reviews.llvm.org/D68108 rdar://problem/53782400
* [clang][Index] Replace CodegenNameGenerator with ASTNameGeneratorJan Korous2019-09-052-37/+0
| | | | | | | | Follow-up to: 3ff8c3b73f6, d5d15b4c1fd Should be NFC since the original patch just moved the code. llvm-svn: 371117
* [Index] Added a ShouldSkipFunctionBody callback to libIndex, and refactored ↵Dmitri Gribenko2019-08-291-9/+18
| | | | | | | | | | | | clients to use it instead of inventing their own solution Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66879 llvm-svn: 370338
* [Index] Stopped wrapping FrontendActions in libIndex and its usersDmitri Gribenko2019-08-291-48/+14
| | | | | | | | | Exposed a new function, createIndexingASTConsumer, that creates an ASTConsumer. ASTConsumers compose well. Removed wrapping functionality from createIndexingAction. llvm-svn: 370337
* [Index] Moved the IndexDataConsumer::finish call into the IndexASTConsumer ↵Dmitri Gribenko2019-08-291-32/+24
| | | | | | | | | from IndexAction Doing so removes the last reason to expose a FrontendAction from libIndex. llvm-svn: 370336
* [Index] Create PP callbacks in the ASTConsumerDmitri Gribenko2019-08-291-45/+31
| | | | | | | | Doing so removes one reason to create a custom FrontendAction. FrontendActions are not desirable because they are difficult to compose. ASTConsumers are much easier to compose. llvm-svn: 370323
* [Index] Marked a bunch of classes 'final'Dmitri Gribenko2019-08-291-4/+4
| | | | | | | This file defines multiple inheritance hierarchies and 'final' helps with readability. llvm-svn: 370321
* [clang][Index][NFC] Move IndexDataConsumer default implementationJan Korous2019-08-271-21/+0
| | | | llvm-svn: 370116
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-6/+6
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* Add SVE opaque built-in typesRichard Sandiford2019-08-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the SVE built-in types defined by the Procedure Call Standard for the Arm Architecture: https://developer.arm.com/docs/100986/0000 It handles the types in all relevant places that deal with built-in types. At the moment, some of these places bail out with an error, including: (1) trying to generate LLVM IR for the types (2) trying to generate debug info for the types (3) trying to mangle the types using the Microsoft C++ ABI (4) trying to @encode the types in Objective C (1) and (2) are fixed by follow-on patches but (unlike this patch) they deal mostly with target-specific LLVM details, so seemed like a logically separate change. There is currently no spec for (3) and (4), so reporting an error seems like the correct behaviour for now. The intention is that the types will become sizeless types: http://lists.llvm.org/pipermail/cfe-dev/2019-June/062523.html The main purpose of the sizeless type extension is to diagnose impossible or dangerous uses of the types, such as any that would require sizeof to have a meaningful defined value. Until then, the patch sets the alignments of the types to the values specified in the link above. It also sets the sizes of the types to zero, which is chosen to be consistently wrong and shouldn't affect correctly-written code (i.e. code that would compile even with the sizeless type extension). The patch adds the common subset of functionality needed to test the sizeless type extension on the one hand and to provide SVE intrinsic functions on the other. After this patch, the two pieces of work are essentially independent. The patch is based on one by Graham Hunter: https://reviews.llvm.org/D59245 Differential Revision: https://reviews.llvm.org/D62960 llvm-svn: 368413
* [clang][NFCI] Fix random typosJan Korous2019-07-231-1/+1
| | | | llvm-svn: 366823
* Fix parameter name comments using clang-tidy. NFC.Rui Ueyama2019-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | This patch applies clang-tidy's bugprone-argument-comment tool to LLVM, clang and lld source trees. Here is how I created this patch: $ git clone https://github.com/llvm/llvm-project.git $ cd llvm-project $ mkdir build $ cd build $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm $ ninja $ parallel clang-tidy -checks='-*,bugprone-argument-comment' \ -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \ ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h} llvm-svn: 366177
* [Concepts] Concept definitions (D40381)Saar Raz2019-07-101-2/+2
| | | | | | | First in a series of patches to land C++2a Concepts support. This patch adds AST and parsing support for concept-declarations. llvm-svn: 365699
* Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or ↵Fangrui Song2019-07-031-1/+1
| | | | | | llvm::partition_point. NFC llvm-svn: 365006
* [clang][AST] ASTNameGenerator: A refactoring of CodegenNameGeneratorImpl (NFC).Puyan Lotfi2019-06-191-192/+1
| | | | | | | | | | | | This is a NFC refactor move of CodegenNameGeneratorImpl from clang::Index to clang:AST (and rename to ASTNameGenerator). The purpose is to make the highlevel mangling code more reusable inside of clang (say in places like clang FrontendAction). This does not affect anything in CodegenNameGenerator, except that CodegenNameGenerator will now use ASTNameGenerator (in AST). Differential Revision: https://reviews.llvm.org/D63535 llvm-svn: 363878
* [Index] Compute correct symbol kind for variable templatesIlya Biryukov2019-05-291-0/+24
| | | | | | | | | | | | | | | | | | Summary: The index library itself seems to never pass variable templates as input, however clangd does. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62579 llvm-svn: 361996
* [Index] Correctly set symbol kind of IndirectFieldDeclIlya Biryukov2019-05-291-0/+1
| | | | | | | | | | | | | | | | Summary: The kind has been 'unknown' before, now it is 'field'. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62573 llvm-svn: 361941
* [Index] Fix reported references in presence of template type aliasesIlya Biryukov2019-05-231-16/+28
| | | | | | | | | | | | | | | | Summary: See the added test for an example. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62303 llvm-svn: 361511
* Use llvm::stable_sortFangrui Song2019-04-241-5/+2
| | | | llvm-svn: 359098
* Range-style std::find{,_if} -> llvm::find{,_if}. NFCFangrui Song2019-03-311-4/+3
| | | | llvm-svn: 357359
* [clang][Index] Mark references from Constructors and Destructors to class as ↵Kadir Cetinkaya2019-03-083-2/+7
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 355668
* [clang][index-while-building][NFC] Comment about implementation detail in ↵Jan Korous2019-02-281-0/+1
| | | | | | FileIndexRecord llvm-svn: 355061
* [clang][index-while-building][NFC] FileIndexRecord - Comments, replace auto ↵Jan Korous2019-02-272-8/+7
| | | | | | | | with type Differential Revision: https://reviews.llvm.org/D58478 llvm-svn: 355036
* [clang][index-while-building] FileIndexRecordJan Korous2019-02-273-0/+118
| | | | | | | | | | | Basic data structures for index Tests are missing from this patch - will be covered properly by tests for the whole feature. I'm just trying to split into smaller patches to make it easier for reviewers. Differential Revision: https://reviews.llvm.org/D58478 llvm-svn: 355035
* [index] Improve indexing support for MSPropertyDecl.Volodymyr Sapsai2019-02-272-0/+9
| | | | | | | | | | | | | | | | | 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 llvm-svn: 354942
* [clang][Index] Visit UsingDecls and generate USRs for themKadir Cetinkaya2019-02-263-2/+12
| | | | | | | | | | | | | | | | | 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 llvm-svn: 354878
* [clang][Index] Enable indexing of Template Type Parameters behind a flagKadir Cetinkaya2019-02-215-4/+19
| | | | | | | | | | | | | | | | | 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 llvm-svn: 354560
* [clang][Index] Fix usage of IndexImplicitInstantiationKadir Cetinkaya2019-02-181-4/+4
| | | | | | | | | | | | | | 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 llvm-svn: 354262
* [clang][Index] Add a knob to index function parameters in declarationsKadir Cetinkaya2019-02-113-4/+10
| | | | | | | | | | | | | | | | | 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 llvm-svn: 353695
* Rename getTypeQualifiers to getMethodQualifiers.Anastasia Stulova2019-01-281-1/+1
| | | | | | | | Use more descriptive name for the method qualifiers getter. Differential Revision: https://reviews.llvm.org/D56792 llvm-svn: 352349
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1911-44/+33
| | | | | | | | | | | | | | | | | 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. llvm-svn: 351636
* [Index] Index paremeters in lambda expressions.Haojian Wu2018-12-191-0/+11
| | | | | | | | | | | | Summary: This fixes clangd couldn't find references for lambda parameters. Reviewers: ilya-biryukov Subscribers: ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55437 llvm-svn: 349626
* [OpenCL] Add generic AS to 'this' pointerMikael Nilsson2018-12-131-1/+2
| | | | | | | | | | | | | Address spaces are cast into generic before invoking the constructor. Added support for a trailing Qualifiers object in FunctionProtoType. Note: This recommits the previously reverted patch, but now it is commited together with a fix for lldb. Differential Revision: https://reviews.llvm.org/D54862 llvm-svn: 349019
* Revert "[OpenCL] Add generic AS to 'this' pointer"Mikael Nilsson2018-12-121-2/+1
| | | | | | Reverting because the patch broke lldb. llvm-svn: 348931
* [OpenCL] Add generic AS to 'this' pointerMikael Nilsson2018-12-121-1/+2
| | | | | | | | | | Address spaces are cast into generic before invoking the constructor. Added support for a trailing Qualifiers object in FunctionProtoType. Differential Revision: https://reviews.llvm.org/D54862 llvm-svn: 348927
* [Index] Expose USR generation for typesIlya Biryukov2018-11-261-0/+11
| | | | | | | | | | | | | | Summary: Used in clangd. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52275 llvm-svn: 347558
* [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev2018-11-081-0/+3
| | | | | | | | | | | | | | | | | | Summary: Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt Patch by Kristina Bessonova Reviewers: Anastasia, yaxunl, shafik Reviewed By: Anastasia Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits Differential Revision: https://reviews.llvm.org/D51484 llvm-svn: 346392
* Revert r346326 [OpenCL] Add support of ↵Andrew Savonichev2018-11-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | cl_intel_device_side_avc_motion_estimation This patch breaks Index/opencl-types.cl LIT test: Script: -- : 'RUN: at line 1'; stage1/bin/c-index-test -test-print-type llvm/tools/clang/test/Index/opencl-types.cl -cl-std=CL2.0 | stage1/bin/FileCheck llvm/tools/clang/test/Index/opencl-types.cl -- Command Output (stderr): -- llvm/tools/clang/test/Index/opencl-types.cl:3:26: warning: unsupported OpenCL extension 'cl_khr_fp16' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:4:26: warning: unsupported OpenCL extension 'cl_khr_fp64' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:8:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:11:8: error: declaring variable of type 'half' is not allowed llvm/tools/clang/test/Index/opencl-types.cl:15:3: error: use of type 'double' requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:16:3: error: use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:26:26: warning: unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:35:44: error: use of type '__read_only image2d_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:36:49: error: use of type '__read_only image2d_array_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:37:49: error: use of type '__read_only image2d_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:38:54: error: use of type '__read_only image2d_array_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm-svn: 346338
* [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev2018-11-071-0/+3
| | | | | | | | | | | | | | | | | | Summary: Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt Patch by Kristina Bessonova Reviewers: Anastasia, yaxunl, shafik Reviewed By: Anastasia Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits Differential Revision: https://reviews.llvm.org/D51484 llvm-svn: 346326
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-012-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 llvm-svn: 345882
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-6/+4
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [Index] Use locations to uniquify function-scope BindingDecl USRFangrui Song2018-10-091-0/+7
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 344010
* [Index] Respect "IndexFunctionLocals" option for type loc.Haojian Wu2018-10-041-1/+2
| | | | | | | | | | | | | | | | Summary: Previously, clang index ignored local symbols defined in the function body even IndexFunctionLocals is true. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52877 llvm-svn: 343767
* [Index] Report specialization bases as references when ↵Fangrui Song2018-09-231-5/+6
| | | | | | | | | | | | | | | | | | | | IndexImplicitInstantiation is true Summary: template <typename T> struct B {}; template <typename T> struct D : B<T> {}; // `B` was not reported as a reference This patch fixes this. Reviewers: akyrtzi, arphaman, devnexen Reviewed By: devnexen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52331 llvm-svn: 342831
* [index] Enhance indexing for module referencesArgyrios Kyrtzidis2018-09-183-2/+51
| | | | | | | * Create a USR for the occurrences of the 'module' symbol kind * Record module references for each identifier in an import declaration llvm-svn: 342484
* [Index] Add an option to collect macros from preprocesor.Eric Liu2018-09-181-1/+22
| | | | | | | | | | | | | | Summary: Also added unit tests for the index library; lit+c-index-test is painful... Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D52098 llvm-svn: 342451
* [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
OpenPOWER on IntegriCloud