summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined ↵Eric Fiselier2019-01-171-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deduction guides. Summary: Some style guides want to allow using CTAD only on types that "opt-in"; i.e. on types that are designed to support it and not just types that *happen* to work with it. This patch implements the `-Wctad-maybe-unsupported` warning, which is off by default, which warns when CTAD is used on a type that does not define any deduction guides. The following pattern can be used to suppress the warning in cases where the type intentionally doesn't define any deduction guides: ``` struct allow_ctad_t; template <class T> struct TestSuppression { TestSuppression(T) {} }; TestSuppression(allow_ctad_t)->TestSuppression<void>; // guides with incomplete parameter types are never considered. ``` Reviewers: rsmith, james.dennett, gromer Reviewed By: rsmith Subscribers: jdennett, Quuxplusone, lebedev.ri, cfe-commits Differential Revision: https://reviews.llvm.org/D56731 llvm-svn: 351484
* [CodeGenObjC] Use a constant value for non-fragile ivar offsets when possibleErik Pilkington2019-01-173-20/+58
| | | | | | | | | | | | | | | If a class inherits from NSObject and has an implementation, then we can assume that ivar offsets won't need to be updated by the runtime. This allows us to index into the object using a constant value and avoid loading from the ivar offset variable. This patch was adapted from one written by Pete Cooper. rdar://problem/10132568 Differential revision: https://reviews.llvm.org/D56802 llvm-svn: 351461
* [ObjC] Follow-up r350768 and allow the use of unavailable methods that areAlex Lorenz2019-01-172-4/+22
| | | | | | | | | | | | | | | | declared in a parent class from within the @implementation context This commit extends r350768 and allows the use of methods marked as unavailable that are declared in a parent class/category from within the @implementation of the class where the method is marked as unavailable. This allows users to call init that's marked as unavailable even if they don't define it. rdar://47134898 Differential Revision: https://reviews.llvm.org/D56816 llvm-svn: 351459
* TLS: Respect visibility for thread_local variables on Darwin (PR40327)Vlad Tsyrklevich2019-01-172-1/+18
| | | | | | | | | | | | | | | | | | Summary: Teach clang to mark thread wrappers for thread_local variables with hidden visibility when the original variable is marked with hidden visibility. This is necessary on Darwin which exposes the thread wrapper instead of the thread variable. The thread wrapper would previously always be created with default visibility unless it had linkonce*/weak_odr linkage. Reviewers: rjmccall Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D56818 llvm-svn: 351457
* CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_roundsAnton Korobeynikov2019-01-172-0/+13
| | | | | | | | | | | | | llvm.flt.rounds returns an i32, but the builtin expects an integer. On targets where integers are not 32-bits clang tries to bitcast the result, causing an assertion failure. The patch enables newlib build for msp430. Patch by Edward Jones! Differential Revision: https://reviews.llvm.org/D24461 llvm-svn: 351449
* [X86] Add custom emission for the avx512 scatter builtins to convert from ↵Craig Topper2019-01-172-48/+48
| | | | | | scalar integer to vXi1 for the mask arguments to the intrinsics. llvm-svn: 351408
* [analyzer] Another RetainCountChecker cleanupGeorge Karpenkov2019-01-161-0/+7
| | | | | | | | | This is not NFC strictly speaking, since it unifies CleanupAttr handling, so that out parameters now also understand it. Differential Revision: https://reviews.llvm.org/D56759 llvm-svn: 351394
* Recommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms"Craig Topper2019-01-164-4/+126
| | | | | | V8 has been fixed now. llvm-svn: 351391
* [X86] Add versions of the avx512 gather intrinsics that take the mask as a ↵Craig Topper2019-01-162-32/+32
| | | | | | | | | | vXi1 vector instead of a scalar We need to custom handle these so we can turn the scalar mask into a vXi1 vector. Differential Revision: https://reviews.llvm.org/D56530 llvm-svn: 351390
* Fix libc++ mac driver test to pass on WindowsReid Kleckner2019-01-161-4/+3
| | | | | | | There is a substitution for 'clang-check' to absolutize it, so the '$(which clang-check)' is unnecessary. llvm-svn: 351383
* PR40329: [adl] Fix determination of associated classes when searching aRichard Smith2019-01-162-0/+50
| | | | | | | | | | | | | | | | | | | | | | | member enum and then its enclosing class. There are situations where ADL will collect a class but not the complete set of associated classes / namespaces of that class. When that happened, and we later tried to collect those associated classes / namespaces, we would previously short-circuit the lookup and not find them. Eg, for: struct A : B { enum E; }; if we first looked for associated classes/namespaces of A::E, we'd find only A. But if we then tried to also collect associated classes/namespaces of A (which should include the base class B), we would not add B because we had already visited A. This also fixes a minor issue where we would fail to collect associated classes from an overloaded class member access expression naming a static member function. llvm-svn: 351382
* [Fixed Point Arithmetic] Fixed Point SubtractionLeonard Chan2019-01-161-0/+390
| | | | | | | | | This patch covers subtraction between fixed point types and other fixed point types or integers, using the conversion rules described in 4.1.4 of N1169. Differential Revision: https://reviews.llvm.org/D55844 llvm-svn: 351371
* [Fixed Point Arithmetic] Fixed Point AdditionLeonard Chan2019-01-162-12/+400
| | | | | | | | | | | | | | | | | | This patch covers addition between fixed point types and other fixed point types or integers, using the conversion rules described in 4.1.4 of N1169. Usual arithmetic rules do not apply to binary operations when one of the operands is a fixed point type, and the result of the operation must be calculated with the full precision of the operands, so we should not perform any casting to a common type. This patch does not include constant expression evaluation for addition of fixed point types. That will be addressed in another patch since I think this one is already big enough. Differential Revision: https://reviews.llvm.org/D53738 llvm-svn: 351364
* Add a REQUIRES: darwin line for a mac test.Jeremy Morse2019-01-161-1/+1
| | | | | | | | This test, apparently for macs, fails on Windows as lit can't emulate the shell subprocess $(which...) correctly. Some other netbsd and linux buildbots also fail here. Limit to macs as a temporary workaround. llvm-svn: 351360
* Added test cases for dumping variadic-like functions; NFC.Aaron Ballman2019-01-163-0/+26
| | | | llvm-svn: 351355
* Added a test case for dumping blocks that capture 'this'; NFC.Aaron Ballman2019-01-161-0/+17
| | | | llvm-svn: 351350
* [MSP430] Improve support of 'interrupt' attributeAnton Korobeynikov2019-01-162-2/+19
| | | | | | | | | | | | * Accept as an argument constants in range 0..63 (aligned with TI headers and linker scripts provided with TI GCC toolchain). * Emit function attribute 'interrupt'='xx' instead of aliases (used in the backend to create a section for particular interrupt vector). * Add more diagnostics. Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D56663 llvm-svn: 351344
* [MSP430] Fix msp430-toolchain.c on Windows (added in r351228)Anton Korobeynikov2019-01-161-16/+16
| | | | | | | | Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D56776 llvm-svn: 351340
* Set '-target' flag in the test checking the MacOS include dirIlya Biryukov2019-01-161-1/+1
| | | | | | | | | | | To fix a buildbot failure on PS4, see http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/42251 The test was added in r351222 and aims to check only a particular Mac configuration. However it relied on the default compiler target by default, therefore unintentionally failing on PS4. llvm-svn: 351334
* Reapply [Tooling] Make clang-tool find libc++ dir on mac when running on a ↵Sam McCall2019-01-161-0/+16
| | | | | | | | | file without compilation database. This reverts commit r351282, and re-lands r351222 and r351229 with the use-after-free fixed. llvm-svn: 351316
* [SEH] Pass the frame pointer from SEH finally to finally functionsSanjin Sijaric2019-01-161-0/+26
| | | | | | | | | Pass the frame pointer that the first finally block receives onto the nested finally block, instead of generating it using localaddr. Differential Revision: https://reviews.llvm.org/D56463 llvm-svn: 351302
* [WebAssembly] COWS has been renamed to WASI.Dan Gohman2019-01-162-12/+12
| | | | llvm-svn: 351298
* [SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03Eric Fiselier2019-01-161-0/+21
| | | | | | | | | | | | | | | | When -faligned-allocation is specified in C++03 libc++ defines std::align_val_t as an unscoped enumeration type (because Clang didn't provide scoped enumerations as an extension until 8.0). Unfortunately Clang confuses the `align_val_t` overloads of delete with the sized deallocation overloads which aren't enabled. This caused Clang to call the aligned deallocation function as if it were the sized deallocation overload. For example: https://godbolt.org/z/xXJELh This patch fixes the confusion. llvm-svn: 351294
* [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfpEli Friedman2019-01-162-9/+9
| | | | | | | | | | This is the clang counterpart to D56747. Patch by Mandeep Singh Grang. Differential Revision: https://reviews.llvm.org/D56748 llvm-svn: 351284
* Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a ↵Vlad Tsyrklevich2019-01-161-16/+0
| | | | | | | | | file without compilation database." This reverts commits r351222 and r351229, they were causing ASan/MSan failures on the sanitizer bots. llvm-svn: 351282
* Re-order type param children of ObjC nodesStephen Kelly2019-01-151-1/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55394 llvm-svn: 351272
* Re-order overrides in FunctionDecl dumpStephen Kelly2019-01-151-1/+1
| | | | | | | | | | | | | | Output all content which is local to the FunctionDecl before traversing to child AST nodes. This is necessary so that all of the part which is local to the FunctionDecl can be split into a different method. Reviewers: aaron.ballman Differential Revision: https://reviews.llvm.org/D55083 llvm-svn: 351269
* [clang-cl] Alias /Zc:alignedNew[-] to -f[no-]aligned-allocationReid Kleckner2019-01-151-0/+6
| | | | | | | | | | | | | | | Implements PR40180. clang-cl has one minor behavior difference with cl with this change. Clang allows the user to enable the C++17 feature of aligned allocation without enabling all of C++17, but MSVC will not call the aligned allocation overloads unless -std:c++17 is passed. While our behavior is technically incompatible, it would require making driver mode specific changes to match MSVC precisely, and clang's behavior is useful because it allows people to experiment with new C++17 features individually. Therefore, I plan to leave it as is. llvm-svn: 351249
* Enable IAS for OpenBSD SPARC.Brad Smith2019-01-151-4/+8
| | | | llvm-svn: 351245
* [MSVC Compat] Fix typo correction for inclusion directives.Volodymyr Sapsai2019-01-151-0/+1
| | | | | | | | | | | | | | | In MSVC compatibility mode we were checking not the typo corrected filename but the original filename. Reviewers: christylee, compnerd Reviewed By: christylee Subscribers: jkorous, dexonsmith, sammccall, hokein, cfe-commits Differential Revision: https://reviews.llvm.org/D56631 llvm-svn: 351232
* [Nios2] Remove Nios2 backendCraig Topper2019-01-152-30/+0
| | | | | | | | As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months. Differential Revision: https://reviews.llvm.org/D56690 llvm-svn: 351230
* [MSP430] Provide a toolchain descriptionAnton Korobeynikov2019-01-159-6/+137
| | | | | | | | | | | | | | | This is an initial implementation for msp430 toolchain including -mmcu option support -mhwmult options support -integrated-as by default The toolchain uses msp430-elf-as as a linker and supports msp430-gcc toolchain tree. Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D56658 llvm-svn: 351228
* [Tooling] Make clang-tool find libc++ dir on mac when running on a file ↵Haojian Wu2019-01-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | without compilation database. Summary: This is a regression of r348365. When clang-tools run on a file without a complation database (`clang-check /tmp/t.cc`), we will use fixed compilation database as a fallback. However the actual compiler path in the fallback complation command is just `clang-tool` which is insufficient to detect the libc++ dir. Reviewers: ilya-biryukov, EricWF Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56680 llvm-svn: 351222
* Fix cpu-dispatch MV regression caused by r347812Erich Keane2019-01-151-0/+8
| | | | | | | | | | | r347812 permitted forward declarations for cpu-dispatch functions, which are occassionally useful as exposition in header files. However, this inadvertently permitted this function to become multiversioned after a usage. This patch ensures that the "CausesMV" checks are still run in the forward-declaration case. Change-Id: Icb6f975a2d068f088b89e3bbe26cf1d24f5a972c llvm-svn: 351212
* Revert "[X86] Make _xgetbv/_xsetbv on non-windows platforms"Benjamin Kramer2019-01-154-126/+4
| | | | | | This reverts commit r351160. Breaks building v8. llvm-svn: 351210
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-151-1/+1
| | | | | | | | | compiler identification lines in test-cases. (Doing so only because it's then easier to search for references which are actually important and need fixing.) llvm-svn: 351200
* [clang][UBSan] Sanitization for alignment assumptions.Roman Lebedev2019-01-1511-0/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: UB isn't nice. It's cool and powerful, but not nice. Having a way to detect it is nice though. [[ https://wg21.link/p1007r3 | P1007R3: std::assume_aligned ]] / http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r2.pdf says: ``` We propose to add this functionality via a library function instead of a core language attribute. ... If the pointer passed in is not aligned to at least N bytes, calling assume_aligned results in undefined behaviour. ``` This differential teaches clang to sanitize all the various variants of this assume-aligned attribute. Requires D54588 for LLVM IRBuilder changes. The compiler-rt part is D54590. This is a second commit, the original one was r351105, which was mass-reverted in r351159 because 2 compiler-rt tests were failing. Reviewers: ABataev, craig.topper, vsk, rsmith, rnk, #sanitizers, erichkeane, filcab, rjmccall Reviewed By: rjmccall Subscribers: chandlerc, ldionne, EricWF, mclow.lists, cfe-commits, bkramer Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54589 llvm-svn: 351177
* [WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses itDan Gohman2019-01-152-5/+39
| | | | | | | | | | | | This adds support for multilib paths for wasm32 targets, following [Debian's Multiarch conventions], and also adds an experimental OS name in order to test it. [Debian's Multiarch conventions]: https://wiki.debian.org/Multiarch/ Differential Revision: https://reviews.llvm.org/D56553 llvm-svn: 351164
* [X86] Make _xgetbv/_xsetbv on non-windows platformsCraig Topper2019-01-154-4/+126
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch attempts to redo what was tried in r278783, but was reverted. These intrinsics should be available on non-windows platforms with "xsave" feature check. But on Windows platforms they shouldn't have feature check since that's how MSVC behaves. To accomplish this I've added a MS builtin with no feature check. And a normal gcc builtin with a feature check. When _MSC_VER is not defined _xgetbv/_xsetbv will be macros pointing to the gcc builtin name. I've moved the forward declarations from intrin.h to immintrin.h to match the MSDN documentation and used that as the header file for the MS builtin. I'm not super happy with this implementation, and I'm open to suggestions for better ways to do it. Reviewers: rnk, RKSimon, spatel Reviewed By: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56686 llvm-svn: 351160
* Revert alignment assumptions changesVlad Tsyrklevich2019-01-1511-418/+0
| | | | | | | Revert r351104-6, r351109, r351110, r351119, r351134, and r351153. These changes fail on the sanitizer bots. llvm-svn: 351159
* [COFF, ARM64] Add __byteswap intrinsicsMandeep Singh Grang2019-01-151-6/+22
| | | | | | | | | | | | Reviewers: rnk, efriedma, ssijaric, TomTan, haripul Reviewed By: efriedma Subscribers: javed.absar, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D56685 llvm-svn: 351147
* [COFF, ARM64] Add __nop intrinsicMandeep Singh Grang2019-01-141-0/+13
| | | | | | | | | | | | Reviewers: rnk, efriedma, TomTan, haripul, ssijaric Reviewed By: rnk, efriedma Subscribers: javed.absar, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D56671 llvm-svn: 351135
* Improve a -Wunguarded-availability noteErik Pilkington2019-01-146-41/+42
| | | | | | | | | | | Mention the deployment target, and don't say "partial" which doesn't really mean anything to users. rdar://problem/33601513 Differential revision: https://reviews.llvm.org/D56523 llvm-svn: 351108
* [clang][UBSan] Sanitization for alignment assumptions.Roman Lebedev2019-01-1411-0/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: UB isn't nice. It's cool and powerful, but not nice. Having a way to detect it is nice though. [[ https://wg21.link/p1007r3 | P1007R3: std::assume_aligned ]] / http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r2.pdf says: ``` We propose to add this functionality via a library function instead of a core language attribute. ... If the pointer passed in is not aligned to at least N bytes, calling assume_aligned results in undefined behaviour. ``` This differential teaches clang to sanitize all the various variants of this assume-aligned attribute. Requires D54588 for LLVM IRBuilder changes. The compiler-rt part is D54590. Reviewers: ABataev, craig.topper, vsk, rsmith, rnk, #sanitizers, erichkeane, filcab, rjmccall Reviewed By: rjmccall Subscribers: chandlerc, ldionne, EricWF, mclow.lists, cfe-commits, bkramer Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54589 llvm-svn: 351105
* [analyzer] [PR39792] false positive on strcpy targeting struct membersGeorge Karpenkov2019-01-141-0/+5
| | | | | | | | Patch by Pierre van Houtryve. Differential Revision: https://reviews.llvm.org/D55226 llvm-svn: 351097
* [WebAssembly] Remove old builtinsDan Gohman2019-01-141-24/+0
| | | | | | | | | This removes the old grow_memory and mem.grow-style builtins, leaving just the memory.grow-style builtins. Differential Revision: https://reviews.llvm.org/D56645 llvm-svn: 351089
* [Sema] Expose a control flag for integer to pointer ext warningKristina Brooks2019-01-142-2/+13
| | | | | | | | | | | | | While building openJDK11u, it seems that some of the code in the native core libraries make liberal use of integer to pointer comparisons. We currently have no flag to disabled this warning. This add such a flag. Patch by Kader (abdoul-kader keita) Differential Revision: https://reviews.llvm.org/D56241 llvm-svn: 351082
* [OpenCL] Set generic addr space of 'this' in special class members.Anastasia Stulova2019-01-142-51/+83
| | | | | | | | | | | | | | | | | Set address spaces of 'this' param correctly for implicit special class members. This also changes initialization conversion sequence to separate address space conversion from other qualifiers in case of binding reference to a temporary. In this case address space conversion should happen after the binding (unlike for other quals). This is needed to materialize it correctly in the alloca address space. Initial patch by Mikael Nilssoni! Differential Revision: https://reviews.llvm.org/D56066 llvm-svn: 351053
* [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select ↵Craig Topper2019-01-142-9/+15
| | | | | | | | in IR instead. Fixes PR40259 llvm-svn: 351036
* [X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a ↵Craig Topper2019-01-142-6/+9
| | | | | | | | | | vXi1 vector. We'll do the scalar<->vXi1 conversions with bitcasts in IR. Fixes PR40258 llvm-svn: 351029
OpenPOWER on IntegriCloud