summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] CStringChecker: Fix overly eager assumption that memcmp args overlap.Artem Dergachev2019-12-112-0/+30
| | | | | | | | | | | | | | | | | While analyzing code `memcmp(a, NULL, n);', where `a' has an unconstrained symbolic value, the analyzer was emitting a warning about the *first* argument being a null pointer, even though we'd rather have it warn about the *second* argument. This happens because CStringChecker first checks whether the two argument buffers are in fact the same buffer, in order to take the fast path. This boils down to assuming `a == NULL' to true. Then the subsequent check for null pointer argument "discovers" that `a' is null. Don't take the fast path unless we are *sure* that the buffers are the same. Otherwise proceed as normal. Differential Revision: https://reviews.llvm.org/D71322
* [analyzer] CStringChecker: Improve warning messages.Artem Dergachev2019-12-116-46/+48
| | | | Differential Revision: https://reviews.llvm.org/D71321
* [OPENMP50]Fix capturing of if condition in target parallel for simdAlexey Bataev2019-12-111-4/+6
| | | | | | | | directive. Fixed capturing of the if condition if no modifer was specified in this condition. Previously could capture it only in outer region and it could lead to a compiler crash.
* [OPENMP50]Add if clause in teams distribute simd directive.Alexey Bataev2019-12-113-20/+176
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a ↵Adam Balogh2019-12-112-3/+2
| | | | | | | | | | | | | conjured value Sometimes the return value of a comparison operator call is `UnkownVal`. Since no assumptions can be made on `UnknownVal`, this leeds to keeping impossible execution paths in the exploded graph resulting in poor performance and false positives. To overcome this we replace unknown results of iterator comparisons by conjured symbols. Differential Revision: https://reviews.llvm.org/D70244
* [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions ↵Adam Balogh2019-12-111-0/+29
| | | | | | | | | | | | when printing the Program State Debugging the Iterator Modeling checker or any of the iterator checkers is difficult without being able to see the relations between the iterator variables and their abstract positions, as well as the abstract symbols denoting the begin and the end of the container. This patch adds the checker-specific part of the Program State printing to the Iterator Modeling checker.
* [SYCL] Add support for auxiliary triple specification to FrontendAlexey Bader2019-12-111-0/+5
| | | | | | | | | | | | | | | | | Summary: Add host predefined macros to compilation for SYCL device, which is required for pre-processing host specific includes (e.g. system headers). Reviewers: ABataev, jdoerfert Subscribers: ebevhan, Anastasia, cfe-commits, keryell, Naghasan, Fznamznon Tags: #clang Differential Revision: https://reviews.llvm.org/D71286 Signed-off-by: Alexey Bader <alexey.bader@intel.com>
* CodeGen: Allow annotations on globals in non-zero address spaceNicolai Hähnle2019-12-111-4/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: Attribute annotations are recorded in a special global composite variable that points to annotation strings and the annotated objects. As a restriction of the LLVM IR type system, those pointers are all pointers to address space 0, so let's insert an addrspacecast when the annotated global is in a non-0 address space. Since this addrspacecast is only reachable from the global annotations object, this should allow us to represent annotations on all globals regardless of which addrspacecasts are usually legal for the target. Reviewers: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71208
* [Clang] Pragma vectorize_width() implies vectorize(enable)Sjoerd Meijer2019-12-112-7/+59
| | | | | | | | | | | | | | | | | | | | | | Let's try this again; this has been reverted/recommited a few times. Last time this got reverted because for this loop: void a() { #pragma clang loop vectorize(disable) for (;;) ; } vectorisation was incorrectly enabled and the vectorize.enable metadata was set due to a logic error. But with this fixed, we now imply vectorisation when: 1) vectorisation is enabled, which means: VectorizeWidth > 1, 2) and don't want to add it when it is disabled or enabled, otherwise we would be incorrectly setting it or duplicating the metadata, respectively. This should fix PR27643. Differential Revision: https://reviews.llvm.org/D69628
* [ARM][MVE] Add intrinsics for immediate shifts. (reland)Simon Tatham2019-12-111-0/+722
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the family of `vshlq_n` and `vshrq_n` ACLE intrinsics, which shift every lane of a vector left or right by a compile-time immediate. They mostly work by expanding to the IR `shl`, `lshr` and `ashr` operations, with their second operand being a vector splat of the immediate. There's a fiddly special case, though. ACLE specifies that the immediate in `vshrq_n` can take values up to //and including// the bit size of the vector lane. But LLVM IR thinks that shifting right by the full size of the lane is UB, and feels free to replace the `lshr` with an `undef` half way through the optimization pipeline. Hence, to keep this legal in source code, I have to detect it at codegen time. Logical (unsigned) right shifts by the element size are handled by simply emitting the zero vector; arithmetic ones are converted into a shift of one bit less, which will always give the same output. In order to do that check, I also had to enhance the tablegen MveEmitter so that it can cope with converting a builtin function's operand into a bare integer to pass to a code-generating subfunction. Previously the only bare integers it knew how to handle were flags generated from within `arm_mve.td`. Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard Reviewed By: dmgreen, MarkMurrayARM Subscribers: echristo, hokein, rdhindsa, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71065
* [DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.Alexey Lapshin2019-12-111-1/+4
| | | | | | | | | The -fsplit-dwarf-inlining option does not conform to DWARF5 standard. It creates children for Skeleton compilation unit. We need default behavior to be DWARF5 compatible. Thus set default state for -fsplit-dwarf-inlining into "false". Differential Revision: https://reviews.llvm.org/D71304
* [c++20] Implement P1946R0: allow defaulted comparisons to take theirRichard Smith2019-12-102-4/+28
| | | | arguments by value.
* [c++20] Delete defaulted comparison functions if they would invoke anRichard Smith2019-12-103-0/+98
| | | | inaccessible comparison function.
* Fix mishandling of invalid-but-non-empty nested name specifiers in nameRichard Smith2019-12-101-0/+8
| | | | | | | | classification. We were accidentally treating invalid scope specs as being empty, resulting in our trying to form an ADL-only call with a qualified callee, which tripped up an assert later on.
* [c++20] Implement P1185R2 (as modified by P2002R0).Richard Smith2019-12-102-7/+191
| | | | | | For each defaulted operator<=> in a class that doesn't explicitly declare any operator==, also inject a matching implicit defaulted operator==.
* Revert "[analyzer] Keep track of escaped locals"Gabor Horvath2019-12-101-9/+0
| | | | | | | | | | | | | | | It was a step in the right direction but it is not clear how can this fit into the checker API at this point. The pre-escape happens in the analyzer core and the checker has no control over it. If the checker is not interestd in a pre-escape it would need to do additional work on each escape to check if the escaped symbol is originated from an "uninteresting" pre-escaped memory region. In order to keep the checker API simple we abandoned this solution for now. We will reland this once we have a better answer for what to do on the checker side. This reverts commit f3a28202ef58551db15818f8f51afd21e0f3e231.
* Debug Info: Strengthen the synthesized-property-cleanup.mm test, NFCVedant Kumar2019-12-101-3/+12
| | | | | | | | After https://reviews.llvm.org/D71084, the line locations assigned when emitting cleanups inside of property accessors changed. Update this test to actually check that those locations are correct. rdar://57796656
* [OPENMP50]Do not mark the function as used if referenced only in declareAlexey Bataev2019-12-101-0/+11
| | | | | | | | | variant directive. If the function is used only in declare variant directive as a variant function, it should not be marked as used to prevent emission of the target-specific functions. Build the reference in the unevaluated context.
* [c++20] Return type deduction for defaulted three-way comparisons.Richard Smith2019-12-101-0/+125
|
* [OPENMP50]Add if clause in target simd directive.Alexey Bataev2019-12-103-109/+203
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [Wdocumentation] Use C2x/C++14 deprecated attributeMark de Wever2019-12-103-14/+59
| | | | | | | | | This replaces the non-standard __attribute__((deprecated)) with the standard [[deprecated]] when compiling in C2x/C++14 mode. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71141
* [Wdocumentation] Properly place deprecated attributeMark de Wever2019-12-102-15/+96
| | | | | | | | | | It is now placed before the function: - allows to replace __attribute__((deprecated)) with [[deprecated]]. - required for trailing returns. Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71140
* [Wdocumentation] Use the command marker.Mark de Wever2019-12-101-2/+2
| | | | | | | | | Use the proper marker for -Wdocumentation-deprecated-sync instead of hard-coded the backslash. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71139
* Recommit "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."Sourabh Singh Tomar2019-12-112-8/+32
| | | | | | | | Reviewers: dblaikie, aprantl, probinson Tags: #debug-info #llvm Differential Revision: https://reviews.llvm.org/D71185
* Revert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."Sourabh Singh Tomar2019-12-112-32/+8
| | | | | This reverts commit 6ef01588f4d75ef43da4ed2a37ba7a8b8daab259. Missing Differetial revision.
* [DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.Sourabh Singh Tomar2019-12-112-8/+32
|
* Fix bug 44190 - wrong code with #pragma pack(1)Yaxun (Sam) Liu2019-12-101-0/+23
| | | | | | | | | | | https://github.com/llvm/llvm-project/commit/5b330e8d6122c336d81dfd11c864e6c6240a381e caused a regression on s390: https://bugs.llvm.org/show_bug.cgi?id=44190 we need to copy if if either the argument is non-byval or the argument is underaligned. Differential Revision: https://reviews.llvm.org/D71282
* [FPEnv] clang support for constrained FP builtinsKevin P. Neal2019-12-101-0/+150
| | | | | | | | Change the IRBuilder and clang so that constrained FP intrinsics will be emitted for builtins when appropriate. Only non-target-specific builtins are affected in this patch. Differential Revision: https://reviews.llvm.org/D70256
* [OPENMP]Remove extra space from error message.Alexey Bataev2019-12-105-16/+16
| | | | Fixed emission of 2 consecutive whitespaces in the error message.
* [OPENMP50]Add if clause in target parallel for simd directive.Alexey Bataev2019-12-103-46/+151
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause is false, the non-vectorized version of the loop must be executed.
* [analyzer] Keep track of escaped localsGabor Horvath2019-12-101-0/+9
| | | | | | | | We want to escape all symbols that are stored into escaped regions. The problem is, we did not know which local regions were escaped. Until now. This should fix some false positives like the one in the tests. Differential Revision: https://reviews.llvm.org/D71152
* [ARM][MVE] Refactor complex vector intrinsics [NFCI]Mikhail Maltsev2019-12-102-66/+66
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch refactors instruction selection of the complex vector addition, multiplication and multiply-add intrinsics, so that it is now based on TableGen patterns rather than C++ code. It also changes the first parameter (halving vs non-halving) of the arm_mve_vcaddq IR intrinsic to match the corresponding instruction encoding, hence it requires some changes in the tests. The patch addresses David's comment in https://reviews.llvm.org/D71190 Reviewers: dmgreen, ostannard, simon_tatham, MarkMurrayARM Reviewed By: dmgreen Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71245
* [DebugInfo] Support to emit debugInfo for extern variablesYonghong Song2019-12-104-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extern variable usage in BPF is different from traditional pure user space application. Recent discussion in linux bpf mailing list has two use cases where debug info types are required to use extern variables: - extern types are required to have a suitable interface in libbpf (bpf loader) to provide kernel config parameters to bpf programs. https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t - extern types are required so kernel bpf verifier can verify program which uses external functions more precisely. This will make later link with actual external function no need to reverify. https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed This patch added clang support to emit debuginfo for extern variables with a TargetInfo hook to enable it. The debuginfo for the extern variable is emitted only if that extern variable is referenced in the current compilation unit. Currently, only BPF target enables to generate debug info for extern variables. The emission of such debuginfo is disabled for C++ at this moment since BPF only supports a subset of C language. Emission with C++ can be enabled later if an appropriate use case is identified. -fstandalone-debug permits us to see more debuginfo with the cost of bloated binary size. This patch did not add emission of extern variable debug info with -fstandalone-debug. This can be re-evaluated if there is a real need. Differential Revision: https://reviews.llvm.org/D70696
* Remove implicit conversion that promotes half to other larger precision ↵Jim Lin2019-12-101-1/+25
| | | | | | | | | | | | | | | | | | | | types for fp classification builtins Summary: It shouldn't promote half to double or any larger precision types for fp classification builtins. Because fp classification builtins would get incorrect result with promoted argument. For example, __builtin_isnormal with a subnormal half value should return false, but it is not. That the subnormal half value is promoted to a normal double value. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71049
* [Remarks][Driver] Error on -foptimization-record-file with multiple -arch ↵Francis Visoiu Mistrih2019-12-091-0/+3
| | | | | | | | | options This adds a check for the usage of -foptimization-record-file with multiple -arch options. This is not permitted since it would require us to rename the file requested by the user to avoid overwriting it for the second cc1 invocation.
* [c++20] Fix handling of unqualified lookups from a defaulted comparisonRichard Smith2019-12-092-0/+126
| | | | | | | | | | function. We need to perform unqualified lookups from the context of a defaulted comparison, but not until we implicitly define the function, at which point we can't do those lookups any more. So perform the lookup from the end of the class containing the =default declaration and store the lookup results on the defaulted function until we synthesize the body.
* Revert "[ARM][MVE] Add intrinsics for immediate shifts."Eric Christopher2019-12-091-722/+0
| | | | | | | | | | | | | | and two follow-on commits: one warning fix and one functionality. As it's breaking at least the lto bot: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15132/steps/test-stage1-compiler/logs/stdio This reverts commits: 8d70f3c933a5b81a87a5ab1af0e3e98ee2cd7c67 ff4dceef9201c5ae3924e92f6955977f243ac71d d97b3e3e65cd77a81b39732af84a1a4229e95091
* [c++20] Defaulted comparison support for array members.Richard Smith2019-12-095-37/+92
|
* Also synthesize _cmd and self for propertiesPierre Habouzit2019-12-091-0/+11
| | | | | | Patch by: Pierre Habouzit Differential Revision: https://reviews.llvm.org/D71226
* [c++20] Fix incorrect assumptions in checks for comparison category types.Richard Smith2019-12-092-0/+57
| | | | | | In the presence of modules, we can have multiple lookup results for the same entity, and we need to re-check for completeness each time we consider a type.
* [clang][IFS] Allow 2 output files when using -o and -c with clang IFS stubs.Puyan Lotfi2019-12-091-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This patch allows for -o to be used with -c when compiling with clang interface stubs enabled. This is because the second file will be an intermediate ifs stubs file that is the text stub analog of the .o file. Both get produces in this case, so two files. Why are we doing this? Because we want to support the case where interface stubs are used bu first invoking clang like so: clang -c <other flags> -emit-interface-stubs foo.c -o foo.o ... clang -emit-interface-stubs <.o files> -o libfoo.so This should generate N .ifs files, and one .ifso file. Prior to this patch, using -o with the -c invocation was not possible. Currently the clang driver supports generating a a.out/.so file at the same time as a merged ifs file / ifso file, but this is done by checking that the final job is the IfsMerge job. When -c is used, the final job is a Compile job so what this patch does is check to figure out of the job type is TY_IFS_CPP. Differential Revision: https://reviews.llvm.org/D70763
* Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install ↵Peter Collingbourne2019-12-092-5/+15
| | | | | | | | | | | | | | | | | | | | | | directory on Android.", which was reverted in b3249027. Fixed the test case to set --sysroot, which lets it succeed in the case where a directory named "/usr/include/c++/v1" or "/usr/local/include/c++/v1" exists. Original commit message: > The NDK uses a separate set of libc++ headers in the sysroot. Any headers > in the installation directory are not going to work on Android, not least > because they use a different name for the inline namespace (std::__1 instead > of std::__ndk1). > > This effectively makes it impossible to produce a single toolchain that is > capable of targeting both Android and another platform that expects libc++ > headers to be installed in the installation directory, such as Mac. > > In order to allow this scenario to work, stop looking for headers in the > install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* [ARM][MVE][Intrinsics] Add VQADDQ, VHADDQ, VRHADDQ, VQSUBQ, VHSUBQ, ↵Mark Murray2019-12-097-0/+665
| | | | | | | | | | | | | | VQDMULHQ, VQRDMULHQ intrinsics. Summary: Add VQADDQ, VHADDQ, VRHADDQ, VQSUBQ, VHSUBQ, VQDMULHQ, VQRDMULHQ intrinsics and unit tests. Reviewers: simon_tatham, ostannard, dmgreen, miyuki Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71198
* [ARM][MVE][Intrinsics] Add VMULL[BT]Q_(INT|POLY) intrinsics.Mark Murray2019-12-092-0/+250
| | | | | | | | | | | | Summary: Add VMULL[BT]Q_(INT|POLY) intrinsics and unit tests. Reviewers: simon_tatham, ostannard, dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71066
* [ARM][MVE] Add intrinsics for immediate shifts.Simon Tatham2019-12-091-0/+722
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds the family of `vshlq_n` and `vshrq_n` ACLE intrinsics, which shift every lane of a vector left or right by a compile-time immediate. They mostly work by expanding to the IR `shl`, `lshr` and `ashr` operations, with their second operand being a vector splat of the immediate. There's a fiddly special case, though. ACLE specifies that the immediate in `vshrq_n` can take values up to //and including// the bit size of the vector lane. But LLVM IR thinks that shifting right by the full size of the lane is UB, and feels free to replace the `lshr` with an `undef` half way through the optimization pipeline. Hence, to keep this legal in source code, I have to detect it at codegen time. Logical (unsigned) right shifts by the element size are handled by simply emitting the zero vector; arithmetic ones are converted into a shift of one bit less, which will always give the same output. In order to do that check, I also had to enhance the tablegen MveEmitter so that it can cope with converting a builtin function's operand into a bare integer to pass to a code-generating subfunction. Previously the only bare integers it knew how to handle were flags generated from within `arm_mve.td`. Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard Reviewed By: MarkMurrayARM Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71065
* Fix build bot fails due to the patch here:Zahira Ammarguellat2019-12-091-0/+1
| | | | | https://reviews.llvm.org/D70691 Fixed the LIT test case. Added the REQUIRES instruction.
* [ARM][MVE] Add complex vector intrinsicsMikhail Maltsev2019-12-094-0/+1642
| | | | | | | | | | | | | | | | | | | | Summary: This patch adds intrinsics for the following MVE instructions: * VCADD, VHCADD * VCMUL * VCMLA Each of the above 3 groups has a corresponding new LLVM IR intrinsic. Reviewers: simon_tatham, MarkMurrayARM, ostannard, dmgreen Reviewed By: MarkMurrayARM Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71190
* [OpenCL] Handle address space conversions for constexpr (PR44177)Sven van Haastregt2019-12-092-5/+28
| | | | | | | | | | | | The AST for the constexpr.cl test contains address space conversion nodes to cast through the implicit generic address space. These caused the evaluator to reject the input as constexpr in C++ for OpenCL mode, whereas the input was considered constexpr in plain C++ mode as the AST won't have address space cast nodes then. Fixes PR44177. Differential Revision: https://reviews.llvm.org/D71015
* [c++20] Synthesis of defaulted comparison functions.Richard Smith2019-12-087-20/+222
| | | | | | Array members are not yet handled. In addition, defaulted comparisons can't yet find comparison operators by unqualified lookup (only by member lookup and ADL). These issues will be fixed in follow-on changes.
* Fix for build bot failure. For more details see:Zahira Ammarguellat2019-12-091-5/+5
| | | | | https://reviews.llvm.org/D70691 Upated LIT test.
OpenPOWER on IntegriCloud