summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [PowerPC]: Add powerpcspe target triple subarch componentJustin Hibbits2020-01-083-4/+5
| | | | | | | | | | Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014
* [NFC] Whitespace fixesGabor Horvath2020-01-082-3/+3
|
* LTOVisibility.rst: fix up syntax in exampleTeresa Johnson2020-01-081-1/+1
| | | | | | | | | | | | | | | | Summary: Pretty self-evident. This example was missing an lparen. Added it, and fixed up the ASCII art. Patch by Nick Black <dankamongmen@gmail.com> Reviewers: pcc Reviewed By: pcc Subscribers: tejohnson, mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, cfe-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D70765
* Add a new AST matcher 'optionally'.Rihan Yang2020-01-086-12/+121
| | | | | | | | This matcher matches any node and at the same time executes all its inner matchers to produce any possbile result bindings. This is useful when a user wants certain supplementary information that's not always present along with the main match result.
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-081-2/+2
| | | | Use castAs<> instead of getAs<> since we know that the pointer will be valid (and is dereferenced immediately below).
* [OPENMP]Allow comma in combiner expression.Alexey Bataev2020-01-082-5/+14
| | | | | Use ParseExpression() instead of ParseAssignmentExpression() to allow commas in combiner expressions.
* [ARM,MVE] Intrinsics for variable shift instructions.Simon Tatham2020-01-083-2/+1676
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This batch of intrinsics fills in all the shift instructions that take a variable shift distance in a register, instead of an immediate. Some of these instructions take a single shift distance in a scalar register and apply it to all lanes; others take a vector of per-lane distances. These instructions are all basically one family, varying in whether they saturate out-of-range values, and whether they round when bits are shifted off the bottom. I've implemented them at the IR level by a much smaller family of IR intrinsics, which take flag parameters to indicate saturating and/or rounding (along with the usual one to specify signed/unsigned integers). An oddity is that all of them are //left// shift instructions – but if you pass a negative shift count, they'll shift right. So the vector shift distances are always vectors of //signed// integers, regardless of whether you're considering the other input vector to be of signed or unsigned. Also, even the simplest `vshlq` instruction in this family (neither saturating nor rounding) has to be implemented as an IR intrinsic, because the ordinary LLVM IR `shl` operation would consider an out-of-range shift count to be undefined behavior. Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72329
* [ARM,MVE] Intrinsics for partial-overwrite imm shifts.Simon Tatham2020-01-084-9/+1628
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This batch of intrinsics covers two sets of immediate shift instructions, which have in common that they only overwrite part of their output register and so they need an extra input giving its previous value. The VSLI and VSRI instructions shift each lane of the input vector left or right just as if they were normal immediate VSHL/VSHR, but then they only overwrite the output bits that correspond to actual shifted bits of the input. So VSLI will leave the low n bits of each output lane unchanged, and VSRI the same with the top n bits. The V[Q][R]SHR[U]N family are all narrowing shifts: they take an input vector of 2n-bit integers, shift each lane right by a constant, and then narrowing the shifted result to only n bits. So they only overwrite half of the n-bit lanes in the output register, and the B/T suffix indicates whether it's the bottom or top half of each 2n-bit lane. I've implemented the whole of the latter family using a single IR intrinsic `vshrn`, which takes a lot of i32 parameters indicating which instruction it expands to (by specifying signedness of the input and output types, whether it saturates and/or rounds, etc). Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72328
* Fixing a formatting nit; NFCAaron Ballman2020-01-081-1/+2
|
* Disallow an empty string literal in an asm labelAaron Ballman2020-01-0810-31/+30
| | | | | | | | An empty string literal in an asm label does not make a whole lot of sense. GCC does not diagnose such a construct, but it also generates code that cannot be assembled by gas should two symbols have an empty asm label within the same TU. This does not affect an asm statement with an empty string literal, which is still a useful construct.
* AArch64: add missing Apple CPU names and use them by default.Tim Northover2020-01-084-11/+25
| | | | | | | | Apple's CPUs are called A7-A13 in official communication, occasionally with weird suffixes which we probably don't need to care about. This adds each one and describes its features. It also switches the default CPU to the canonical name for Cyclone, but leaves legacy support in so that existing bitcode still compiles.
* [PowerPC] Default ppc64 linux-gnu/freebsd to -fno-PICFangrui Song2020-01-072-7/+6
| | | | | | | | | | | | | | | | | According to D53384, the default was switched from -fno-PIC to -fPIC to work around a -fsanitize=leak bug on big-endian. This gratuitous difference between little-endian and big-endian is undesired, and not acceptable on powerpc64-unknown-freebsd. If -fsanitize=leak still has the problem, we should consider defaulting to -fPIC/-fPIE only when -fsanitize=leak is specified (see SanitizerArgs::requiresPIE()) powerpc64-ibm-aix is unaffected: it still defaults to -fPIC. powerpc64-linux-musl is unaffected (-fPIE since D39588): it still defaults to -fPIE. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72363
* [clang-tidy] modernize-use-using uses AST and now supports struct defintions ↵Mitchell Balan2020-01-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and multiple types in a typedef Summary: It now handles `typedef`s that include comma-separated multiple types, and handles embedded struct definitions, which previously could not be automatically converted. For example, with this patch `modernize-use-using` now can convert: typedef struct { int a; } R_t, *R_p; to: using R_t = struct { int a; }; using R_p = R_t*; `-ast-dump` showed that the `CXXRecordDecl` definitions and multiple `TypedefDecl`s come consecutively in the tree, so `check()` stores information between calls to determine when it is receiving a second or additional `TypedefDecl` within a single `typedef`, or when the current `TypedefDecl` refers to an embedded `CXXRecordDecl` like a `struct`. Reviewers: alexfh, aaron.ballman Patch by: poelmanc Subscribers: riccibruno, sammccall, cfe-commits, aaron.ballman Tags: clang-tools-extra, clang Differential Revision: https://reviews.llvm.org/D70270
* [PowerPC][Triple] Use elfv2 on freebsd>=13 and linux-muslFangrui Song2020-01-074-3/+20
| | | | | | | | | | | | | | | | | | | Summary: Every powerpc64le platform uses elfv2. For powerpc64, the environments "elfv1" and "elfv2" were added for FreeBSD ELFv1->ELFv2 migration in D61950. FreeBSD developers have decided to use OS versions to select ABI, and no one is relying on the environments. Also use elfv2 on powerpc64-linux-musl. Users can always use -mabi=elfv1 and -mabi=elfv2 to override the default ABI. Reviewed By: adalava Differential Revision: https://reviews.llvm.org/D72352
* [test] Move ppc64 tests from test/Preprocessor/init.c to init-ppc64.cFangrui Song2020-01-072-1072/+1068
|
* [OPENMP]Reduce calls for the mangled names.Alexey Bataev2020-01-072-8/+9
| | | | | | Use canonical decls instead of mangled names in the set of already emitted decls. This allows to reduce the number of function calls for getting declarations mangled names and speedup the compilation.
* [OPENMP]Allow using of members in standalone declaration pragmas.Alexey Bataev2020-01-077-9/+127
| | | | | | | | | If standalone OpenMP declaration pragma, like declare mapper or declare reduction, is declared in the class context, it may reference a member (data or function) in its internal expressions/statements. So, the parsing of such pragmas must be dalayed just like the parsing of the member initializers/definitions before the completion of the class declaration.
* [analyzer] Update help text to reflect sarif supportGabor Horvath2020-01-071-1/+1
| | | | Differential Revision: https://reviews.llvm.org/D72289
* [LifetimeAnalysis] Do not forbid void deref type in gsl::Pointer/gsl::Owner ↵Gabor Horvath2020-01-074-10/+10
| | | | | | | | | | | annotations It turns out it is useful to be able to define the deref type as void. In case we have a type erased owner, we want to express that the pointee can be basically any type. It should not be unnatural to have a void deref type as we already familiar with "pointers to void". Differential Revision: https://reviews.llvm.org/D72097
* [HIP] Add option --gpu-max-threads-per-block=nYaxun (Sam) Liu2020-01-077-8/+49
| | | | | | Add this option to change the default launch bounds. Differential Revision: https://reviews.llvm.org/D71221
* [OPENMP]Do not diagnose references to non-integral types for ref inAlexey Bataev2020-01-072-3/+4
| | | | | | declare simd. According to the standard, a list-item that appears in a linear clause without the ref modifier must be of integral or pointer type, or must be a reference to an integral or pointer type. Added check that this restriction is applied only to non-ref items.
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-071-3/+3
|
* [NFC] Use isX86() instead of getArch()Jim Lin2020-01-078-32/+13
| | | | | | | | | | | | | | Summary: This is a clean up for https://reviews.llvm.org/D72247. Reviewers: MaskRay, craig.topper, jhenderson Reviewed By: MaskRay Subscribers: hiraditya, rupprecht, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72320
* Always deduce the lengths of contained parameter packs when deducing aRichard Smith2020-01-068-34/+78
| | | | | | | | | | | | | | | | | pack expansion. Previously, if all parameter / argument pairs for a pack expansion deduction were non-deduced contexts, we would not deduce the arity of the pack, and could end up deducing a different arity (leading to failures during substitution) or defaulting to an arity of 0 (leading to bad diagnostics about passing the wrong number of arguments to a variadic function). Instead, we now always deduce the arity for all involved packs any time we deduce a pack expansion. This will result in less substitution happening in some cases, which could avoid non-SFINAEable errors, and should generally improve the quality of diagnostics when passing initializer lists to variadic functions.
* [CodeGen][ObjC] Push the properties of a protocol before pushing theAkira Hatanaka2020-01-062-3/+21
| | | | | | | | | | properties of the protocol it inherits This fixes a bug where the type string for a @dynamic property of an @implementation didn't have 'D' in it when the protocol it conforms to redeclares the property declared in the base protocol. rdar://problem/45503561
* Add Triple::isX86()Fangrui Song2020-01-066-15/+8
| | | | | | Reviewed By: craig.topper, skan Differential Revision: https://reviews.llvm.org/D72247
* Use FileCheck instead of grepAkira Hatanaka2020-01-061-6/+7
|
* [Diagnostic] make Wmisleading-indendation not warn about labelsTyker2020-01-062-4/+13
| | | | | | | | | | Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman Subscribers: nickdesaulniers, nathanchance Differential Revision: https://reviews.llvm.org/D72202
* [OPENMP50]Support lastprivate conditional updates in inc/dec unary ops.Alexey Bataev2020-01-067-33/+118
| | | | | Added support for checking of updates of variables used in unary pre(pos) inc/dec expressions.
* [NFC] Test commit, revert whitespace changestevewan2020-01-061-1/+0
| | | | As per the Developer Policy, upon obtaining commit access.
* [NFC] Test commit, whitespace changestevewan2020-01-061-0/+1
| | | | As per the Developer Policy, upon obtaining commit access.
* Adds -Wrange-loop-analysis to -WallMark de Wever2020-01-063-2/+5
| | | | | | | | | | This makes the range loop warnings part of -Wall. Fixes PR32823: Warn about accidental coping of data in range based for Differential Revision: https://reviews.llvm.org/D68912 Recomitted after fixing the warnings it created.
* [ARM,MVE] Fix many signedness errors in MVE intrinsics.Simon Tatham2020-01-0615-141/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Running an end-to-end test last week I noticed that a lot of the ACLE intrinsics that operate differently on vectors of signed and unsigned integers were ending up generating the signed version of the instruction unconditionally. This is because the IR intrinsics had no way to distinguish signed from unsigned: the LLVM type system just calls them both `v8i16` (or whatever), so you need either separate intrinsics for signed and unsigned, or a flag parameter that tells ISel which one to choose. This patch fixes all the problems of that kind that I've noticed, by adding an i32 flag parameter to many of the IR intrinsics which is set to 1 for unsigned (matching the existing practice in cases where we got it right), and conditioning all the isel patterns on that flag. So the fundamental change is in `IntrinsicsARM.td`, changing the low-level IR intrinsics API; there are knock-on changes in `arm_mve.td` (adjusting code gen for the ACLE intrinsics to use the modified API) and in `ARMInstrMVE.td` (adjusting isel to expect the new unsigned flags). The rest of this patch is boringly updating tests. Reviewers: dmgreen, miyuki, MarkMurrayARM Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72270
* [ARM,MVE] Support -ve offsets in gather-load intrinsics.Simon Tatham2020-01-064-42/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ACLE intrinsics with `gather_base` or `scatter_base` in the name are wrappers on the MVE load/store instructions that take a vector of base addresses and an immediate offset. The immediate offset can be up to 127 times the alignment unit, and it can be positive or negative. At the MC layer, we got that right. But in the Sema error checking for the wrapping intrinsics, the offset was erroneously constrained to be positive. To fix this I've adjusted the `imm_mem7bit` class in the Tablegen that defines the intrinsics. But that causes integer literals like `0xfffffffffffffe04` to appear in the autogenerated calls to `SemaBuiltinConstantArgRange`, which provokes a compiler warning because that's out of the non-overflowing range of an `int64_t`. So I've also tweaked `MveEmitter` to emit that as `-0x1fc` instead. Updated the tests of the Sema checks themselves, and also adjusted a random sample of the CodeGen tests to actually use negative offsets and prove they get all the way through code generation without causing a crash. Reviewers: dmgreen, miyuki, MarkMurrayARM Reviewed By: dmgreen Subscribers: kristof.beyls, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72268
* [clang-format] fix conflict between FormatStyle::BWACS_MultiLine and ↵Mitchell Balan2020-01-062-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BeforeCatch/BeforeElse Summary: Found a bug introduced with BraceWrappingFlags AfterControlStatement MultiLine. This feature conflicts with the existing BeforeCatch and BeforeElse flags. For example, our team uses BeforeElse. if (foo || bar) { doSomething(); } else { doSomethingElse(); } If we enable MultiLine (which we'd really love to do) we expect it to work like this: if (foo || bar) { doSomething(); } else { doSomethingElse(); } What we actually get is: if (foo || bar) { doSomething(); } else { doSomethingElse(); } Reviewers: MyDeveloperDay, Bouska, mitchell-stellar Patch by: pastey Subscribers: Bouska, cfe-commits Tags: clang Differential Revision: https://reviews.llvm.org/D71939
* [APFloat] Fix compilation warningsEhud Katz2020-01-061-2/+5
|
* [APFloat] Add recoverable string parsing errors to APFloatEhud Katz2020-01-061-1/+4
| | | | | | Implementing the APFloat part in PR4745. Differential Revision: https://reviews.llvm.org/D69770
* [Clang] Force rtlib=platform in test to avoid fails with CLANG_DEFAULT_RTLIBKristina Brooks2020-01-061-0/+3
| | | | | | | | | | | | | | | | | | Driver test `cross-linux.c` fails when CLANG_DEFAULT_RTLIB is "compiler-rt" as the it expects a GCC-style `"crtbegin.o"` after `"crti.o"` but instead receives something akin to this in the frontend invocation: ``` "crt1.o" "crti.o" "/o/b/llvm/bin/../lib/clang/10.0.0/lib/linux/clang_rt.crtbegin-x86_64.o" ``` This patch adds an override to `cross-linux.c` tests so the expected result is produced regardless of the compile-time default rtlib, as having tests fail due to that is fairly confusing. After applying the patch, the test passes regardless of the CLANG_DEFAULT_RTLIB setting. Differential Revision: https://reviews.llvm.org/D72236
* Clang-format previous commitStephen Kelly2020-01-051-3/+1
|
* Add missing testStephen Kelly2020-01-051-0/+12
|
* [Gnu toolchain] Look at standard GCC paths for libstdcxx by defaultKristina Brooks2020-01-056-86/+121
| | | | | | | | | | | Linux' current addLibCxxIncludePaths and addLibStdCxxIncludePaths are actually almost non-Linux-specific at all, and can be reused almost as such for all gcc toolchains. Only keep Android/Freescale/Cray hacks in Linux's version. Patch by sthibaul (Samuel Thibault) Differential Revision: https://reviews.llvm.org/D69758
* Allow using traverse() with bindingsStephen Kelly2020-01-053-0/+38
|
* Fix oversight in AST traversal helperStephen Kelly2020-01-051-1/+1
|
* [ParserTest] Move raw string literal out of macroDavid Green2020-01-051-3/+3
| | | | | Some combinations of gcc and ccache do not deal well with raw strings in macros. Moving the string out to attempt to fix the bots.
* [Diagnostic] Add test for previous b4b904e19bb356724b2c6aea0199ce05c6f15cdbTyker2020-01-041-0/+3
|
* [fuchsia] Enable Clang Static AnalyzerGabor Horvath2020-01-032-2/+2
| | | | Differential Revision: https://reviews.llvm.org/D72188
* [SystemZ] Don't allow CL option -mpacked-stack with -mbackchain.Jonas Paulsson2020-01-033-3/+17
| | | | | | | -mpacked-stack is currently not supported with -mbackchain, so this should result in a compilation error message instead of being silently ignored. Review: Ulrich Weigand
* Remove outdated svn/git information from hacking pageAlexander Lanin2020-01-031-24/+2
| | | | | | | | | The patch files section is redundant to https://llvm.org/docs/GettingStarted.html. There is nothing clang specific here. We are talking about a monorepo after all. While it may seem nice to have one single clang page which explains everything, it's not: It doesn't cover the topics in sufficient depth, it's redundant to other pages and it's hard to keep it up to date as we see with the svn instructions.
* [OPENMP]Fix crash on error message for declare reduction.Alexey Bataev2020-01-032-3/+4
| | | | | If the qualified reduction name is specified and not found, the compiler may crash because of not specified parameter.
* [clang-format/java] format multiple qualified annotations on one declaration ↵Nico Weber2020-01-032-1/+9
| | | | | | | | | | | | | | | | | | | | | better Before: class Foo { @CommandLineFlags .Add @Features.foo public void test() {} } Now: class Foo { @Features.foo @CommandLineFlags.Add public void test() { } } See also https://crbug.com/1034115
OpenPOWER on IntegriCloud