aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-04-02Fix inline assembler constraint validationHEADmastermainllvm-r353983Joerg Sonnenberger
The current constraint logic is both too lax and too strict. It fails for input outside the [INT_MIN..INT_MAX] range, but it also implicitly accepts 0 as value when it should not. Adjust logic to handle both correctly. Differential Revision: https://reviews.llvm.org/D58649 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354937 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)Hans Wennborg
Apparently GCC allows this, and there's code relying on it (see bug). The idea is to allow expression that would have been allowed if they were cast to int. So I based the code on how such a cast would be done (the CK_PointerToIntegral case in IntExprEvaluator::VisitCastExpr()). Differential Revision: https://reviews.llvm.org/D58821 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355491 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02[8.0 Regression] Fix handling of `__builtin_constant_p` inside template ↵Eric Fiselier
arguments, enumerators, case statements, and the enable_if attribute. Summary: The following code is accepted by Clang 7 and prior but rejected by the upcoming 8 release and in trunk [1] ``` // error {{never produces a constant expression}} void foo(const char* s) __attribute__((enable_if(__builtin_constant_p(*s) == false, "trap"))) {} void test() { foo("abc"); } ``` Prior to Clang 8, the call to `__builtin_constant_p` was a constant expression returning false. Currently, it's not a valid constant expression. The bug is caused because we failed to set `InConstantContext` when attempting to evaluate unevaluated constant expressions. [1] https://godbolt.org/z/ksAjmq Reviewers: rsmith, hans, sbenza Reviewed By: rsmith Subscribers: kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355743 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-07Make HasFloat16 true for all architecturesYi Kong
Upstream Clang removed _Float16 literal support on non-ARM targets. frameworks/ml/nn makes heavy use of _Float16 on x86, causing it fail to build. Make HasFloat16 true for now in Android toolchain so that NN could continue to build. Bug: 127391056 Change-Id: I2be6122d7b1dd8622d6b71606552e2afbfff62a4
2019-03-07Revert "Revert removal of F16 literal support for non ARM/SPIR Targets"Yi Kong
This reverts commit a71400342678e0bd321510c0150f7bb30193e49b. The revert was incomplete. Instead of reverting the changes, just make HasFloat16 to be true by default. Change-Id: I8fce8dc3fb584627a7f16c56efbce4073010af9d
2019-03-05Revert removal of F16 literal support for non ARM/SPIR TargetsYi Kong
This reverts commit 57a6ce7a and 248e5bf6. frameworks/ml/nn still makes heavy use of _Float16 on x86. Let's keep this working until they figure out a way to avoid using it. Bug: 127391056 Change-Id: I98192c407ec1192ec6e340646ffc2c3d86f83d3b
2019-03-01Revert "Re-land "[LTO] Enable module summary eission by default for regular ↵Pirama Arumuga Nainar
LTO"" This reverts commit 8246e4314763066223547505fe18a288f639a475. Change-Id: I1b25ac90f805d5c93fe227d5e6c25e2f54d0c1aa
2019-03-01[Driver] Fix float ABI default for Android ARMv8.Dan Albert
Summary: Android doesn't regress back to soft float after ARMv7 :) Reviewers: srhines, pirama Reviewed By: srhines, pirama Subscribers: javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58477 Change-Id: I67f54ef75163d24a199bca72183aa75a2777ba8b git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354622 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27Merge 171531e317 for LLVM update to 353983Yi Kong
Change-Id: Ia74b4aa849e43a8bf33f944d94d18920454f6a7a
2019-02-27 revert to previous base llvm-svn.349610Yi Kong
Change-Id: I225d988d276b86df0845f26abe5865f434b7505d
2019-02-22[Driver] Fix float ABI default for Android ARMv8.Dan Albert
Summary: Android doesn't regress back to soft float after ARMv7 :) Reviewers: srhines, pirama Reviewed By: srhines, pirama Subscribers: javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58477 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354622 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[WebAssembly] Bulk memory intrinsics and builtinsThomas Lively
Summary: implements llvm intrinsics and clang intrinsics for memory.init and data.drop. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57736 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353983 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[Sema] Delay checking whether objc_designated_initializer is being applied ↵Erik Pilkington
to an init method This fixes a regression that was caused by r335084, which reversed the order that attributes are applied. objc_method_family can change whether a method is an init method, so the order that these attributes are applied matters. The commit fixes this by delaying the init check until after all attributes have been applied. rdar://47829358 Differential revision: https://reviews.llvm.org/D58152 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353976 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[PowerPC] Stop defining _ARCH_PWR6X on POWER7 and upHubert Tong
Summary: The predefined macro `_ARCH_PWR6X` is associated with GCC's `-mcpu=power6x` option, which enables generation of P6 "raw mode" instructions such as `mftgpr`. Later POWER processors build upon the "architected mode", not the raw one. `_ARCH_PWR6X` should not be defined for these later processors. Fixes PR#40236. Reviewers: echristo, hfinkel, kbarton, nemanjai, wschmidt Reviewed By: hfinkel Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58128 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353975 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[clang] Make sure C99/C11 features in <float.h> are provided in C++11Louis Dionne
Summary: Previously, those #defines were only provided in C or when GNU extensions were enabled. We need those #defines in C++11 and above, too. Reviewers: jfb, eli.friedman Subscribers: jkorous, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58149 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13Re-enable the test disabled in r353836 and hopefully make it pass in gcc buildsNico Weber
Argument evaluation order is different between gcc and clang, so pull out the Builder calls to make the generated IR independent of the host compiler's argument evaluation order. Thanks to rnk for reminding me of this clang/gcc difference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353969 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[Headers][mips] Add `__attribute__((__mode__(__unwind_word__)))` to the ↵Simon Atanasyan
_Unwind_Word / _Unwind_SWord definitions The rationale of this change is to fix _Unwind_Word / _Unwind_SWord definitions for MIPS N32 ABI. This ABI uses 32-bit pointers, but _Unwind_Word and _Unwind_SWord types are eight bytes long. # The __attribute__((__mode__(__unwind_word__))) is added to the type definitions. It makes them equal to the corresponding definitions used by GCC and allows to override types using `getUnwindWordWidth` function. # The `getUnwindWordWidth` virtual function override in the `MipsTargetInfo` class and provides correct type size values. Differential revision: https://reviews.llvm.org/D58165 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353965 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[Driver] Pass +reserve-x25 to backend if -ffixed-x25 is specifiedPetr Hosek
This was accidentally omitted in r353957 breaking the Clang test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353960 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[AArch64] Support reserving arbitrary general purpose registersPetr Hosek
This is a follow up to D48580 and D48581 which allows reserving arbitrary general purpose registers with the exception of registers with special purpose (X8, X16-X18, X29, X30) and registers used by LLVM (X0, X19). This change also generalizes some of the existing logic to rely entirely on values generated from tablegen. Differential Revision: https://reviews.llvm.org/D56305 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353957 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[HIP] Handle compile -m options and propagate into LLCAaron Enye Shi
Allow the compile options for -m such as -mxnack/-mno-xnack, -msram-ecc/-mno-sram-ecc, -mcode-object-v3/-mno-code-object-v3 to propagate into LLC args. Fix an issue where -mattr was pushed even when it was empty. Also add lit tests to verify features are properly passed. Differential Revision: https://reviews.llvm.org/D57977 Reviewers: yaxunl, kzhuravl git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353952 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[test] Tweak driver test from r353917 and r353922 to pass with a nondefault ↵Martin Storsjo
CLANG_DEFAULT_LINKER Force -fuse-ld=ld, as some other tests in the same file do. Loosen the regex matching the linker tool name as well, as this can end up being <triple>-ld in case such a named tool exists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[Analyzer] Crash fix for FindLastStoreBRVisitorAdam Balogh
FindLastStoreBRVisitor tries to find the first node in the exploded graph where the current value was assigned to a region. This node is called the "store site". It is identified by a pair of Pred and Succ nodes where Succ already has the binding for the value while Pred does not have it. However the visitor mistakenly identifies a node pair as the store site where the value is a `LazyCompoundVal` and `Pred` does not have a store yet but `Succ` has it. In this case the `LazyCompoundVal` is different in the `Pred` node because it also contains the store which is different in the two nodes. This error may lead to crashes (a declaration is cast to a parameter declaration without check) or misleading bug path notes. In this patch we fix this problem by checking for unequal `LazyCompoundVals`: if their region is equal, and their store is the same as the store of their nodes we consider them as equal when looking for the "store site". This is an approximation because we do not check for differences of the subvalues (structure members or array elements) in the stores. Differential Revision: https://reviews.llvm.org/D58067 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13Look through typedefs in getFunctionTypeWithExceptionSpecStephan Bergmann
Fixes https://bugs.llvm.org/show_bug.cgi?id=40658 Differential Revision: https://reviews.llvm.org/D58056 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353931 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[test] Fix the test from SVN r353917 when running without lld availableMartin Storsjo
These tests still relies on the default linker not to be overridden via e.g. CLANG_DEFAULT_LINKER in cmake. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[MinGW] Add the profiling library when necessaryMartin Storsjo
Profiling still doesn't seem to work properly, but this at least hooks up the library and eases completing whatever is missing. Differential Revision: https://reviews.llvm.org/D58107 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353917 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Revert r353880 "[HIP] Handle compile -m options and propagate into LLC"Reid Kleckner
This was still causing test failures in the clang test suite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353893 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12docs: Update the ShadowCallStack documentation.Peter Collingbourne
- Remove most of the discussion of the x86_64 implementation; link to an older version of the documentation for details of that implementation. - Add description of the compatibility and security issues discovered during the development of the aarch64 implementation for Android. Differential Revision: https://reviews.llvm.org/D58105 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353890 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[X86] Follow up to r353878, add MSVC compatibility command lines to other ↵Craig Topper
intrinsic tests that uses packed structs to control alignment. r353878 fixed a bug in _mm_loadu_ps and added a command line to catch it. Adding additional command lines to prevent breaking other intrinsics in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353887 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[HIP] Fix hip-toolchain-rdc testsAaron Enye Shi
Since we removed changed the way HIP Toolchain will propagate -m options into LLC, we need to remove from these older tests. This is related to rC353880. Differential Revision: https://reviews.llvm.org/D57977 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353885 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Make ModuleDependencyCollector's method virtual (NFC)Jonas Devlieghere
For reproducers in LLDB we want to hook up into the existing clang infrastructure. To make that happen we need to be able to override the ModuleDependencyCollector's methods. The alternative was to inherit from the DependencyCollector directly, but that would mean re-implementing the ModuleDependencyListener and the ModuleDependencyPPCallbacks and ModuleDependencyMMCallbacks. Differential revision: https://reviews.llvm.org/D58072 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353882 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[HIP] Handle compile -m options and propagate into LLCAaron Enye Shi
Allow the compile options for -m such as -mxnack/-mno-xnack, -msram-ecc/-mno-sram-ecc, -mcode-object-v3/-mno-code-object-v3 to propagate into LLC args. Also add lit tests to verify features are properly passed. Differential Revision: https://reviews.llvm.org/D57977 Reviewers: yaxunl, kzhuravl git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353880 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[X86] Use __m128_u for _mm_loadu_ps after r353555Reid Kleckner
Add secondary triple to existing SSE test for it. I audited other uses of __attribute__((__packed__)) in the intrinsic headers, and this seemed to be the only missing one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353878 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Disable PIC/PIE for MSP430 targetAnton Korobeynikov
Relocatable code generation is meaningless on MSP430, as the platform is too small to use shared libraries. Patch by Dmitry Mikushev! Differential Revision: https://reviews.llvm.org/D56927 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353877 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[NFC] typoJF Bastien
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353875 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[AMDGPU] Require at least protected visibility for certain symbolsScott Linder
This allows the global visibility controls to be restrictive while still populating the dynamic symbol table where required. Differential Revision: https://reviews.llvm.org/D56871 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353870 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[CMake][Fuchsia] Pass -ldl -lpthread LDFLAGS to second stagePetr Hosek
We're using static libc++ for the second stage which requires explicitly linking -ldl and -lpthread. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353853 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[Sema] Fix a crash in access checking for deduction guidesIlya Biryukov
Summary: See the added test for a repro. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58111 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353840 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Renaming yet another diagnostic to not conflict; NFC.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353839 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Renaming this diagnostic to not conflict with another; NFC.Aaron Ballman
Amends r353837 which renamed the diagnostics to conflict. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353838 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Fixing a typo; NFC.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353837 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Disable test after r353718, r353725, r353729 while I investigateNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353836 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[X86] Use the new unaligned vector typedefs for the loadu/storeu intrinsics ↵Craig Topper
pointer arguments. This matches what gcc does and what was suggested by rnk in PR20670. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353802 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12Fix VS2015 build problem introduced by r353370.Douglas Yung
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353791 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11Add a new attribute, fortify_stdlibErik Pilkington
This attribute applies to declarations of C stdlib functions (sprintf, memcpy...) that have known fortified variants (__sprintf_chk, __memcpy_chk, ...). When applied, clang will emit calls to the fortified variant functions instead of calls to the defaults. In GCC, this is done by adding gnu_inline-style wrapper functions, but that doesn't work for us for variadic functions because we don't support __builtin_va_arg_pack (and have no intention to). This attribute takes two arguments, the first is 'type' argument passed through to __builtin_object_size, and the second is a flag argument that gets passed through to the variadic checking variants. rdar://47905754 Differential revision: https://reviews.llvm.org/D57918 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11[Sema] Mark GNU compound literal array init as an rvalue.Eli Friedman
Basically the same issue as string init, except it didn't really have any visible consequences before I removed the implicit lvalue-to-rvalue conversion from CodeGen. While I'm here, a couple minor drive-by cleanups: IgnoreParens never returns a ConstantExpr, and there was a potential crash with string init involving a ChooseExpr. The analyzer test change maybe indicates we could simplify the analyzer code a little with this fix? Apparently a hack was added to support lvalues in initializers in r315750, but I'm not really familiar with the relevant code. Fixes regression reported in the kernel build at https://bugs.llvm.org/show_bug.cgi?id=40430#c6 . Differential Revision: https://reviews.llvm.org/D58069 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11[WebAssembly] Make thread-related options consistentHeejin Ahn
Summary: There have been three options related to threads and users had to set all three of them separately to get the correct compilation results. This makes sure the relationship between the options makes sense and sets necessary options for users if only part of the necessary options are specified. This does: - Remove `-matomics`; this option alone does not enable anything, so removed it to not confuse users. - `-mthread-model posix` sets `-target-feature +atomics` - `-pthread` sets both `-target-feature +atomics` and `-mthread-model posix` Also errors out when explicitly given options don't match, such as `-pthread` is given with `-mthread-model single`. Reviewers: dschuff, sbc100, tlively, sunfish Subscribers: jgravelle-google, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57874 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353761 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11Fix a few tests that were missing ':' on CHECK lines and weren't testing ↵Nico Weber
anything. Found by `git grep '\/\/ CHECK-[^: ]* ' clang/test/ | grep -v RUN:`. Also tweak CodeGenCXX/arm-swiftcall.cpp to still pass now that it checks more. Differential Revision: https://reviews.llvm.org/D58061 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353744 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11[CodeGen] Set construction vtable visibility after creating initializerPetr Hosek
We must only set the construction vtable visibility after we create the vtable initializer, otherwise the global value will be treated as declaration rather than definition and the visibility won't be set. Differential Revision: https://reviews.llvm.org/D58010 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353742 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11[COFF, ARM64] Remove definitions for _byteswap library functionsTom Tan
_byteswap_* functions are are implemented in below file as normal function from libucrt.lib and declared in stdlib.h. Define them in intrin.h triggers lld error "conflicting comdat type" and "duplicate symbols" which was just added to LLD (https://reviews.llvm.org/D57324). C:\Program Files (x86)\Windows Kits\10\Source\10.0.17763.0\ucrt\stdlib\byteswap.cpp Differential Revision: https://reviews.llvm.org/D57915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353740 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11Attempt to pacify bots more after r353718 and r353725Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353729 91177308-0d34-0410-b5e6-96231b3b80d8