summaryrefslogtreecommitdiffstats
path: root/test/Index
Commit message (Collapse)AuthorAgeFilesLines
* Merging r311330:Hans Wennborg2017-08-232-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r311330 | ibiryukov | 2017-08-21 05:03:08 -0700 (Mon, 21 Aug 2017) | 16 lines Fixed a crash on replaying Preamble's PP conditional stack. Summary: The crash occurs when the first token after a preamble is a macro expansion. Fixed by moving replayPreambleConditionalStack from Parser into Preprocessor. It is now called right after the predefines file is processed. Reviewers: erikjv, bkramer, klimek, yvvan Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36872 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@311591 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default values for function parameter chunksErik Verbruggen2017-07-192-12/+28
| | | | | | | | | | | | | Append optional chunks with their default values. For example: before - "int i", after - "int i = 10" Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D33644 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308433 91177308-0d34-0410-b5e6-96231b3b80d8
* [Index] Prevent canonical decl becoming nullptrKrasimir Georgiev2017-07-181-0/+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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308269 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Remove redundant check-prefix=CHECK from tests. NFC.Mandeep Singh Grang2017-07-171-2/+2
| | | | | | | | | | | | Reviewers: t.p.northover, mstorsjo, rsmith, mcrosier Reviewed By: mstorsjo, mcrosier Subscribers: mcrosier, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D35465 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308192 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Objective-C method declarations and message sends withAlex Lorenz2017-07-131-0/+25
| | | | | | | | | an empty first selector piece should store the location of the first ':' rdar://33188656 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307901 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Don't add relation to a NamedDecl with no nameBen Langmuir2017-07-121-0/+13
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307855 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+7
| | | | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D35187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307771 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r307769 (Forgot to mention the name of the contributor).Alex Lorenz2017-07-121-7/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307770 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+7
| | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Differential Revision: https://reviews.llvm.org/D35187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307769 91177308-0d34-0410-b5e6-96231b3b80d8
* [Frontend] Verify that the bitstream is not empty before readingAlex Lorenz2017-07-072-0/+2
| | | | | | | | | | | | | | | the serialised diagnostics Clang should avoid calling report_fatal_error when the file with the serialised diagnostics is empty. This commit changes Clang's serialised diagnostic reader, now it reports an appropriate error instead of crashing. rdar://31939877 Differential Revision: https://reviews.llvm.org/D35069 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307384 91177308-0d34-0410-b5e6-96231b3b80d8
* [AMDGPU] Fix size and alignment of size_t and pointer typesYaxun Liu2017-07-051-1/+1
| | | | | | | Differential Revision: https://reviews.llvm.org/D34995 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307121 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index nested name qualifiers in a forward declaration of aAlex Lorenz2017-07-041-0/+16
| | | | | | | | | class template specialization rdar://33122110 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307074 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Remove 'implicit' role for message sends in implicit ObjCAlex Lorenz2017-07-031-0/+25
| | | | | | | | | property references rdar://32375673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307016 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Teach clang how to merge typedef over anonymous structs in C mode.Vassil Vassilev2017-07-011-1/+1
| | | | | | | | | | | In C mode clang fails to merge the textually included definition with the one imported from a module. The C lookup rules fail to find the imported definition because its linkage is internal in non C++ mode. This patch reinstates some of the ODR merging rules for typedefs of anonymous tags for languages other than C++. Patch by Raphael Isemann and me (D34510). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306964 91177308-0d34-0410-b5e6-96231b3b80d8
* Change enumerator default linkage type for CBruno Cardoso Lopes2017-07-011-1/+1
| | | | | | | | | | | | | | | Redeclaration lookup should never find hidden enumerators in C, because they do not have linkage (C11 6.2.2/6) The linkage of an enumerator should be VisibleNoLinkage, and isHiddenDeclarationVisible should be checking hasExternalFormalLinkage. This is was reviewed as part of D31778, but splitted into a different commit for clarity. rdar://problem/31909368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306917 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Support for querying the exception specification type through ↵Jonathan Coe2017-06-271-2/+15
| | | | | | | | | | | | | | | | | | | libclang Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306483 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r306103: PR26195: Set correct NestedNameSpecifierLoc for theAlex Lorenz2017-06-271-0/+117
| | | | | | | | | | | | | | | | | | | | | dependent initializer This commit fixes incorrect source positions of dependent c'tor initializers like in the following code: template<typename MyBase> struct Derived: MyBase::InnerIterator { Derived() : MyBase::InnerIterator() {} /// This line is problematic: all positions point to InnerIterator and nothing points to MyBase }; Patch by Serge Preis! Differential Revision: https://reviews.llvm.org/D32439 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306392 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r306103: "PR26195: Set correct NestedNameSpecifierLoc for theAlex Lorenz2017-06-231-117/+0
| | | | | | | | | | dependent initializer" It caused buildbot failures such as this one: http://bb.pgr.jp/builders/test-clang-msc-x64-on-i686-linux-RA/builds/3777/steps/test_clang/logs/Clang%20%3A%3A%20Index__ctor-init-source-loc.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306111 91177308-0d34-0410-b5e6-96231b3b80d8
* PR26195: Set correct NestedNameSpecifierLoc for the dependent initializerAlex Lorenz2017-06-231-0/+117
| | | | | | | | | | | | | | | | | | | This commit fixes incorrect source positions of dependent c'tor initializers like in the following code: template<typename MyBase> struct Derived: MyBase::InnerIterator { Derived() : MyBase::InnerIterator() {} /// This line is problematic: all positions point to InnerIterator and nothing points to MyBase }; Patch by Serge Preis! Differential Revision: https://reviews.llvm.org/D32439 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306103 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add the "SpecializationOf" relation to the forward declarationsAlex Lorenz2017-06-221-3/+7
| | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305996 91177308-0d34-0410-b5e6-96231b3b80d8
* [preprocessor] Fix assertion hit when 'SingleFileParseMode' option is ↵Argyrios Kyrtzidis2017-06-211-0/+10
| | | | | | | | enabled and #if with an undefined identifier and without #else 'HandleEndifDirective' asserts that 'WasSkipping' is false, so switch to using 'FoundNonSkip' as the hint for 'SingleFileParseMode' to keep going with parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305940 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Nested class declarations should be annotated with theAlex Lorenz2017-06-211-0/+17
| | | | | | | | | | | | | | | | | | | | "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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305911 91177308-0d34-0410-b5e6-96231b3b80d8
* [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, ↵Argyrios Kyrtzidis2017-06-202-11/+111
| | | | | | | | | | parse all directive blocks if the condition uses undefined macros This is useful for being able to parse the preprocessor directive blocks even if the header, that defined the macro that is checked, hasn't been included. Differential Revision: https://reviews.llvm.org/D34263 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305797 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Record C++17 global binding declarationsAlex Lorenz2017-06-151-1/+27
| | | | | | | | | The global C++17 binding declarations should be indexed as variable symbols. Differential Revision: https://reviews.llvm.org/D33920 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305508 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index static_assert declarationsAlex Lorenz2017-06-151-0/+16
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305504 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r305117: [libclang] Merge multiple availability clauses whenAlex Lorenz2017-06-121-8/+10
| | | | | | | | | | | getting the platform's availability Patch by Ronald Wampler! Differential Revision: https://reviews.llvm.org/D33478 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305221 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r305117Alex Lorenz2017-06-091-10/+8
| | | | | | | It caused `Index/availability.c` test failure on Linux git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305122 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Merge multiple availability clauses when getting the platform'sAlex Lorenz2017-06-091-8/+10
| | | | | | | | | | | availability Patch by Ronald Wampler! Differential Revision: https://reviews.llvm.org/D33478 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305117 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce a new parsing option ↵Argyrios Kyrtzidis2017-06-091-0/+11
| | | | | | | | 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only. This is useful for parsing a single file, as a fast/inaccurate 'mode' that can still provide declarations from the file, like the classes and their methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305044 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Fix pipe size in TypeInfo.Anastasia Stulova2017-06-051-0/+16
| | | | | | | | | | | | | Pipes are now the size of pointers rather than the size of the type that they contain. Patch by Simon Perretta! Differential Revision: https://reviews.llvm.org/D33597 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304708 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Support "coroutines" feature in module map requires clauseEric Fiselier2017-05-281-0/+1
| | | | | | | | | | | | | | Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304107 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver must return non-zero code on errors in command lineSerge Pavlov2017-05-242-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is recommit of r302775, reverted in r302777 due to a fail in clang-tidy. Original mesage is below. Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang test set. File test/Driver/gfortran.f90 added in r118203 checks forwarding gfortran flags to GCC. Now driver reports error on this file, because the option -working-directory implemented in clang differs from the option with the same name implemented in gfortran, in clang the option requires argument, in gfortran does not. In the file test/Driver/arm-darwin-builtin.c clang is called with options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed in r191435 and now clang reports error on this test. File arm-default-build-attributes.s uses option -verify, which is not supported by driver, it is cc1 option. Similarly, the file split-debug.h uses options -fmodules-embed-all-files and -fmodule-format=obj, which are not supported by driver. Other revealed errors are mainly mistypes. Differential Revision: https://reviews.llvm.org/D33013 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303756 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to explicit class properties should be recordedAlex Lorenz2017-05-241-0/+9
| | | | | | | rdar://32376363 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303751 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to enum constants from member enums that areAlex Lorenz2017-05-231-0/+3
| | | | | | | | | | from template instantiations should refer to the enum constant in the pattern enum in the base template rdar://32325459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303651 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to member enums from template instantiations shouldAlex Lorenz2017-05-231-0/+8
| | | | | | | | | refer to the pattern member enum in the base template rdar://32325459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303650 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to type aliases and typedefs from templateAlex Lorenz2017-05-231-0/+10
| | | | | | | | | | instantiations should refer to the pattern type aliases / typedefs in the base templates rdar://32325459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303648 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to fields from nested records in template instantiationsAlex Lorenz2017-05-231-0/+7
| | | | | | | | | should refer to the pattern fields in the nested records in the base templates rdar://32352429 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303647 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] The references to records from template instantiations should referAlex Lorenz2017-05-231-0/+21
| | | | | | | | | to the pattern records in the base templates rdar://32325459 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303646 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] [OpenCL] Expose more OpenCL CIndex typesSven van Haastregt2017-05-231-1/+103
| | | | | | | | | | | | | | | Expose pipe, sampler_t, clk_event_t, queue_t, reserve_id_t, and all image types. Update the opencl-types.cl test RUN line such that we can test the OpenCL 2.0 types. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303626 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index the default template parameter valuesAlex Lorenz2017-05-221-0/+59
| | | | | | | rdar://32323724 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303568 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Index the deleted functionsAlex Lorenz2017-05-221-0/+8
| | | | | | | rdar://32323386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303563 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Visit the default argument values in function definitionsAlex Lorenz2017-05-221-1/+17
| | | | | | | rdar://32323315 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303559 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] 'using namespace' declarations in functions should recordAlex Lorenz2017-05-221-0/+11
| | | | | | | | | the reference to the namespace rdar://32323190 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303555 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-201-0/+4
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303484 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Avoid one more crash caused by infinite recursion that happens whenAlex Lorenz2017-05-181-0/+17
| | | | | | | | | | | looking up a dependent name in a record that derives from itself rdar://32273000 Differential Revision: https://reviews.llvm.org/D33324 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303366 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Record references to class receivers used in property referencesAlex Lorenz2017-05-181-0/+19
| | | | | | | rdar://32250025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303343 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Avoid another crash that happens when looking up a dependent nameAlex Lorenz2017-05-161-0/+10
| | | | | | | | | in a record that has a base without a definition rdar://32224197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303192 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] References to fields from template instantiations should refer toAlex Lorenz2017-05-151-0/+39
| | | | | | | | | fields in base templates rdar://32197158 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303068 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Visit and store information about namespace alias declarationsAlex Lorenz2017-05-151-0/+7
| | | | | | | rdar://32195226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303048 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Store correct location for namespace nested name qualifiersAlex Lorenz2017-05-151-0/+18
| | | | | | | rdar://32195200 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303046 91177308-0d34-0410-b5e6-96231b3b80d8