summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Driver: support `/Zc:char8_t` and `/Zc:char8_t-`Saleem Abdulrasool2019-05-281-0/+7
| | | | | | | Update the `cl` emulation to support the `/Zc:char8_t[-]?` options as per the MSVC 2019.1 toolset. These are aliases for `-fchar8_t` and `-fno-char8_t`. llvm-svn: 361859
* [ARM] Replace fp-only-sp and d16 with fp64 and d32.Simon Tatham2019-05-282-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those two subtarget features were awkward because their semantics are reversed: each one indicates the _lack_ of support for something in the architecture, rather than the presence. As a consequence, you don't get the behavior you want if you combine two sets of feature bits. Each SubtargetFeature for an FP architecture version now comes in four versions, one for each combination of those options. So you can still say (for example) '+vfp2' in a feature string and it will mean what it's always meant, but there's a new string '+vfp2d16sp' meaning the version without those extra options. A lot of this change is just mechanically replacing positive checks for the old features with negative checks for the new ones. But one more interesting change is that I've rearranged getFPUFeatures() so that the main FPU feature is appended to the output list *before* rather than after the features derived from the Restriction field, so that -fp64 and -d32 can override defaults added by the main feature. Reviewers: dmgreen, samparker, SjoerdMeijer Subscribers: srhines, javed.absar, eraman, kristof.beyls, hiraditya, zzheng, Petar.Avramovic, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60691 llvm-svn: 361845
* [CodeComplete] Consistently break after '{' in multi-line patternsIlya Biryukov2019-05-282-16/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Completion can return multi-line patterns in some cases, e.g. for (<#init#>; <#cond#>; <#inc#>) { <#body#> } However, most patterns break the line only before closing brace, resulting in code like: namespace <#name#> { <#decls#> } While some (e.g. the 'for' example above) are breaking lines after the opening brace too. This change ensures all patterns consistently break after the opening brace, this leads to nicer UX when using those in an actual editor. Reviewers: gribozavr Reviewed By: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62405 llvm-svn: 361829
* Re-commit r357452 (take 2): "SimplifyCFG SinkCommonCodeFromPredecessors: ↵Hans Wennborg2019-05-283-3/+2
| | | | | | | | | | | | | | | | | | | | Also sink function calls without used results (PR41259)" This was reverted in r360086 as it was supected of causing mysterious test failures internally. However, it was never concluded that this patch was the root cause. > The code was previously checking that candidates for sinking had exactly > one use or were a store instruction (which can't have uses). This meant > we could sink call instructions only if they had a use. > > That limitation seemed a bit arbitrary, so this patch changes it to > "instruction has zero or one use" which seems more natural and removes > the need to special-case stores. > > Differential revision: https://reviews.llvm.org/D59936 llvm-svn: 361811
* Revert [test] Fix plugin testsDon Hinton2019-05-2812-6/+199
| | | | | | | | This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1) It's causing buildbot breakage, so reverting while I investigate. llvm-svn: 361793
* [test] Fix plugin testsDon Hinton2019-05-2812-199/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following changes were required to fix these tests: 1) Change LLVM_ENABLE_PLUGINS to an option and move it to llvm/CMakeLists.txt with an appropriate default -- which matches the original default behavior. 2) Move the plugins directory from clang/test/Analysis clang/lib/Analysis. It's not enough to add an exclude to the lit.local.cfg file because add_lit_testsuites recurses the tree and automatically adds the appropriate `check-` targets, which don't make sense for the plugins because they aren't tests and don't have `RUN` statements. Here's a list of the `clang-check-anlysis*` targets with this change: ``` $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis check-clang-analysis check-clang-analysis-checkers check-clang-analysis-copypaste check-clang-analysis-diagnostics check-clang-analysis-engine check-clang-analysis-exploration_order check-clang-analysis-html_diagnostics check-clang-analysis-html_diagnostics-relevant_lines check-clang-analysis-inlining check-clang-analysis-objc check-clang-analysis-unified-sources check-clang-analysis-z3 ``` 3) Simplify the logic and only include the subdirectories under clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set. Reviewed By: NoQ Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62445 llvm-svn: 361790
* [Driver] Change layout of per-target runtimes to resemble multiarchPetr Hosek2019-05-2727-24/+24
| | | | | | | | | | | | | | | | | | | | | | | This is a follow up to r361432, changing the layout of per-target runtimes to more closely resemble multiarch. While before, we used the following layout: [RESOURCE_DIR]/<target>/lib/libclang_rt.<runtime>.<ext> Now we use the following layout: [RESOURCE_DIR]/lib/<target>/libclang_rt.<runtime>.<ext> This also more closely resembles the existing "non-per-target" layout: [RESOURCE_DIR]/lib/<os>/libclang_rt.<runtime>-<arch>.<ext> This change will enable further simplification of the driver logic in follow up changes. Differential Revision: https://reviews.llvm.org/D62469 llvm-svn: 361784
* [Preprocessor] Fix crash emitting note with framework location for "file not ↵Volodymyr Sapsai2019-05-272-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | found" error. A filename can be remapped with a header map to point to a framework header and we can find the corresponding framework without the header. But if the original filename doesn't have a remapped framework name, we'll fail to find its location and will dereference a null pointer during diagnostics emission. Fix by tracking remappings better and emit the note only if a framework is found before any of the remappings. rdar://problem/48883447 Reviewers: arphaman, erik.pilkington, jkorous Reviewed By: arphaman Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D61707 llvm-svn: 361779
* When dumping the AST to JSON, dump the type information from a typeid ↵Aaron Ballman2019-05-271-2/+11
| | | | | | expression with a type operand. llvm-svn: 361769
* When dumping the AST to JSON, dump whether a function is variadic or not.Aaron Ballman2019-05-271-0/+2
| | | | llvm-svn: 361768
* When dumping the AST to JSON, dump the declared name of a MemberExpr operand.Aaron Ballman2019-05-273-0/+13
| | | | llvm-svn: 361767
* When dumping the AST to JSON, dump the argument name to a sizeof pack ↵Aaron Ballman2019-05-271-1/+2
| | | | | | expression. llvm-svn: 361766
* Add test cases for dumping AST expression nodes to JSON; NFC.Aaron Ballman2019-05-271-0/+8992
| | | | llvm-svn: 361764
* [OpenCL] Fix file-scope const sampler variable for 2.0Yaxun Liu2019-05-272-2/+20
| | | | | | | | | | | | | | | | | | | OpenCL spec v2.0 s6.13.14: Samplers can also be declared as global constants in the program source using the following syntax. const sampler_t <sampler name> = <value> This works fine for OpenCL 1.2 but fails for 2.0, because clang duduces address space of file-scope const sampler variable to be in global address space whereas spec v2.0 s6.9.b forbids file-scope sampler variable to be in global address space. The fix is not to deduce address space for file-scope sampler variables. Differential Revision: https://reviews.llvm.org/D62197 llvm-svn: 361757
* [CodeComplete] Complete 'return true/false' in boolean functionsIlya Biryukov2019-05-271-2/+15
| | | | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62391 llvm-svn: 361753
* [Driver] Update handling of c++ and runtime directoriesPetr Hosek2019-05-2610-13/+13
| | | | | | | | | | | | This is a follow up to r361432 and r361504 which addresses issues introduced by those changes. Specifically, it avoids duplicating file and runtime paths in case when the effective triple is the same as the cannonical one. Furthermore, it fixes the broken multilib setup in the Fuchsia driver and deduplicates some of the code. Differential Revision: https://reviews.llvm.org/D62442 llvm-svn: 361709
* Permit static local structured bindings to be named from arbitrary scopes ↵Richard Smith2019-05-252-3/+18
| | | | | | inside their declaring scope. llvm-svn: 361686
* Revert "[Analysis] Link library dependencies to Analysis plugins"Akira Hatanaka2019-05-253-6/+3
| | | | | | | | | | | This reverts commit r361340. The following builder has been broken for the past few days because of this commit: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/ Also revert r361399, which was committed to fix r361340. llvm-svn: 361685
* [analyzer] Add a prunable note for skipping vbase inits in subclasses.Artem Dergachev2019-05-241-0/+44
| | | | | | | | | | | | | When initialization of virtual base classes is skipped, we now tell the user about it, because this aspect of C++ isn't very well-known. The implementation is based on the new "note tags" feature (r358781). In order to make use of it, allow note tags to produce prunable notes, and move the note tag factory to CoreEngine. Differential Revision: https://reviews.llvm.org/D61817 llvm-svn: 361682
* [CFG] Add branch to skip vbase inits when they're handled by superclass.Artem Dergachev2019-05-242-34/+209
| | | | | | | | | | | | | | | | | | | This patch adds the run-time CFG branch that would skip initialization of virtual base classes depending on whether the constructor is called from a superclass constructor or not. Previously the Static Analyzer was already skipping virtual base-class initializers in such constructors, but it wasn't skipping their arguments and their potential side effects, which was causing pr41300 (and was generally incorrect). The previous skipping behavior is now replaced with a hard assertion that we're not even getting there due to how our CFG works. The new CFG element is under a CFG build option so that not to break other consumers of the CFG by this change. Static Analyzer support for this change is implemented. Differential Revision: https://reviews.llvm.org/D61816 llvm-svn: 361681
* Mark tests as x86.Alina Sbirlea2019-05-242-0/+2
| | | | llvm-svn: 361674
* Default arguments are potentially constant evaluated.Richard Smith2019-05-241-0/+18
| | | | | | | | We need to eagerly instantiate constexpr functions used in them even if the default argument is never actually used, because we might evaluate portions of it when performing semantic checks. llvm-svn: 361670
* [Analyzer] Checker for non-determinism caused by iteration of unordered ↵Mandeep Singh Grang2019-05-242-0/+89
| | | | | | | | | | | | | | | | | | container of pointers Summary: Added a checker for non-determinism caused by iterating unordered containers like std::unordered_set containing pointer elements. Reviewers: NoQ, george.karpenkov, whisperity, Szelethus, baloghadamsoftware Reviewed By: Szelethus Subscribers: mgorny, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, jdoerfert, Charusso, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59279 llvm-svn: 361664
* Adding an explicit triple to this test to appease build bots.Aaron Ballman2019-05-241-1/+1
| | | | llvm-svn: 361662
* Add JSON dumping tests for ObjC statements; add support for dumping @catch ↵Aaron Ballman2019-05-241-0/+719
| | | | | | catch-all statements. llvm-svn: 361660
* [OpenMP] Add test for requires and unified shared memory clause with declare ↵Gheorghe-Teodor Bercea2019-05-241-0/+67
| | | | | | | | | | | | | | | | | | | | | target link Summary: This patch adds a test for requires with unified share memory clause when a declare target link is present. This test needs to go in prior to changes to declare target link for comparison purposes. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62407 llvm-svn: 361658
* [NewPassManager] Add tuning option: LoopUnrolling [clang-change]Alina Sbirlea2019-05-241-0/+55
| | | | | | | | | | | | | | | | Summary: Use CodeGenOpts's setting for loop unrolling. [to be coupled with D61618] Reviewers: chandlerc Subscribers: jlebar, dmgreen, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61620 llvm-svn: 361653
* Add support for dumping Objective C AST declaration nodes to JSON.Aaron Ballman2019-05-241-0/+1704
| | | | llvm-svn: 361652
* [CodeComplete] Add whitespace around braces in lambda completionsIlya Biryukov2019-05-241-5/+5
| | | | | | | This produces nicer output. Trivial follow-up to r361461, so sending without review. llvm-svn: 361645
* [OpenCL] Add support for the cl_arm_integer_dot_product extensionsKevin Petit2019-05-242-0/+81
| | | | | | | | | The specification is available in the Khronos OpenCL registry: https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_integer_dot_product.txt Signed-off-by: Kevin Petit <kevin.petit@arm.com> llvm-svn: 361641
* [CodeComplete] Filter override completions by function nameIlya Biryukov2019-05-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We put only part of the signature starting with a function name into "typed text" chunks now, previously the whole signature was "typed text". This leads to meaningful fuzzy match scores, giving better signals to compare with other completion items. Ideally, we would not display the result type to the user, but that requires adding a new kind of completion chunk. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62298 llvm-svn: 361623
* Do not resolve directory junctions for `-fdiagnostics-absolute-paths` on ↵Igor Kudrin2019-05-242-1/+10
| | | | | | | | | | | | | | Windows. If the source file path contains directory junctions, and we resolve them when printing diagnostic messages, these paths look independent for an IDE. For example, both Visual Studio and Visual Studio Code open separate editors for such paths, which is not only inconvenient but might even result in losing changes made in one of them. Differential Revision: https://reviews.llvm.org/D59415 llvm-svn: 361598
* [analyzer] NFC: Prevent multi-file plist test from spamming up the build folder.Artem Dergachev2019-05-242-6/+2
| | | | | | | It was producing an HTML report with a random name on every tests run and never cleaned those up. llvm-svn: 361592
* [CFG] NFC: Modernize a test file for constructor initializer CFGs.Artem Dergachev2019-05-241-71/+151
| | | | | | | | | Move FileCheck directives around so that it was easy to understand what tests what and what effect do changes have. Differential Revision: https://reviews.llvm.org/D61815 llvm-svn: 361587
* Fix hang during constant evaluation of union assignment.Eric Fiselier2019-05-231-0/+8
| | | | | | | | | | HandleUnionActiveMemberChange forgot to walk over a nop implicit conversion node and got stuck in the process. As a cleanup I changed the declaration of `E` so it can't be accidentally accessed after the loop. llvm-svn: 361571
* [analyzer] List checker/plugin options in 3 categories: released, alpha, ↵Kristof Umann2019-05-232-19/+82
| | | | | | | | | | | | developer Same patch as D62093, but for checker/plugin options, the only difference being that options for alpha checkers are implicitly marked as alpha. Differential Revision: https://reviews.llvm.org/D62093 llvm-svn: 361566
* [OPENMP]Do not crash for const firstprivates.Alexey Bataev2019-05-231-2/+5
| | | | | | | | | If the variable is a firstprivate variable and it was not emitted beause this a constant variable with the constant initializer, we can use the initial value instead of the variable itself. It also fixes the problem with the compiler crash in this case. llvm-svn: 361564
* Use clang_cc1 instead of clang in CodeGen test.Alina Sbirlea2019-05-231-4/+4
| | | | llvm-svn: 361562
* [analyzer] Hide developer-only checker/package options by defaultKristof Umann2019-05-231-0/+6
| | | | | | | | | These options are now only visible under -analyzer-checker-option-help-developer. Differential Revision: https://reviews.llvm.org/D61839 llvm-svn: 361561
* [analyzer] List checkers in 3 categories: released, alpha, developerKristof Umann2019-05-231-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the only way to display the list of available checkers was to invoke the analyzer with -analyzer-checker-help frontend flag. This however wasn't really great from a maintainer standpoint: users came across checkers meant strictly for development purposes that weren't to be tinkered with, or those that were still in development. This patch creates a clearer division in between these categories. From now on, we'll have 3 flags to display the list checkers. These lists are mutually exclusive and can be used in any combination (for example to display both stable and alpha checkers). -analyzer-checker-help: Displays the list for stable, production ready checkers. -analyzer-checker-help-alpha: Displays the list for in development checkers. Enabling is discouraged for non-development purposes. -analyzer-checker-help-developer: Modeling and debug checkers. Modeling checkers shouldn't be enabled/disabled by hand, and debug checkers shouldn't be touched by users. Differential Revision: https://reviews.llvm.org/D62093 llvm-svn: 361558
* [analyzer] Add a new frontend flag to display all checker optionsKristof Umann2019-05-233-7/+32
| | | | | | | | | Add the new frontend flag -analyzer-checker-option-help to display all checker/package options. Differential Revision: https://reviews.llvm.org/D57858 llvm-svn: 361552
* Update breaking test.Alina Sbirlea2019-05-231-1/+1
| | | | llvm-svn: 361542
* [NewPassManager] Add tuning option: SLPVectorization [clang-change]Alina Sbirlea2019-05-231-0/+25
| | | | | | | | | | | | | | | | Summary: NewPassManager is not using CodeGenOpts values before this patch. [to be coupled with D61616] Reviewers: chandlerc Subscribers: jlebar, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61617 llvm-svn: 361534
* [Driver] Move the "-o OUT -x TYPE SRC.c" flags to the end of -cc1Reid Kleckner2019-05-233-54/+58
| | | | | | | | | | | New -cc1 arguments, such as -faddrsig, have started appearing after the input name. I personally find it convenient for the input to be the last argument to the compile command line, since I often need to edit it when running crash reproduction scripts. Differential Revision: https://reviews.llvm.org/D62270 llvm-svn: 361530
* [OPENMP]Simplify codegen for the outlined regions.Alexey Bataev2019-05-2328-158/+269
| | | | | | | Simplified codegen for the outlined regions, excluding duplication code for handling variables with the reference types. llvm-svn: 361529
* lld-link, clang: Treat non-existent input files as possible spellos for ↵Nico Weber2019-05-233-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | option flags OptTable treats arguments starting with / that aren't a known option as filenames. This means lld-link's and clang-cl's typo correction for unknown flags didn't do spell checking for misspelled options that start with /. I first tried changing OptTable, but that got pretty messy, see PR41787 comments 2 and 3. Instead, let lld-link's and clang's (including clang-cl's) "file not found" diagnostic check if a non-existent file looks like it could be a mis-spelled option, and if so add a "did you mean" suggestion to the "file not found" diagnostic. While here, make formatting of a few diagnostics a bit more self-consistent. Fixes PR41787. Differential Revision: https://reviews.llvm.org/D62276 llvm-svn: 361518
* [WebAssembly] Add multivalue and tail-call target featuresThomas Lively2019-05-231-0/+22
| | | | | | | | | | | | | | | | Summary: These features will both be implemented soon, so I thought I would save time by adding the boilerplate for both of them at the same time. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62047 llvm-svn: 361516
* [CodeComplete] Only show lambda completions if patterns are requestedIlya Biryukov2019-05-231-0/+9
| | | | | | This is a trivial follow-up to r361461, so sending without review. llvm-svn: 361510
* Ensure builtins use the target default Calling ConventionErich Keane2019-05-231-0/+11
| | | | | | | | | | | | | | | | | r355317 changed builtins/allocation functions to use the default calling convention in order to support platforms that use non-cdecl calling conventions by default. However the default calling convention is overridable on Windows 32 bit implementations with some of the /G options. The intent is to permit the user to set the calling convention of normal functions, however it should NOT apply to builtins and C++ allocation functions. This patch ensures that the builtin/allocation functions always use the Target specific Calling Convention, ignoring the user overridden version of said default. llvm-svn: 361507
* [analyzer][NFC] Prettify some RUN: lines in test files.Kristof Umann2019-05-235-12/+83
| | | | | | This is a test commit in disguise. llvm-svn: 361505
OpenPOWER on IntegriCloud