aboutsummaryrefslogtreecommitdiff
path: root/test/Index
AgeCommit message (Collapse)Author
2018-11-20[CodeComplete] Penalize inherited ObjC properties for auto-completionSam McCall
Summary: Similar to auto-completion for ObjC methods, inherited properties should be penalized / direct class and category properties should be prioritized. Note that currently, the penalty for using a result from a base class (CCD_InBaseClass) is equal to the penalty for using a method as a property (CCD_MethodAsProperty). Reviewers: jkorous, sammccall, akyrtzi, arphaman, benlangmuir Reviewed By: sammccall, akyrtzi Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53900 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347352 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-12Support Swift in platform availability attributeMichael Wu
Summary: This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, https://github.com/apple/swift-clang/commit/84b5a21c31cb5b0d7d958a478bc01964939b6952 and https://github.com/apple/swift-clang/commit/e5b87f265aede41c8381094bbf54e2715c8293b0 . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added. Reviewers: manmanren, friss, doug.gregor, arphaman, jfb, erik.pilkington, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, ColinKinloch, jrmuizel, cfe-commits Differential Revision: https://reviews.llvm.org/D50318 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346633 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346392 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07Revert r346326 [OpenCL] Add support of ↵Andrew Savonichev
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346338 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346326 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07[CodeComplete] Do not complete self-initializationsIlya Biryukov
Summary: Removes references to initialized variable from the following completions: int x = ^; Handles only the trivial cases where the variable name is completed immediately at the start of initializer or assignment, more complicated cases aren't covered, e.g. these completions still contain 'x': // More complicated expressions. int x = foo(^); int x = 10 + ^; // Other kinds of initialization. int x{^}; int x(^); // Constructor initializers. struct Foo { Foo() : x(^) {} int x; }; We should address those in the future, but they are outside of the scope of this initial change. Reviewers: sammccall Reviewed By: sammccall Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D54156 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346301 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-01[clang] Improve ctor initializer completions.Kadir Cetinkaya
Summary: Instead of providing generic "args" for member and base class initializers, tries to fetch relevant constructors and show their signatures. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ZaMaZaN4iK, eraman, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53654 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345844 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24[Sema] Do not show unused parameter warnings when body is skippedIlya Biryukov
Summary: Without the function body, we cannot determine is parameter was used. Reviewers: ioeric, sammccall Reviewed By: sammccall Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53456 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345122 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-23[clang] Fix a null pointer dereference.Kadir Cetinkaya
Summary: Sometimes expression inside switch statement can be invalid, for example type might be incomplete. In those cases code were causing a null pointer dereference. This patch fixes that. Reviewers: sammccall, ioeric, hokein Reviewed By: sammccall Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53561 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345029 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-22[CodeComplete] Fix accessibility of protected members when accessing members ↵Eric Liu
implicitly. Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344889 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15[CodeComplete] Make sure keyword 'template' is added even when code pattern ↵Eric Liu
is disabled. Reviewers: sammccall, hokein Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344509 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-09[Index] Use locations to uniquify function-scope BindingDecl USRFangrui Song
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
2018-10-04[Index] Respect "IndexFunctionLocals" option for type loc.Haojian Wu
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-02[CodeComplete] Re-fix accessibilty of protected members from base class.Eric Liu
Summary: The initial fix (r337453) had bug and was partially reverted (r338255). This simplies the original fix by explicitly passing the naming class to the completion consumer. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343575 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-23[Index] Report specialization bases as references when ↵Fangrui Song
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342831 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19[Sema] Do not load macros from preamble when LoadExternal is false.Eric Liu
Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52079 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342528 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18[index] Enhance indexing for module referencesArgyrios Kyrtzidis
* Create a USR for the occurrences of the 'module' symbol kind * Record module references for each identifier in an import declaration git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10[clang] Make sure codecompletion is called for calls even when inside a token.Kadir Cetinkaya
Summary: Currently CodeCompleteCall only gets called after a comma or parantheses. This patch makes sure it is called even at the cases like: ```foo(1^);``` Reviewers: ilya-biryukov, ioeric, hokein Reviewed By: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07[libclang] Return the proper pointee type for 'auto' deduced to pointerIvan Donchevskii
Currently the resulting type is always invalid in such case. Differential Revision: https://reviews.llvm.org/D51281 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341656 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-03[Index] Update tests allowing double4 type to be "invalid"Alexey Sotkin
Fixes test failure after r341309 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341314 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-26[index] Introduce 'ProtocolInterface' as part of SymbolPropertySetArgyrios Kyrtzidis
This is useful to directly infer that a method or property is from a protocol interface at the point of the symbol occurrences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340696 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23[libclang] Fix cursors for arguments of Subscript and Call operatorsIvan Donchevskii
The DeclRefExpr of CXXOperatorCallExpr refering to the custom operator is visited before the arguments to the operator call. For the Call and Subscript operator the range of this DeclRefExpr includes the whole call expression, so that all tokens in that range were mapped to the operator function, even the tokens of the arguments. Fix this by ensuring that this particular DeclRefExpr is visited last. Fixes PR25775. Fix by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40481 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340521 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17[index] For an ObjC message call, also record as receivers the protocols if ↵Argyrios Kyrtzidis
they are present in the ObjC type git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340109 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 8/8] Add support for the flag_enum attributeMichael Wu
Summary: This adds support to libclang for reading the flag_enum attribute. This also bumps CINDEX_VERSION_MINOR for this patch series. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49635 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338820 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 7/8] Add support for getting property setter and getter namesMichael Wu
Summary: This allows libclang to access the actual names of property setters and getters without needing to go through the indexer API. Usually default names are used, but the property can specify a different name. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49634 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 6/8] Add support for reading implicit attributesMichael Wu
Summary: Having access to implicit attributes is sometimes useful so users of libclang don't have to duplicate some of the logic in sema. This depends on D49081 since it also adds a CXTranslationUnit flag. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49631 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338815 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 5/8] Add support for ObjC attributes without argsMichael Wu
Summary: This adds support to libclang for identifying ObjC related attributes that don't take arguments. All attributes but NSObject and NSConsumed are tested. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49127 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338813 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 4/8] Add the clang_Type_getNullability() APIMichael Wu
Summary: This patch adds a clang-c API for querying the nullability of an AttributedType. The test here also tests D49081 Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49082 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338809 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 2/8] Add support for ObjCTypeParamMichael Wu
Summary: This patch adds support to the libclang API for identifying ObjCTypeParams in CXTypes. This patch depends on D49063 since both patches add new values to CXTypeKind. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49066 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338807 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03[libclang 1/8] Add support for ObjCObjectTypeMichael Wu
Summary: This patch adds support to the clang-c API for identifying ObjCObjects in CXTypes, enumerating type args and protocols on ObjCObjectTypes, and retrieving the base type of ObjCObjectTypes. Currently only ObjCInterfaceTypes are exposed, which do not have type args or protocols. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49063 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338804 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03Append new attributes to the end of an AttributeList.Michael Kruse
Recommit of r335084 after revert in r335516. ... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse order, and therefore printed in the wrong order in -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effect, especially on diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attributes' order was changed instead. This unfortunately causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible to each other. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reverse. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway. Differential Revision: https://reviews.llvm.org/D48100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338800 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30[CodeComplete] Fix the crash in code completion on access checkingIlya Biryukov
Started crashing in r337453. See the added test case for the crash repro. The fix reverts part of r337453 that causes the crash and does not actually break anything when reverted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338255 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20[Index] Set OrigD before D is changed.Eric Liu
Reviewers: akyrtzi, arphaman Reviewed By: akyrtzi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19[CodeComplete] Fix accessibilty of protected members from base class.Eric Liu
Summary: Currently, protected members from base classes are marked as inaccessible when completing in derived class. This patch fixes the problem by setting the naming class correctly when looking up results in base class according to [11.2.p5]. Reviewers: aaron.ballman, sammccall, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49421 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337453 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09Try to fix build bot after r336524Eric Liu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336532 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09[Index] Add indexing support for MACROs.Eric Liu
Reviewers: akyrtzi, arphaman, sammccall Reviewed By: sammccall Subscribers: malaperle, sammccall, cfe-commits Differential Revision: https://reviews.llvm.org/D48961 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336524 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-25Revert "Append new attributes to the end of an AttributeList."Michael Kruse
This reverts commit r335084 as requested by David Jones and Eric Christopher because of differences of emitted warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21Fix line endings in recently updated test fileIvan Donchevskii
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335220 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21[Sema] Fix overloaded static functions for templatesIvan Donchevskii
Apply almost the same fix as https://reviews.llvm.org/D36390 but for templates. Differential Revision: https://reviews.llvm.org/D43453 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335211 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19Append new attributes to the end of an AttributeList.Michael Kruse
... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse, and therefore printed in the wrong order by -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effects, especially for diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attribute's order was changed instead. It also causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reversed. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway, which often is on the same line. Differential Revision: https://reviews.llvm.org/D48100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335084 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13[libclang] Optionally add code completion results for arrow instead of dotIvan Donchevskii
Follow up for D41537 - libclang part. Differential Revision: https://reviews.llvm.org/D46862 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17[Frontend] Avoid running plugins during code completion parseIvan Donchevskii
Second attempt. Proper line endings. The parsing that is done for code completion is a special case that will discard any generated diagnostics, so avoid running plugins for this case in the first place to avoid performance penalties due to the plugins. A scenario for this is for example libclang with extra plugins like tidy. Patch by Nikolai Kosjar Differential Revision: https://reviews.llvm.org/D46050 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332586 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17Revert https://reviews.llvm.org/D46050 and https://reviews.llvm.org/D45815Ivan Donchevskii
Windows line endings. Requires proper resubmission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16[Frontend] Avoid running plugins during code completion parseIvan Donchevskii
The parsing that is done for code completion is a special case that will discard any generated diagnostics, so avoid running plugins for this case in the first place to avoid performance penalties due to the plugins. A scenario for this is for example libclang with extra plugins like tidy. Patch by Nikolai Kosjar Differential Revision: https://reviews.llvm.org/D46050 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332469 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16Fix an Index test caused by a clang-format change (r332436).Eric Liu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11[libclang] Stop assuming that the internal C++ ABI ↵Richard Smith
ExceptionSpecificationType enumeration is the same as CXCursor_ExceptionSpecificationKind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332130 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01[libclang] Fix the type of 'int (Foo);'Shoaib Meenai
libclang exposes the type of 'int (Foo);' (a global variable of type int called Foo) as CXType_Unexposed. This is because Clang represents Foo's type as ParenType{BuiltinType{Int}}, and libclang does not handle ParenType. Make libclang return CXType_Int as the type of 'int (Foo);' by unwrapping ParenType transparently. Patch by Matt Glazar. Differential Revision: https://reviews.llvm.org/D45713 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331306 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27[OpenCL] Add separate read_only and write_only pipe IR typesSven van Haastregt
SPIR-V encodes the read_only and write_only access qualifiers of pipes, so separate LLVM IR types are required to target SPIR-V. Other backends may also find this useful. These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which replace `opencl.pipe_t`. This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...) which took a read_only pipe with separate versions for read_only and write_only pipes, namely: * __get_pipe_num_packets_ro(...) * __get_pipe_num_packets_wo(...) * __get_pipe_max_packets_ro(...) * __get_pipe_max_packets_wo(...) These separate versions exist to avoid needing a bitcast to one of the two qualified pipe types. Patch by Stuart Brady. Differential Revision: https://reviews.llvm.org/D46015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331026 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24[CodeComplete] Fix completion at the end of keywordsIlya Biryukov
Summary: Make completion behave consistently no matter if it is run at the start, in the middle or at the end of an identifier that happens to be a keyword or a macro name. Since completion is often ran on incomplete identifiers, they may turn into keywords by accident. For example, we should produce same results for all of these completion points: // ^ is completion point. ^class cla^ss class^ Previously clang produced different results for the last case (as if the completion point was after a space: `class ^`). This change also updates some offsets in tests that (unintentionally?) relied on the old behavior. Reviewers: sammccall, bkramer, arphaman, aaron.ballman Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45887 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330717 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24[libclang] Only mark CXCursors for explicit attributes with a typeErik Verbruggen
All attributes have a source range associated with it. However, implicit attributes are added by the compiler, and not added because the user wrote something in the input. So no token type should be set to CXCursor_*Attr. The problem was visible when a class gets marked by e.g. MSInheritanceAttr, which has the full CXXRecordDecl's range as its own range. The effect of marking that range as CXCursor_UnexposedAttr was that all cursors for the record decl, including all child decls, would become CXCursor_UnexposedAttr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330692 91177308-0d34-0410-b5e6-96231b3b80d8