summaryrefslogtreecommitdiffstats
path: root/clang/test/Index
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Pretty print __private addr spaceAnastasia Stulova2019-12-271-48/+48
| | | | | | | | | | Add printing of __private address space to TypePrinter to allow it appears in diagnostics and AST dumps as all other language addr spaces. Tags: #clang Differential Revision: https://reviews.llvm.org/D71272
* [Wdocumentation] Implement \anchorMark de Wever2019-12-213-0/+21
| | | | Differential revision: https://reviews.llvm.org/D69223
* Refactor CompareReferenceRelationship and its callers in preparation forRichard Smith2019-12-181-1/+1
| | | | | | | | | | | | | | implementing the resolution of CWG2352. No functionality change, except that we now convert the referent of a reference binding to the underlying type of the reference in more cases; we used to happen to preserve the type sugar from the referent if the only type change was in the cv-qualifiers. This exposed a bug in how we generate code for trivial assignment operators: if the type sugar (particularly the may_alias attribute) got lost during reference binding, we'd use the "wrong" TBAA information for the load during the assignment.
* Fix `sed -e s@FOO@%/S@` and similar when there's @'s in the working directoryDaniel Sanders2019-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | Jenkins sometimes starts a new working directory by appending @2 (or incrementing the number if the @n suffix is already there). This causes several clang tests to fail as: s@INPUT_DIR@%/S/Inputs@g gets expanded to the invalid: s@INPUT_DIR@/path/to/workdir@2/Inputs@g ~~~~~~~~~~ where the part marked with ~'s is interpreted as the flags. These are invalid and the test fails. Previous fixes simply exchanged the @ character for another like | but that's just moving the problem. Address it by adding an expansion that escapes the @ character we're using as a delimiter as well as other magic characters in the replacement of sed's s@@@. There's still room for expansions to cause trouble though. One I ran into while testing this was that having a directory called foo@bar causes lots of `CHECK-NOT: foo` directives to match. There's also things like directories containing `\1`
* [Diagnostic] add a warning which warns about misleading indentationTyker2019-12-031-0/+1
| | | | | | | | | | | | | | Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman, xbolva00 Subscribers: tstellar, cfe-commits, arphaman, Ka-Ka, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D70638
* Revert "[Diagnostic] add a warning which warns about misleading indentation"Tom Stellard2019-11-251-1/+0
| | | | | | This reverts commit 7b86188b50bf6e537fe98b326f258fbd23108b83. This commit introduced bot falures for multi-stage bots with -Werror.
* [Diagnostic] add a warning which warns about misleading indentationTyker2019-11-251-0/+1
| | | | | | | | | | | | Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman, xbolva00 Subscribers: arphaman, Ka-Ka, thakis Differential Revision: https://reviews.llvm.org/D70638
* [AST] Attach comment in `/** doc */ typedef struct A {} B` to B as well as A.Sam McCall2019-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Semantically they're the same thing, and it's important when the underlying struct is anonymous. There doesn't seem to be a problem attaching the same comment to multiple things as it already happens with `/** doc */ int a, b;` This affects an Index test but the results look better (name present, USR points to the typedef). Fixes https://github.com/clangd/clangd/issues/189 Reviewers: kadircet, lh123 Subscribers: ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70203
* [AST] Use written names instead of `type-param-0-0` in more cases when ↵Sam McCall2019-11-151-1/+1
| | | | | | | | | | | | | | | | | | | printing types and decls. Summary: This doesn't cover decls in diagnostics, which use NamedDecl::getNameForDiagnostic(). (That should also be fixed later I think). This covers some cases of https://github.com/clangd/clangd/issues/76 (hover, but not outline or sighelp) Reviewers: hokein Subscribers: ilya-biryukov, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70236
* Improve VFS compatibility on WindowsAdrian McCarthy2019-11-141-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Keys in a virtual file system can be in Posix or Windows form or even a combination of the two. Many VFS tests (and a few Clang tests) were XFAILed on Windows because of false negatives when comparing paths. First, we default CaseSenstive to false on Windows. This allows drive letters like "D:" to match "d:". Windows filesystems are, by default, case insensitive, so this makes sense even beyond the drive letter. Second, we allow slashes to match backslashes when they're used as the root component of a path. Both of these changes are limited to RedirectingFileSystems, so there's little chance of affecting other path handling. These changes allow eleven of the VFS tests to pass on Windows as well as three other Clang tests, so they have re-enabled. This solves the majority of PR43272. Additional VFS test failures will be fixed in separate patches. Differential Revision: https://reviews.llvm.org/D69958
* [Diagnostics] Try to improve warning message for -Wreturn-typeDávid Bolvanský2019-11-091-2/+2
| | | | | | | | | | | | | | Summary: I agree with https://easyaspi314.github.io/gcc-vs-clang.html?fbclid=IwAR1VA0qxiWVUusOQUv5z7JESS7ZpeJy-UqAI5mnJscofGLqXcqeErIUB2gU, current warning message is not very good. We should try to improve it.. Reviewers: rsmith, aaron.ballman, easyaspi314 Reviewed By: aaron.ballman Subscribers: arphaman, Quuxplusone, mehdi_amini, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69762
* [clang] Make handling of unnamed template params similar to function paramsKadir Cetinkaya2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Clang uses the location identifier should be inserted for declarator decls when a decl is unnamed. But for type template and template template paramaters it uses the location of "typename/class" keyword, which makes it hard for tooling to insert/change parameter names. This change tries to unify these two cases by making template parameter parsing and sourcerange operations similar to function params/declarator decls. Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68143 llvm-svn: 373340
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-201-2/+2
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). llvm-svn: 372368
* Make test check position independent as they sometimes come out reversed. NFCI.Douglas Yung2019-09-131-2/+2
| | | | llvm-svn: 371904
* Switch "windows" to "system-windows" in some XFAILsJeremy Morse2019-09-121-1/+1
| | | | | | | | | | The test failure mode appears to be due to the host machine rather than the target. The PS4 buildbots are windows-hosted targeting x86_64-scei-ps4, and are currently reporting these as unexpected failures: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/28114 llvm-svn: 371726
* Start porting ivfsoverlay tests to WindowsReid Kleckner2019-09-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Part of PR43272, the changes are: 1. Use @ as the sed pattern delimiter instead of : so that the drive letter in lit substitutions isn't an issue. 2. Use the %/t and %/S substitutions to get paths with forward slashes to work around string quoting issues in the yaml file. 3. Replace REQUIRES:shell with XFAIL:windows. These tests should pass on Windows, but do not for reasons that are not yet understood. We would like to know if they pass unexpectedly. I was able to remove the XFAILs from two tests, since they already pass with my sed fix: clang/test/VFS/module_missing_vfs.m clang/test/VFS/test_nonmodular.c Reviewers: amccarth Differential Revision: https://reviews.llvm.org/D67454 llvm-svn: 371663
* Actually reorder not and env in crash-recovery-modules.mReid Kleckner2019-09-101-2/+2
| | | | llvm-svn: 371559
* Re-land Remove REQUIRES:shell from tests that pass for me on WindowsReid Kleckner2019-09-101-3/+2
| | | | | | | | | | | | This reverts r371497 (git commit 3d7e9ab7b9f8c53aa41420c54970f0fb421004a2) Reorder `not` with `env` in these two tests so they pass: Driver/rewrite-map-in-diagnostics.c Index/crash-recovery-modules.m. This will not be necessary after D66531 lands. llvm-svn: 371552
* Revert Remove REQUIRES:shell from tests that pass for me on WindowsJames Henderson2019-09-101-1/+2
| | | | | | This reverts r371478 (git commit a9980f60ce083fa6d5fd03c12c58ca0b293e3d60) llvm-svn: 371497
* Remove REQUIRES:shell from tests that pass for me on WindowsReid Kleckner2019-09-101-2/+1
| | | | | | | | | | | | | I see in the history for some of these tests REQUIRES:shell was used as a way to disable tests on Windows because they are flaky there. I tried not to re-enable such tests, but it's possible that I missed some and this will re-enable flaky tests on Windows. If so, we should disable them with UNSUPPORTED:system-windows and add a comment that they are flaky there. So far as I can tell, the lit internal shell is capable of running all of these tests, and we shouldn't use REQUIRES:shell as a proxy for Windows. llvm-svn: 371478
* [preprocessor] Add an opportunity to retain excluded conditional blocksEvgeny Mankov2019-08-271-0/+132
| | | | | | | | | | | | | | It is handy for clang tooling, for instance, in source to source transformation. Reviewers: vpykhtin (Valery Pykhtin), erichkeane (Erich Keane) Subscribers: rsmith (Richard Smith), akyrtzi (Argyrios Kyrtzidis) Tags: #clang Differential Revision: https://reviews.llvm.org/D66597 llvm-svn: 370123
* [libclang][index][NFC] Fix test for skipping already parsed function bodiesJan Korous2019-08-231-1/+1
| | | | llvm-svn: 369822
* [clang] Refactor doc comments to Decls attributionJan Korous2019-08-131-0/+14
| | | | | | | | | | | | - Create ASTContext::attachCommentsToJustParsedDecls so we don't have to load external comments in Sema when trying to attach existing comments to just parsed Decls. - Keep comments ordered and cache their decomposed location - faster SourceLoc-based searching. - Optimize work with redeclarations. - Keep one comment per redeclaration chain (represented by canonical Decl) instead of comment per redeclaration. - For redeclaration chains with no comment attached keep just the last declaration in chain that had no comment instead of every comment-less redeclaration. Differential Revision: https://reviews.llvm.org/D65301 llvm-svn: 368732
* [AIX][test/Index] Set/propagate AIXTHREAD_STK for AIXHubert Tong2019-08-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some tests perform deep recursion, which requires a larger pthread stack size than the relatively low default of 192 KiB for 64-bit processes on AIX. The `AIXTHREAD_STK` environment variable provides a non-intrusive way to request a larger pthread stack size for the tests. The required pthread stack size depends on the build configuration. A 4 MiB default is generous compared to the 512 KiB of macOS; however, it is known that some compilers on AIX produce code that uses comparatively more stack space. Reviewers: xingxue, daltenty, jasonliu Reviewed By: daltenty Subscribers: arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65688 llvm-svn: 368690
* [ASTUnit] Attempt to unbreak Windows buildbots after r366448Ilya Biryukov2019-07-181-2/+2
| | | | llvm-svn: 366457
* [ASTUnit] Fix a regression in cached completionsIlya Biryukov2019-07-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After r345152 cached completions started adding namespaces after nested name specifiers, e.g. in `some_name::^` The CCC_Symbol indicates the completed item cannot be a namespace (it is described as being "a type, a function or a variable" in the comments). Therefore, 'nested specifier' completions should only be added from cache when the context is CCC_SymbolOrNewName (which roughly seems to indicate that a nested name specifier is allowed). Fixes https://bugs.llvm.org/show_bug.cgi?id=42646 Reviewers: kadircet, sammccall Reviewed By: kadircet, sammccall Subscribers: arphaman, nik, sammccall, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64918 llvm-svn: 366448
* [CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken ↵Sam McCall2019-07-182-0/+4
| | | | | | | | | | | | | | | | | | in r342528 Summary: The problem is the default LoadExternal with no completer, which happens when loading global results. Reviewers: ilya-biryukov, nik Subscribers: arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64864 llvm-svn: 366409
* This reverts commit 632a36bfcfc8273c1861f04ff6758d863c47c784.Sylvestre Ledru2019-07-131-0/+2
| | | | | | | | | | | | Some targets such as Python 2.7.16 still use VERSION in their builds. Without VERSION defined, the source code has syntax errors. Reverting as it will probably break many other things. Noticed by Sterling Augustine llvm-svn: 365992
* Remove __VERSION__Sylvestre Ledru2019-07-121-2/+0
| | | | | | | | | | | | | | | | | | | | Summary: It has been introduced in 2011 for gcc compat: https://github.com/llvm-mirror/clang/commit/ad1a4c6e89594e704775ddb6b036ac982fd68cad it is probably time to remove it Reviewers: rnk, dexonsmith Reviewed By: rnk Subscribers: dschuff, aheejin, fedor.sergeev, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64062 llvm-svn: 365962
* [libclang] Fix hang in release / assertion in debug when evaluating ↵Emilio Cobos Alvarez2019-07-091-0/+11
| | | | | | | | | | | | | value-dependent types. Expression evaluator doesn't work in value-dependent types, so ensure that the precondition it asserts holds. This fixes https://bugs.llvm.org/show_bug.cgi?id=42532 Differential Revision: https://reviews.llvm.org/D64409 llvm-svn: 365490
* BitStream reader: propagate errorsJF Bastien2019-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | The bitstream reader handles errors poorly. This has two effects: * Bugs in file handling (especially modules) manifest as an "unexpected end of file" crash * Users of clang as a library end up aborting because the code unconditionally calls `report_fatal_error` The bitstream reader should be more resilient and return Expected / Error as soon as an error is encountered, not way late like it does now. This patch starts doing so and adopting the error handling where I think it makes sense. There's plenty more to do: this patch propagates errors to be minimally useful, and follow-ups will propagate them further and improve diagnostics. https://bugs.llvm.org/show_bug.cgi?id=42311 <rdar://problem/33159405> Differential Revision: https://reviews.llvm.org/D63518 llvm-svn: 364464
* [libclang] Allow skipping warnings from all included filesNikolai Kosjar2019-06-112-0/+8
| | | | | | | | | | | | Depending on the included files and the used warning flags, e.g. - Weverything, a huge number of warnings can be reported for included files. As processing that many diagnostics comes with a performance impact and not all clients are interested in those diagnostics, add a flag to skip them. Differential Revision: https://reviews.llvm.org/D48116 llvm-svn: 363067
* [CodeComplete] Include more text into typed chunks of pattern completionsIlya Biryukov2019-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: To allow filtering on any of the words in the editors. In particular, the following completions were changed: - 'using namespace <#name#>' Typed text before: 'using', after: 'using namespace'. - 'else if (#<condition#>)' Before: 'else', after: 'else if'. - 'using typename <#qualifier#>::<#name#>' Before: 'using', after: 'using typename'. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62615 llvm-svn: 362479
* [Index] Correctly set symbol kind of IndirectFieldDeclIlya Biryukov2019-05-291-0/+10
| | | | | | | | | | | | | | | | 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
* [libclang] visit c++14 lambda capture init expressionsNikolai Kosjar2019-05-211-0/+38
| | | | | | | | Patch by Milian Wolff. Differential Revision: https://reviews.llvm.org/D60672 llvm-svn: 361234
* Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that betterPaul Robinson2019-05-103-3/+3
| | | | | | expresses the intent of the exclusion. llvm-svn: 360447
* [libclang] Forward isInline for NamespaceDecl to libclangNikolai Kosjar2019-05-101-0/+3
| | | | llvm-svn: 360428
* Add an explicit triple to this test to hopefully appease the build bots.Aaron Ballman2019-05-071-1/+1
| | | | llvm-svn: 360155
* Allow field offset lookups in types with incomplete arrays within libclang.Aaron Ballman2019-05-071-0/+31
| | | | | | Patch thanks to Jorn Vernee llvm-svn: 360147
* [c++20] Implement P0428R2 - Familiar template syntax for generic lambdasHamza Sood2019-05-041-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D36527 llvm-svn: 359967
* Make test more robust by writing stdout/stderr to different files.Douglas Yung2019-04-291-3/+3
| | | | | | | | Our internal build bots were failing this test randomly as the stderr output was emitted to the file in the middle of the stdout output line that the test was checking. llvm-svn: 359512
* [libclang] Restore old clang_Cursor_isAnonymous behaviourIvan Donchevskii2019-04-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D54996 Changed the behaviour of clang_Cursor_isAnonymous, but there is no alternative available to get the old behaviour in some cases, which is essential for determining if a record is syntactically accessible, e.g. struct { int x; int y; } foo; struct { struct { int x; int y; }; } bar; void fun(struct { int x; int y; } *param); The only 'anonymous' struct here is the one nested in bar, since there is no way to reference the struct itself, only the fields within. Though the anonymity applies to the instance itself, not the type. To avoid confusion, I have added a new function called clang_Cursor_isAnonymousRecordDecl which has the old behaviour of clang_Cursor_isAnonymous (and updated the doc for the latter as well, which was seemingly forgotten). Patch by Jorn Vernee. Differential Revision: https://reviews.llvm.org/D61232 llvm-svn: 359448
* [libclang] Expose ext_vector_typeSven van Haastregt2019-04-171-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D60775 llvm-svn: 358566
* Clean up ObjCPropertyDecl printingDavid Goldman2019-04-082-4/+4
| | | | | | | | | | | | | | | Summary: - `@property(attr, attr2)` instead of `@property ( attr,attr2 )`. - Change priority of attributes (see code/comments inline). - Support for printing weak and unsafe_unretained attributes. Subscribers: arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57965 llvm-svn: 357937
* [CodeComplete] Fix crash when completing ObjC block parameter with a broken typeSam McCall2019-04-041-0/+12
| | | | | | | | | | | | | | | | | | | Summary: The fix isn't great, but it's hard to fix properly because the completion code sensibly uses ParmVarDecl to represent parameters, but the AST-building code sensibly doesn't synthesize them if the type is broken. Also this case is apparently really rare, so it's probably not worth bending over backwards for. Reviewers: ilya-biryukov Subscribers: javed.absar, kristof.beyls, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60258 llvm-svn: 357686
* [libclang] Expose aligned() attribute.Emilio Cobos Alvarez2019-03-131-0/+12
| | | | | | | | | | | | | | | | | Summary: This is useful because otherwise there's no easy way to distinguish #pragma packed(N) from attribute(packed, aligned(N)) that isn't looking at field offsets (since pragma packed() also creates a packed attribute). Reviewers: Anastasia, arphaman, serge-sans-paille Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59299 llvm-svn: 356062
* [clang][Index] Mark references from Constructors and Destructors to class as ↵Kadir Cetinkaya2019-03-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | 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
* [libclang] Fix CXTranslationUnit_KeepGoingIvan Donchevskii2019-03-073-2/+10
| | | | | | | | | | | | | | | | | | Since commit 56f548bbbb7e4387a69708f70724d00e9e076153 [modules] Round-trip -Werror flag through explicit module build. the behavior of CXTranslationUnit_KeepGoing changed: Unresolved #includes are fatal errors again. As a consequence, some templates are not instantiated and lead to confusing errors. Revert to the old behavior: With CXTranslationUnit_KeepGoing fatal errors are mapped to errors. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D58501 llvm-svn: 355586
* [index] Fixup for r354942. Specify target in test to achieve stable mangling.Volodymyr Sapsai2019-02-271-1/+1
| | | | llvm-svn: 354946
* [index] Improve indexing support for MSPropertyDecl.Volodymyr Sapsai2019-02-271-0/+32
| | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud