summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP]Remove unused code, NFC.Alexey Bataev2020-01-092-102/+2
|
* [ARM][MVE] MVE-I should not be disabled by -mfpu=noneMomchil Velikov2020-01-091-20/+23
| | | | | | | | | | | | | | | Architecturally, it's allowed to have MVE-I without an FPU, thus -mfpu=none should not disable MVE-I, or moves to/from FP-registers. This patch removes `+/-fpregs` from features unconditionally added to target feature list, depending on FPU and moves the logic to Clang driver, where the negative form (`-fpregs`) is conditionally added to the target features list for the cases of `-mfloat-abi=soft`, or `-mfpu=none` without either `+mve` or `+mve.fp`. Only the negative form is added by the driver, the positive one is derived from other features in the backend. Differential Revision: https://reviews.llvm.org/D71843
* [Concepts] Function trailing requires clausesSaar Raz2020-01-0928-355/+1165
| | | | | | Function trailing requires clauses now parsed, supported in overload resolution and when calling, referencing and taking the address of functions or function templates. Differential Revision: https://reviews.llvm.org/D43357
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-091-4/+3
| | | | Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately below).
* Fix "pointer is null" static analyzer warnings. NFCI.Simon Pilgrim2020-01-091-2/+2
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
* Fix "pointer is null" static analyzer warnings. NFCI.Simon Pilgrim2020-01-091-0/+2
| | | | Assert that the pointers are non-null before dereferencing them.
* Fix MSVC unhandled enum warning. NFCI.Simon Pilgrim2020-01-091-0/+1
|
* [APFloat] Fix checked error assert failuresEhud Katz2020-01-091-5/+3
| | | | | | | | | | | `APFLoat::convertFromString` returns `Expected` result, which must be "checked" if the LLVM_ENABLE_ABI_BREAKING_CHECKS preprocessor flag is set. To mark an `Expected` result as "checked" we must consume the `Error` within. In many cases, we are only interested in knowing if an error occured, without the need to examine the error info. This is achieved, easily, with the `errorToBool()` API.
* [PowerPC]: Add powerpcspe target triple subarch componentJustin Hibbits2020-01-082-3/+3
| | | | | | | | | | 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
* Add a new AST matcher 'optionally'.Rihan Yang2020-01-082-0/+28
| | | | | | | | 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-081-3/+2
| | | | | Use ParseExpression() instead of ParseAssignmentExpression() to allow commas in combiner expressions.
* Fixing a formatting nit; NFCAaron Ballman2020-01-081-1/+2
|
* Disallow an empty string literal in an asm labelAaron Ballman2020-01-085-10/+18
| | | | | | | | 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-081-4/+5
| | | | | | | | 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-071-3/+0
| | | | | | | | | | | | | | | | | 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
* [PowerPC][Triple] Use elfv2 on freebsd>=13 and linux-muslFangrui Song2020-01-072-3/+8
| | | | | | | | | | | | | | | | | | | 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
* [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-073-6/+85
| | | | | | | | | 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.
* [LifetimeAnalysis] Do not forbid void deref type in gsl::Pointer/gsl::Owner ↵Gabor Horvath2020-01-071-5/+3
| | | | | | | | | | | 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-073-2/+19
| | | | | | 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-071-2/+2
| | | | | | 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-077-26/+11
| | | | | | | | | | | | | | 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-062-21/+34
| | | | | | | | | | | | | | | | | 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-061-3/+3
| | | | | | | | | | 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
* [Diagnostic] make Wmisleading-indendation not warn about labelsTyker2020-01-061-4/+6
| | | | | | | | | | 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-065-13/+58
| | | | | 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.
* [clang-format] fix conflict between FormatStyle::BWACS_MultiLine and ↵Mitchell Balan2020-01-061-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [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-051-0/+5
|
* Fix oversight in AST traversal helperStephen Kelly2020-01-051-1/+1
|
* [SystemZ] Don't allow CL option -mpacked-stack with -mbackchain.Jonas Paulsson2020-01-031-3/+13
| | | | | | | -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
* [OPENMP]Fix crash on error message for declare reduction.Alexey Bataev2020-01-031-1/+2
| | | | | 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-031-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* [OpenMP] diagnose zero-length array section in the depend clauseKelvin Li2020-01-031-0/+16
| | | | | | | The OpenMP specification disallows having zero-length array sections in the depend clause (OpenMP 5.0 2.17.11). Differential Revision: https://reviews.llvm.org/D71969
* [Diagnostic] Fixed add ftabstop to -Wmisleading-indentationTyker2020-01-031-3/+39
| | | | | | | | | | | | | | | | | Summary: this allow much better support of codebases like the linux kernel that mix tabs and spaces. -ftabstop=//Width// allow specifying how large tabs are considered to be. Reviewers: xbolva00, aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: mstorsjo, cfe-commits, jyknight, riccibruno, rsmith, nathanchance Tags: #clang Differential Revision: https://reviews.llvm.org/D71037
* [Syntax] Build spanning SimpleDecalration for classes, structs, etcIlya Biryukov2020-01-031-3/+7
| | | | | | | When they are free-standing, e.g. `struct X;` or `struct X {};`. Although this complicates the common case (of free-standing class declarations), this ensures the less common case (e.g. `struct X {} a;`) are handled uniformly and produce similar syntax trees.
* [OPENMP50]Codegen for lastprivate conditional list items.Alexey Bataev2020-01-026-3/+357
| | | | | | | | | | | | | | | | | | | | | | | | | Added codegen support for lastprivate conditional. According to the standard, if when the conditional modifier appears on the clause, if an assignment to a list item is encountered in the construct then the original list item is assigned the value that is assigned to the new list item in the sequentially last iteration or lexically last section in which such an assignment is encountered. We look for the assignment operations and check if the left side references lastprivate conditional variable. Then the next code is emitted: if (last_iv_a <= iv) { last_iv_a = iv; last_a = lp_a; } At the end the implicit barrier is generated to wait for the end of all threads and then in the check for the last iteration the private copy is assigned the last value. if (last_iter) { lp_a = last_a; // <--- new code a = lp_a; // <--- store of private value to the original variable. }
* [OPENMP] Restore allowing of braced initializers in the declare reductionAlexey Bataev2020-01-021-1/+1
| | | | | | init. Braced initializers were not accepted after the last fix in the initialier.Restored previous functionality.
* Handle init statements in readability-else-after-returnNathan James2020-01-021-0/+1
| | | | | | | | | | Adds a new ASTMatcher condition called 'hasInitStatement()' that matches if, switch and range-for statements with an initializer. Reworked clang-tidy readability-else-after-return to handle variables in the if condition or init statements in c++17 ifs. Also checks if removing the else would affect object lifetimes in the else branch. Fixes PR44364.
* [SystemZ] Use FNeg in s390x clang builtinsKevin P. Neal2020-01-021-9/+5
| | | | The s390x builtins are still using FSub instead of FNeg. Correct that.
* Generalize the pass registration mechanism used by Polly to any third-party toolserge_sans_paille2020-01-022-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | There's quite a lot of references to Polly in the LLVM CMake codebase. However the registration pattern used by Polly could be useful to other external projects: thanks to that mechanism it would be possible to develop LLVM extension without touching the LLVM code base. This patch has two effects: 1. Remove all code specific to Polly in the llvm/clang codebase, replaicing it with a generic mechanism 2. Provide a generic mechanism to register compiler extensions. A compiler extension is similar to a pass plugin, with the notable difference that the compiler extension can be configured to be built dynamically (like plugins) or statically (like regular passes). As a result, people willing to add extra passes to clang/opt can do it using a separate code repo, but still have their pass be linked in clang/opt as built-in passes. Differential Revision: https://reviews.llvm.org/D61446
* [OpenMP] Fix formatting of OpenMP error message, by Wang Tianqing.Alexey Bataev2020-01-021-3/+2
| | | | | | | | | | | | | | Summary: `getListOfPossibleValues()` formatted incorrectly when there is only one value, emitting something like `expected 'conditional' or in OpenMP clause 'lastprivate'`. Reviewers: jdoerfert, ABataev Reviewed By: jdoerfert Subscribers: guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71884
* Improve Wrange-loop-analyses for rvalue referenceMark de Wever2020-01-011-1/+3
| | | | | | | | | | The Wrange-loop-analyses warns if a copy is made. Suppress this warning when a temporary is bound to a rvalue reference. While fixing this issue also found a copy-paste error in test6, which is also fixed. Differential Revision: https://reviews.llvm.org/D71806
OpenPOWER on IntegriCloud