summaryrefslogtreecommitdiffstats
path: root/clang/test/Index
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [modules] Refactor and simplify #include handling.Richard Smith2015-05-181-4/+0
| | | | | | | Fix a tiny bug where we'd try to load a module file for the module we're in the middle of building. llvm-svn: 237552
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-1/+1
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* [libclang] Add functions to get information about fields.Argyrios Kyrtzidis2015-04-132-5/+7
| | | | | | Patch by Loïc Jaquemet! llvm-svn: 234762
* [libclang] Fix crash when code-completing inside constructor initializer for ↵Argyrios Kyrtzidis2015-03-131-0/+14
| | | | | | | | a builtin type. rdar://20149746 llvm-svn: 232145
* [libclang] During member ref expression visitation, ignore base anonymous ↵Argyrios Kyrtzidis2015-03-132-1/+29
| | | | | | | | | | struct/union fields. Otherwise they will shadow the real field that that we are interested in. rdar://19783938 llvm-svn: 232141
* [ASTUnit] Fix crash when trying to load a module file via ↵Argyrios Kyrtzidis2015-03-031-0/+5
| | | | | | | | ASTUnit::LoadFromASTFile. rdar://19997358 llvm-svn: 231060
* Add -frtti/-fexceptions to some more tests that assume they're onFilipe Cabecinhas2015-02-261-1/+1
| | | | llvm-svn: 230656
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-255-5/+2
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-255-2/+5
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* This reverts commit r227432, r227438 and r227448.Rafael Espindola2015-01-292-6/+4
| | | | | | | | | | | | | | | | | | | | | | | It should bring the bots back. Original messagses: r227448: Remove unnecessary default. r227438: Fix Index/print-type.cpp test following r227432. r227432: libclang: Add three functions useful for dealing with anonymous fields: clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet llvm-svn: 227472
OpenPOWER on IntegriCloud