summaryrefslogtreecommitdiffstats
path: root/clang/test/Index
Commit message (Collapse)AuthorAgeFilesLines
...
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* Make clang_Cursor_getMangling not mangle if the declaration isn't mangledEhsan Akhgari2015-10-081-0/+5
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern C). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249639
* Revert r249437Ehsan Akhgari2015-10-061-5/+0
| | | | llvm-svn: 249440
* Make clang_Cursor_getMangling don't mangle if the declaration isn't mangledEhsan Akhgari2015-10-061-0/+5
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern "C"). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249437
* Fix printing of parameterized Objective-C interfaces.Bob Wilson2015-10-011-0/+5
| | | | | | This change was accidentally omitted from Doug's change in r241541. llvm-svn: 248975
* Relax test to allow for __attribute__((thiscall)). Under Win32 c-index-test ↵Yaron Keren2015-09-251-2/+2
| | | | | | | | | output is CXXMethod=foo:4:7 (unavailable) [type=int () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] CXXConstructor=Foo:5:3 (unavailable) [type=void () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0] llvm-svn: 248626
* Fix bug on reporting availability of deleted methods in libclang.Manuel Klimek2015-09-251-0/+13
| | | | | | Patch by Sergey Kalinichev. llvm-svn: 248596
* Improve the printing of ranges when macros are involved.Richard Trieu2015-09-241-4/+0
| | | | | | | | | | | | Trace the ranges through the macro backtrace better. This allows better range highlighting through all levels of the macro bracktrace. Also some improvements to backtrace printer for omitting different backtraces. Patch by Zhengkai Wu. Differential Revision: http://reviews.llvm.org/D12379 llvm-svn: 248454
* [sema] Fix assertion hit when using libclang to index a particular C++ ↵Argyrios Kyrtzidis2015-09-111-0/+10
| | | | | | | | snippet involving templates. Assertion hit was in ClassTemplateSpecializationDecl::getSourceRange(). llvm-svn: 247373
* Index: expose visibility attributeSaleem Abdulrasool2015-09-051-0/+13
| | | | | | | Expose the previously unexposed visibility attribute via the python and C bindings. llvm-svn: 246931
* [libclang] Return deduced type for auto type, not the one written in the source.Manuel Klimek2015-09-031-1/+26
| | | | | | | | | | | | It used to work, but was accidentally broken by r179769. The issue with decayed types was fixed by r190796. So this patch partially reverts r179769, and adds more tests. This also fixes PR 18669. Patch by Sergey Kalinichev. llvm-svn: 246778
* [libclang] For convenience to clients, make sure that nullability and ↵Argyrios Kyrtzidis2015-08-242-0/+25
| | | | | | | | | | __kindof annotations do not hide the underlying type. rdar://22063577 llvm-svn: 245867
* Initialize the AST consumer as soon as we have both an ASTConsumer and anRichard Smith2015-08-182-2/+5
| | | | | | | ASTContext. Fixes some cases where we could previously initialize the AST consumer more than once. llvm-svn: 245346
* [CUDA] Added stubs for new attributes used by CUDA headers.Artem Belevich2015-08-101-0/+16
| | | | | | | | | The main purpose is to avoid errors and warnings while parsing CUDA header files. The attributes are currently unused otherwise. Differential version: http://reviews.llvm.org/D11690 llvm-svn: 244497
* [tests] Remove calls to grepFilipe Cabecinhas2015-08-101-3/+4
| | | | llvm-svn: 244433
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-091-1/+1
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. llvm-svn: 244416
* [test] Another attempt to fix the test.Argyrios Kyrtzidis2015-08-061-1/+1
| | | | llvm-svn: 244187
* [test] Fix tests in non-darwin bots.Argyrios Kyrtzidis2015-08-053-5/+5
| | | | llvm-svn: 244176
* [test] Attempt a change to see if it fixes the test for the windows bot.Argyrios Kyrtzidis2015-08-051-1/+1
| | | | llvm-svn: 244076
* [test/Index] Update libclang tests to use libclang for creating PCH files.Argyrios Kyrtzidis2015-08-0513-12/+16
| | | | | | | This is consistent and tests the primary configuration we want to test, libclang creating and consuming PCH files. llvm-svn: 244066
* [test] Follow-up for r243119, also add a test case using property methods.Argyrios Kyrtzidis2015-07-281-2/+8
| | | | llvm-svn: 243455
* [test] Attempt to fix failing test in non-darwin bots.Argyrios Kyrtzidis2015-07-241-2/+2
| | | | llvm-svn: 243120
* [code-completion] Strip outer nullability annotations when completing method ↵Argyrios Kyrtzidis2015-07-242-6/+8
| | | | | | | | | | | | implementations. The outer nullability is transferred from the declaration to the implementation so including them is redundant. The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well adding them in the implementation will become redundant and we should strip those as well. rdar://21737451 llvm-svn: 243119
* Silence the driver warnings, if we see "-w" on the Driver.Filipe Cabecinhas2015-07-181-0/+1
| | | | | | | | | | | | | | | | | | Summary: We can enable warnings after that -w, so the patch might not be 100% correct. The problem that triggered this is: we have some amount of tests that expect 0 warnings (including unit tests for -w), but -w ends up not fully silencing everything. Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11322 llvm-svn: 242606
* Allow any comment to be a trailing comment when -fparse-all-comments is on.James Dennett2015-07-151-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | This helps with freeform documentation styles, where otherwise code like enum class E { E1, // D1 E2 // D2 }; would result in D1 being associated with E2. To properly associate E1 with D1 and E2 with D2, this patch allows all raw comments C such that C.isParseAllComments() to participate in trailing comment checks inside getRawCommentForDeclNoCache. This takes care of linking the intended documentation with the intended decls. There remains an issue with code like: foo(); // DN int x; To prevent DN from being associated with x, this patch adds a new test on preceding-line comments C (where C.isParseAllComments() and also C's kind is RCK_OrdinaryBCPL or RCK_OrdinaryC) that checks whether C is the first non-whitespace thing on C's starting line. Patch from Luke Zarko <zarko@google.com>, D11069 reviewed by rsmith. llvm-svn: 242317
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-132-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-132-21/+10
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-132-10/+21
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242058
* Try to fix the test harder, it still fails on windows for unknown reasons.Benjamin Kramer2015-07-101-1/+1
| | | | llvm-svn: 241902
* Reapply test for r241811 with a fix for msvc compat mode.Benjamin Kramer2015-07-101-0/+16
| | | | | | | Delayed template parsing interferes with code completion, just distable it for this test. This reverts r241811. llvm-svn: 241899
* Revert test lines added in r241811, "[CodeCompletion] Don't crash on member ↵NAKAMURA Takumi2015-07-101-16/+0
| | | | | | | | inits of templated constructors.", for now. It doesn't pass for targeting MS mode. llvm-svn: 241882
* [CodeCompletion] Don't crash on member inits of templated constructors.Benjamin Kramer2015-07-091-0/+16
| | | | | | | Also fixes a crash (on invalid) member functions with a colon initializer. PR23948. llvm-svn: 241811
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-085-2/+5
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-075-5/+2
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-075-2/+5
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* [libclang] Implement proper code-completion in an ObjC type parameter position.Douglas Gregor2015-07-071-0/+13
| | | | | | rdar://19670303 llvm-svn: 241561
* [libclang] When inferring nonnull use the contextual keyword for the ↵Douglas Gregor2015-07-071-1/+16
| | | | | | | | | | code-completion results, when appropriate. rdar://20742295 llvm-svn: 241560
* [libclang] Replace ObjC generic parameters when code-completing method ↵Douglas Gregor2015-07-071-1/+11
| | | | | | | | implementations. rdar://20643768 llvm-svn: 241559
* [libclang] Fix code-completion of block parameters that are marked with ↵Douglas Gregor2015-07-072-6/+21
| | | | | | | | nullability specifier. rdar://20755276 llvm-svn: 241558
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-0/+53
| | | | | | rdar://19369529 llvm-svn: 241557
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-071-2/+2
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* C++ support for Objective-C lightweight generics.Douglas Gregor2015-07-072-8/+11
| | | | | | | | | | | | | | | | | | | Teach C++'s tentative parsing to handle specializations of Objective-C class types (e.g., NSArray<NSString *>) as well as Objective-C protocol qualifiers (id<NSCopying>) by extending type-annotation tokens to handle this case. As part of this, remove Objective-C protocol qualifiers from the declaration specifiers, which never really made sense: instead, provide Sema entry points to make them part of the type annotation token. Among other things, this properly diagnoses bogus types such as "<NSCopying> id" which should have been written as "id <NSCopying>". Implements template instantiation support for, e.g., NSArray<T>* in C++. Note that parameterized classes are not templates in the C++ sense, so that cannot (for example) be used as a template argument for a template template parameter. Part of rdar://problem/6294649. llvm-svn: 241545
* Handle Objective-C type arguments.Douglas Gregor2015-07-072-2/+43
| | | | | | | | | | | | | | | | | | | | | Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-0/+19
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* [ObjC] Add NSValue support for objc_boxed_expressionsAlex Denisov2015-06-261-32/+49
| | | | | | | | | | | | | Patch extends ObjCBoxedExpr to accept records (structs and unions): typedef struct __attribute__((objc_boxable)) _Color { int r, g, b; } Color; Color color; NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)]; llvm-svn: 240761
* Replace __double_underscored type nullability qualifiers with ↵Douglas Gregor2015-06-242-3/+3
| | | | | | | | | | | | | | | | _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. llvm-svn: 240596
* Code completion for nullability type specifiers.Douglas Gregor2015-06-194-0/+38
| | | | | | Another part of rdar://problem/18868820. llvm-svn: 240159
* Extend type nullability qualifiers for Objective-C.Douglas Gregor2015-06-191-4/+4
| | | | | | | | | | | | | | | Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. llvm-svn: 240154
* Commit some test changes somehow missed in r239789.Richard Smith2015-06-161-4/+4
| | | | llvm-svn: 239791
* [modules] Move implicit creation of ImportDecls for #includes transformed ↵Richard Smith2015-05-182-4/+4
| | | | | | into module imports from the frontend into Sema where it belongs. llvm-svn: 237555
OpenPOWER on IntegriCloud