summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[Sema] Suppress -Wchar-subscripts if the index is a literal char"Edward Jones2019-11-072-15/+1
| | | | This reverts commit 7adab7719e55e1b29bfd521dcc73f202139e8f41.
* Fix warning about unused std::unique result, erase shifted elementsReid Kleckner2019-11-071-8/+11
| | | | | This is actually a functional change. I haven't added any new test coverage. I'm just trying to fix the warning and hoping for the best.
* [RISCV] Fix up tests on Windows after new usage of sys::path::appendReid Kleckner2019-11-072-22/+22
|
* [OPENMP][DOCS] Update OpenMP status (NFC)Alexey Bataev2019-11-071-2/+4
| | | | | | | | | | | | | | Summary: This is updating the OpenMP status table. Cray has volunteered for `defaultmap` and supporting `in_reduction` on the `target` construct, so the status on those entries from was changed from "unclaimed". Also, a new entry was added for supporting non-contiguous arrays sections on the `target update` directive. Reviewers: ABataev, hfinkel, jdoerfert, kkwli0 Reviewed By: ABataev Subscribers: guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69923
* [Sema] Suppress -Wchar-subscripts if the index is a literal charEdward Jones2019-11-072-1/+15
| | | | | | | | Assume that the user knows what they're doing if they provide a char literal as an array index. This more closely matches the behavior of GCC. Differential Revision: https://reviews.llvm.org/D58896
* Add support for options -frounding-math, ftrapping-math, -ffp-model=, and ↵Melanie Blower2019-11-0712-18/+539
| | | | | | | | | | | | -ffp-exception-behavior= Add options to control floating point behavior: trapping and exception behavior, rounding, and control of optimizations that affect floating point calculations. More details in UsersManual.rst. Reviewers: rjmccall Differential Revision: https://reviews.llvm.org/D62731
* [RISCV] Improve sysroot computation if no GCC install detectedEdward Jones2019-11-0711-7/+82
| | | | | | | | | | If a GCC installed is not detected, the driver would default to the root of the filesystem. This is not ideal when this doesn't match the install directory of the toolchain and can cause undesireable behavior such as picking up system libraries or the system linker when cross-compiling. Differential Revision: https://reviews.llvm.org/D68391
* [OpenCL] Add geometric and relational builtin functionsSven van Haastregt2019-11-071-0/+100
| | | | | | | | | Add the geometric and relational builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69908
* [OpenCL] Add integer builtin functionsSven van Haastregt2019-11-072-11/+70
| | | | | | | | | This patch adds the integer builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69901
* CodeGen: set correct result for atomic compound expressionsTim Northover2019-11-072-9/+73
| | | | | | | | Atomic compound expressions try to use atomicrmw if possible, but this path doesn't set the Result variable, leaving it to crash in later code if anything ever tries to use the result of the expression. This fixes that issue by recalculating the new value based on the old one atomically loaded.
* [OpenCL] Add math and common builtin functionsSven van Haastregt2019-11-071-18/+153
| | | | | | | | | Add the remaining math and common builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69883
* [mips] Set macros for Octeon+ CPUSimon Atanasyan2019-11-072-2/+15
|
* [mips] Add `octeon+` to the list of CPUs accepted by the driverSimon Atanasyan2019-11-076-3/+23
|
* [clang-rename] Respect the traversal scope when traversing the entire AST.Haojian Wu2019-11-071-1/+1
| | | | | | | | | | | | | | | Summary: This should be NFC to clang-rename, by default the traversal scope is TUDecl. Traversing the TUDecl in clangd is a performance cliff, we should avoid it. Reviewers: ilya-biryukov Subscribers: kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69892
* Revert a5c8ec4 "[CGDebugInfo] Emit subprograms for decls when AT_tail_call ↵Hans Wennborg2019-11-073-22/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is understood" This caused Chromium builds to fail with "inlinable function call in a function with debug info must have a !dbg location" errors. See https://bugs.chromium.org/p/chromium/issues/detail?id=1022296#c1 for a reproducer. > Currently, clang emits subprograms for declared functions when the > target debugger or DWARF standard is known to support entry values > (DW_OP_entry_value & the GNU equivalent). > > Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU > tail calls. > > Pre-patch debug session with a cross-TU tail call: > > ``` > * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] > frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt] > ``` > > Post-patch (note that the tail-calling frame, "helper", is visible): > > ``` > * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] > frame #1: 0x0000000100000f80 main`helper [opt] [artificial] > frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt] > ``` > > rdar://46577651 > > Differential Revision: https://reviews.llvm.org/D69743
* [clang-format] Make '.clang-format' variants finding a loop (NFC)Anders Waldenborg2019-11-071-31/+27
| | | | | | | This simplifies logic making it trivial to add searching for other files later. Differential revision: https://reviews.llvm.org/D68568
* [Syntax] Silence "unused function" warning in no-assert builds. NFCIlya Biryukov2019-11-071-0/+2
| | | | A helper `isImpicitExpr` is only used inside assert.
* [Clang] Add ENABLE_LINKER_BUILD_ID to Hurd driver.kristina2019-11-071-0/+4
| | | | | | | | | This was added for Linux toolchains in rC271692, this patch extends this to the Hurd toolchain. Patch by sthibaul (Samuel Thibault) Differential Revision: https://reviews.llvm.org/D69754
* [OPENMP] [DOCS] fix section formatting issues [NFC]Kelvin Li2019-11-061-13/+10
| | | | Differential Revision: https://reviews.llvm.org/D69909
* [clang-format] [NFC] update the documentation in Format.h to allow ↵paulhoad2019-11-063-30/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dump_format_style.py to get a little closer to being correct. (part 2) Summary: a change {D67541} cause LanguageStandard to now be subtly different from all other clang-format options, in that the Enum value (less the prefix) is not always allowed as valid as the configuration option. This caused the ClangFormatStyleOptions.rst and the Format.h to diverge so that the ClangFormatStyleOptions.rst could no longer be generated from the Format.h using dump_format_stlye.py This fix tried to remedy that: 1) by allowing an additional comment (in Format.h) after the enum to be used as the `in configuration ( XXXX )` text, and changing the dump_format_style.py to support that. This makes the following code: ``` enum { ... LS_Cpp03, // c++03 LS_Cpp11, // c++11 ... }; ``` would render as: ```* ``LS_Cpp03`` (in configuration: ``c++03``) * ``LS_Cpp11`` (in configuration: ``c++11``) ``` And we also move the deprecated alias into the text of the enum (otherwise it won't be added at the end as an option) This patch includes a couple of other whitespace changes which help bring Format.h and ClangFormatStyleOptions.rst almost back into line and regeneratable... (there is still one more) Reviewers: klimek, mitchell-stellar, sammccall Reviewed By: mitchell-stellar, sammccall Subscribers: mrexodia, cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D69433
* [NFC] Add SUPPORT_PLUGINS to add_llvm_executable()David Tenty2019-11-061-3/+3
| | | | | | | | | | | | | | | | | | | Summary: this allows us to move logic about when it is appropriate set LLVM_NO_DEAD_STRIP out of each tool and into add_llvm_executable, which will enable future platform specific handling. This is a follow on to the reverted D69356 Reviewers: hubert.reinterpretcast, beanz, lhames Reviewed By: beanz Subscribers: mgorny, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69638
* [X86] Add 'fxsr' feature to -march=pentium2 to match X86.td and gcc.Craig Topper2019-11-062-1/+3
|
* [X86] Add 'mmx' to all CPUs that have a version of 'sse' and weren't already ↵Craig Topper2019-11-062-10/+22
| | | | | | | | | | | | | | enabling '3dnow' All SSE capable CPUs have MMX. 3dnow implicitly enables MMX. We have code that detects if sse is enabled and implicitly enables MMX unless -mno-mmx is passed. So in most cases we were already enabling MMX if march passed a CPU that supported SSE. The exception to this is if you pass -march for a cpu supports SSE and also pass -mno-sse. We should still enable MMX since its part of the CPU capability.
* [clang-format] [RELAND] Remove the dependency on frontendpaulhoad2019-11-062-15/+27
| | | | | | | | | | | | | | Summary: relanding {D68969} after it failed UBSAN build caused by the passing of an invalid SMLoc() (nullptr) Reviewers: thakis, vlad.tsyrklevich, klimek, mitchell-stellar Reviewed By: thakis Subscribers: merge_guards_bot, mgorny, cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D69854
* [clang-format] Assert that filenames are not emptypaulhoad2019-11-061-0/+4
| | | | | | | | | | | | | | | | | | | Summary: Adds asserts to catch empty filenames, which otherwise will cause a crash in SourceManager. The clang-format tool now outputs an error if an empty filename is used. Fixes bug: 34667 Reviewers: krasimir, djasper, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: cfe-commits Patch by: @jr Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D56345
* [libTooling] Fix breakage from change #84922Yitzhak Mandelbaum2019-11-062-2/+5
|
* [libTooling] Small changes in Transformer API.Yitzhak Mandelbaum2019-11-063-46/+57
| | | | | | | | | | | | | | | | | Summary: * Rename `transformer::change` to `transformer::changeTo`, make `change` forward to `changeTo` and mark it deprecated. * Mark `transformer::text` and `transformer::selection` deprecated and migrate references to them in tests. Reviewers: ilya-biryukov Subscribers: gribozavr, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69896
* [libTooling] Simplify type structure of `Stencil`s.Yitzhak Mandelbaum2019-11-063-239/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, stencils are defined as a sequence of `StencilParts`. This differentiation adds an unneeded layer of complexity to the definition of Stencils. This change significantly simplifies the type structure: a stencil is now conceptually any object implementing `StencilInterface` and `Stencil` is just a thin wrapper for pointers to this interface. To account for the sequencing that was supported by the old `Stencil` type, we introduce a sequencing class that implements `StencilInterface`. That is, sequences are just another kind of Stencil and no longer have any special status. Corresponding to this change in the type structure, we change the way `cat` is used (and defined). `cat` bundles multiple features: it builds a stencil from a sequence of subcomponents and admits multiple different types for its arguments, while coercing them into the right type. Previously, `cat` was also used to coerce a single `StencilPart` into a `Stencil`. With that distinction gone, many uses of `cat` (e.g. in the tests) are unnecessary and have, therefore, been removed. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69613
* NeonEmitter: remove special 'a' type modifier.Tim Northover2019-11-065-115/+74
| | | | | | | | 'a' used to implement a splat in C++ code in NeonEmitter.cpp, but this can be done directly from .td expansions now (and most ops already did). So removing it simplifies the overall code. https://reviews.llvm.org/D69716
* NeonEmitter: switch to enum for internal Type representation.Tim Northover2019-11-061-101/+90
| | | | | | | | | Previously we had a handful of bools (Signed, Floating, ...) that could easily end up in an inconsistent state. This adds an enum Kind which holds the mutually exclusive states a type might be in, retaining some of the bools that modified an underlying type. https://reviews.llvm.org/D69715
* [Syntax] Add nodes for most common statementsIlya Biryukov2019-11-065-33/+932
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Most of the statements mirror the ones provided by clang AST. Major differences are: - expressions are wrapped into 'ExpressionStatement' instead of being a subclass of statement, - semicolons are always consumed by the leaf expressions (return, expression satement, etc), - some clang statements are not handled yet, we wrap those into an UnknownStatement class, which is not present in clang. We also define an 'Expression' and 'UnknownExpression' classes in order to produce 'ExpressionStatement' where needed. The actual implementation of expressions is not yet ready, it will follow later. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63835
* [ARM,MVE] Add intrinsics for gather/scatter load/stores.Simon Tatham2019-11-065-26/+2403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds two new families of intrinsics, both of which are memory accesses taking a vector of locations to load from / store to. The vldrq_gather_base / vstrq_scatter_base intrinsics take a vector of base addresses, and an immediate offset to be added consistently to each one. vldrq_gather_offset / vstrq_scatter_offset take a scalar base address, and a vector of offsets to add to it. The 'shifted_offset' variants also multiply each offset by the element size type, so that the vector is effectively of array indices. At the IR level, these operations are represented by a single set of four IR intrinsics: {gather,scatter} × {base,offset}. The other details (signed/unsigned, shift, and memory element size as opposed to vector element size) are all specified by IR intrinsic polymorphism and immediate operands, because that made the selection job easier than making a huge family of similarly named intrinsics. I considered using the standard IR representations such as llvm.masked.gather, but they're not a good fit. In order to use llvm.masked.gather to represent a gather_offset load with element size smaller than a pointer, you'd have to expand the <8 x i16> vector of offsets into an <8 x i16*> vector of pointers, which would be split up during legalization, so you'd spend most of your time undoing the mess it had made. Also, ISel support for llvm.masked.gather would be easy enough in a trivial way (you can expand it into a gather-base load with a zero immediate offset), but instruction-selecting lots of fiddly idioms back into all the _other_ MVE load instructions would be much more work. So I think dedicated IR intrinsics are the more sensible approach, at least for the moment. On the clang tablegen side, I've added two new features to the Tablegen source accepted by MveEmitter: a 'CopyKind' type node for defining a type that varies with the parameter type (it lets you ask for an unsigned integer type of the same width as the parameter), and an 'unsignedflag' value node for passing an immediate IR operand which is 0 for a signed integer type or 1 for an unsigned one. That lets me write each kind of intrinsic just once and get all its subtypes and immediate arguments generated automatically. Also I've tweaked the handling of pointer-typed values in the code generation part of MveEmitter: they're generated as Address rather than Value (i.e. including an alignment) so that they can be given to the ordinary IR load and store operations, but I'd omitted the code to convert them back to Value when they're going to be used as an argument to an IR intrinsic. On the MC side, I've enhanced MVEVectorVTInfo so that it can tell you not only the full assembly-language suffix for a given vector type (like 's32' or 'u16') but also the numeric-only one used by store instructions (just '32' or '16'). Reviewers: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69791
* [ARM,MVE] Integer-type nitpicks in MVE intrinsics.Simon Tatham2019-11-063-5/+23
| | | | | | | | | | | | | | | | | | | | | A few integer types in the ACLE definitions of MVE intrinsics are given as 'int' or 'unsigned' instead of <stdint.h> fixed-size types like uint32_t. Usually these are the ones where the size isn't that important, such as immediate offsets in loads (which have a range limited by the instruction encoding) or the carry flag in vadcq which can only be 0 or 1 anyway. With this change, <arm_mve.h> follows that exact type naming, so that the function prototypes look identical to the ones in ACLE, instead of replacing int and unsigned with int32_t and uint32_t. Reviewers: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69790
* [clang,MveEmitter] Fix sign/zero extension in range limits.Simon Tatham2019-11-061-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | In the code that generates Sema range checks on constant arguments, I had a piece of code that checks the bounds specified in the Tablegen intrinsic description against the range of the integer type being tested. If the bounds are large enough to permit any value of the integer type, you can omit the compile-time range check. (This case is expected to come up in some of the bitwise operation intrinsics.) But somehow I got my signed/unsigned check backwards (asking for the signed min/max of an unsigned type and vice versa), and also made a sign extension error in which a signed negative value gets zero-extended. Now rewritten more sensibly, and it should get its first sensible test from the next batch of intrinsics I'm planning to add in D69791. Reviewers: dmgreen Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69789
* [ARM MVE] Remove accidental 64-bit vst2/vld2 intrinsics.Simon Tatham2019-11-061-1/+1
| | | | | | | | | | | | | | | ACLE defines no such intrinsic as vst2q_u64, and the MVE instruction set has no corresponding instruction. But I had accidentally added them to the fledgling <arm_mve.h> anyway, and if you used them, you'd get a compiler crash. Reviewers: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69788
* clang-format: Add a fallback style to Emacs modepaulhoad2019-11-061-0/+13
| | | | | | | | | | | | | | | | | | Summary: This allows one to enable `clang-format-buffer` on file save and avoid reformatting files that are outside of any project with .clang-format style. Reviewers: djasper, klimek, sammccall, owenpan, mitchell-stellar, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: cfe-commits Patch By: dottedmag Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D69752
* [clang-format] [PR35518] C++17 deduction guides are wrongly formattedpaulhoad2019-11-062-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: see https://bugs.llvm.org/show_bug.cgi?id=35518 clang-format removes spaces around deduction guides but not trailing return types, make the consistent ``` template <typename T> S(T)->S<T>; auto f(int, int) -> double; ``` becomes ``` template <typename T> S(T) -> S<T>; auto f(int, int) -> double; ``` Reviewers: klimek, mitchell-stellar, owenpan, sammccall, lichray, curdeius, KyrBoh Reviewed By: curdeius Subscribers: merge_guards_bot, hans, lichray, cfe-commits Tags: #clang-format, #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D69577
* Revert "[analyzer] Add test directory for scan-build."Volodymyr Sapsai2019-11-059-151/+1
| | | | | | | | This reverts commit 0aba69eb1a01c44185009f50cc633e3c648e9950 with subsequent changes to test files. It caused test failures on GreenDragon, e.g., http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/
* Fix typo so that '-O0' is correctly specifiedBill Wendling2019-11-051-3/+3
|
* [OPENMP50]Simplify processing of context selector scores.Alexey Bataev2019-11-056-79/+32
| | | | | | If the context selector score was not specified, its value must be set to 0. Simplify the processing of unspecified scores + save memory in attribute representation.
* [Sema] Fixes templated friend member assertionMark de Wever2019-11-052-1/+13
| | | | | | Fixes PR41792: Clang assertion failure on templated friend member function Differential Revision: https://reviews.llvm.org/D69481
* [HIP] Fix visibility for 'extern' device variables.Michael Liao2019-11-052-3/+13
| | | | | | | | | | | | | | Summary: - Fix a bug which misses the change for a variable to be set with target-specific attributes. Reviewers: yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63020
* [hip] Enable pointer argument lowering through coercing type.Michael Liao2019-11-053-3/+125
| | | | | | | | | | Reviewers: tra, rjmccall, yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69826
* [OPENMP]Improve diagnostics for unsupported unified addressing.Alexey Bataev2019-11-052-5/+10
| | | | Improved diagnostics for better user experience.
* [OPENMP][DOCS]Fix coloring of the implemented features status, NFC.Alexey Bataev2019-11-051-5/+5
|
* [Clang FE] Recognize -mnop-mcount CL option (SystemZ only).Jonas Paulsson2019-11-057-0/+45
| | | | | | | | | | | | | | Recognize -mnop-mcount from the command line and add a function attribute "mnop-mcount"="true" when passed. When this option is used, a nop is added instead of a call to fentry. This is used when building the Linux Kernel. If this option is passed for any other target than SystemZ, an error is generated. Review: Ulrich Weigand https://reviews.llvm.org/D67763
* [OpenCL] Group builtin functions by prototypeSven van Haastregt2019-11-051-13/+136
| | | | | | | | | | The TableGen-generated file containing the function definitions can be reorganized to save some memory in the Clang binary. Functions having the same prototype(s) will point to a shared list of prototype(s). Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63557
* [OpenCL] Add builtin function attribute handlingSven van Haastregt2019-11-054-43/+97
| | | | | | | | | Add handling for the "pure", "const" and "convergent" function attributes for OpenCL builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D64319
* [mips] Set __OCTEON__ macrosSimon Atanasyan2019-11-052-0/+4
|
* [mips] Fix `__mips_isa_rev` macros value for Octeon CPUSimon Atanasyan2019-11-052-1/+10
|
OpenPOWER on IntegriCloud