summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Relax restriction in tests to where "-emit-llvm-bc" and "-emit-obj" must appear.Douglas Yung2019-02-143-28/+40
| | | | | | | The CHECK lines as structured were requiring them to appear only in a certain position while all that is really needed is to check that they are present. llvm-svn: 354001
* Fix for asan botsLeonard Chan2019-02-141-9/+12
| | | | llvm-svn: 353999
* [HWASAN] Updated HWASAN design document to better portray the chance of ↵Mitch Phillips2019-02-131-1/+2
| | | | | | | | | | | | | | missing a bug. Summary: Provided rule of thumb percentage chances of miss for 4 and 8 bit tag sizes. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58195 llvm-svn: 353990
* [NewPM] Second attempt at porting ASanLeonard Chan2019-02-132-3/+71
| | | | | | | | | | | | | | | | | | | | This is the second attempt to port ASan to new PM after D52739. This takes the initialization requried by ASan from the Module by moving it into a separate class with it's own analysis that the new PM ASan can use. Changes: - Split AddressSanitizer into 2 passes: 1 for the instrumentation on the function, and 1 for the pass itself which creates an instance of the first during it's run. The same is done for AddressSanitizerModule. - Add new PM AddressSanitizer and AddressSanitizerModule. - Add legacy and new PM analyses for reading data needed to initialize ASan with. - Removed DominatorTree dependency from ASan since it was unused. - Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the new PM analysis holds these 2 classes and will need to expose them. Differential Revision: https://reviews.llvm.org/D56470 llvm-svn: 353985
* Restore Check for Unreachable Exit Block in -Winfinite-recursionRobert Widmann2019-02-132-2/+15
| | | | | | | | | | | | | | | | | | | Summary: When this was rewritten in D43737, the logic changed to better explore infinite loops. The check for a reachable exit block was deleted which accidentally introduced false positives in case the exit node was unreachable. We were testing for cases like this, but @steven_wu provided an additional test case that I've included in the regression tests for this patch. Reviewers: steven_wu, rtrieu Reviewed By: steven_wu, rtrieu Subscribers: cfe-commits, steven_wu Tags: #clang Differential Revision: https://reviews.llvm.org/D58122 llvm-svn: 353984
* [WebAssembly] Bulk memory intrinsics and builtinsThomas Lively2019-02-133-3/+43
| | | | | | | | | | | | | | | | 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 llvm-svn: 353983
* [Sema] Delay checking whether objc_designated_initializer is being applied ↵Erik Pilkington2019-02-135-11/+43
| | | | | | | | | | | | | | | | 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 llvm-svn: 353976
* [PowerPC] Stop defining _ARCH_PWR6X on POWER7 and upHubert Tong2019-02-132-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 353975
* [clang] Make sure C99/C11 features in <float.h> are provided in C++11Louis Dionne2019-02-132-9/+12
| | | | | | | | | | | | | | | | 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 llvm-svn: 353970
* Re-enable the test disabled in r353836 and hopefully make it pass in gcc buildsNico Weber2019-02-132-20/+17
| | | | | | | | | 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. llvm-svn: 353969
* [Headers][mips] Add `__attribute__((__mode__(__unwind_word__)))` to the ↵Simon Atanasyan2019-02-134-3/+28
| | | | | | | | | | | | | | | | | | _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 llvm-svn: 353965
* [Driver] Pass +reserve-x25 to backend if -ffixed-x25 is specifiedPetr Hosek2019-02-131-0/+3
| | | | | | This was accidentally omitted in r353957 breaking the Clang test. llvm-svn: 353960
* [AArch64] Support reserving arbitrary general purpose registersPetr Hosek2019-02-133-1/+133
| | | | | | | | | | | | 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 llvm-svn: 353957
* [HIP] Handle compile -m options and propagate into LLCAaron Enye Shi2019-02-132-2/+68
| | | | | | | | | | | 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 llvm-svn: 353952
* [test] Tweak driver test from r353917 and r353922 to pass with a nondefault ↵Martin Storsjo2019-02-131-2/+2
| | | | | | | | | | | 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. llvm-svn: 353946
* [Analyzer] Crash fix for FindLastStoreBRVisitorAdam Balogh2019-02-133-5/+48
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 353943
* Look through typedefs in getFunctionTypeWithExceptionSpecStephan Bergmann2019-02-132-1/+15
| | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=40658 Differential Revision: https://reviews.llvm.org/D58056 llvm-svn: 353931
* [test] Fix the test from SVN r353917 when running without lld availableMartin Storsjo2019-02-131-2/+2
| | | | | | | These tests still relies on the default linker not to be overridden via e.g. CLANG_DEFAULT_LINKER in cmake. llvm-svn: 353922
* [MinGW] Add the profiling library when necessaryMartin Storsjo2019-02-132-0/+10
| | | | | | | | | 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 llvm-svn: 353917
* Revert r353880 "[HIP] Handle compile -m options and propagate into LLC"Reid Kleckner2019-02-122-68/+2
| | | | | | This was still causing test failures in the clang test suite. llvm-svn: 353893
* docs: Update the ShadowCallStack documentation.Peter Collingbourne2019-02-121-96/+116
| | | | | | | | | | | | - 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 llvm-svn: 353890
* [X86] Follow up to r353878, add MSVC compatibility command lines to other ↵Craig Topper2019-02-123-112/+115
| | | | | | | | 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. llvm-svn: 353887
* [HIP] Fix hip-toolchain-rdc testsAaron Enye Shi2019-02-122-6/+0
| | | | | | | | | | 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 llvm-svn: 353885
* Make ModuleDependencyCollector's method virtual (NFC)Jonas Devlieghere2019-02-121-5/+5
| | | | | | | | | | | | | | 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 llvm-svn: 353882
* [HIP] Handle compile -m options and propagate into LLCAaron Enye Shi2019-02-122-2/+68
| | | | | | | | | | | 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 llvm-svn: 353880
* [X86] Use __m128_u for _mm_loadu_ps after r353555Reid Kleckner2019-02-122-1/+2
| | | | | | | | 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. llvm-svn: 353878
* Disable PIC/PIE for MSP430 targetAnton Korobeynikov2019-02-122-0/+34
| | | | | | | | | | 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 llvm-svn: 353877
* [NFC] typoJF Bastien2019-02-121-1/+1
| | | | llvm-svn: 353875
* [AMDGPU] Require at least protected visibility for certain symbolsScott Linder2019-02-123-0/+95
| | | | | | | | | 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 llvm-svn: 353870
* [CMake][Fuchsia] Pass -ldl -lpthread LDFLAGS to second stagePetr Hosek2019-02-121-0/+6
| | | | | | | We're using static libc++ for the second stage which requires explicitly linking -ldl and -lpthread. llvm-svn: 353853
* [Sema] Fix a crash in access checking for deduction guidesIlya Biryukov2019-02-122-1/+16
| | | | | | | | | | | | | | | | 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 llvm-svn: 353840
* Renaming yet another diagnostic to not conflict; NFC.Aaron Ballman2019-02-122-2/+3
| | | | llvm-svn: 353839
* Renaming this diagnostic to not conflict with another; NFC.Aaron Ballman2019-02-122-2/+2
| | | | | | Amends r353837 which renamed the diagnostics to conflict. llvm-svn: 353838
* Fixing a typo; NFC.Aaron Ballman2019-02-122-4/+4
| | | | llvm-svn: 353837
* Disable test after r353718, r353725, r353729 while I investigateNico Weber2019-02-121-13/+17
| | | | llvm-svn: 353836
* [X86] Use the new unaligned vector typedefs for the loadu/storeu intrinsics ↵Craig Topper2019-02-122-8/+8
| | | | | | | | pointer arguments. This matches what gcc does and what was suggested by rnk in PR20670. llvm-svn: 353802
* Fix VS2015 build problem introduced by r353370.Douglas Yung2019-02-121-2/+2
| | | | llvm-svn: 353791
* Add a new attribute, fortify_stdlibErik Pilkington2019-02-1111-1/+434
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 353765
* [Sema] Mark GNU compound literal array init as an rvalue.Eli Friedman2019-02-113-9/+49
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 353762
* [WebAssembly] Make thread-related options consistentHeejin Ahn2019-02-118-14/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 353761
* Fix a few tests that were missing ':' on CHECK lines and weren't testing ↵Nico Weber2019-02-118-9/+9
| | | | | | | | | | | | 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 llvm-svn: 353744
* [CodeGen] Set construction vtable visibility after creating initializerPetr Hosek2019-02-112-1/+21
| | | | | | | | | | 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 llvm-svn: 353742
* [COFF, ARM64] Remove definitions for _byteswap library functionsTom Tan2019-02-112-12/+6
| | | | | | | | | | | | | _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 llvm-svn: 353740
* Attempt to pacify bots more after r353718 and r353725Nico Weber2019-02-111-3/+3
| | | | llvm-svn: 353729
* Attempt to pacify bots after r353718Nico Weber2019-02-111-7/+7
| | | | llvm-svn: 353725
* Make test actually test something (colons were missing)Nico Weber2019-02-111-17/+17
| | | | llvm-svn: 353718
* Fixed header underline in docs.Alexander Kornienko2019-02-111-252/+252
| | | | | | + Removed trailing whitespace. llvm-svn: 353711
* [tools] Fix python DeprecationWarning: invalid escape sequenceSerge Guelton2019-02-113-4/+4
| | | | | | | | | | | | | | | | | | | The python documentation says "it’s highly recommended that you use raw strings for all but the simplest expressions." (https://docs.python.org/3/library/re.html) So do that with the attached patch generated by sed -i -e "s/re.search('/re.search(r'/g" $(git grep -l 're.search(') The warning can be seen in e.g. python3.7: $ python3.7 -Wd >>> import re; re.search('\s', '') <stdin>:1: DeprecationWarning: invalid escape sequence \s Commited on behalf of Marco Falke. Differential Revision: https://reviews.llvm.org/D57528 llvm-svn: 353707
* Make some helper functions static. NFC.Benjamin Kramer2019-02-112-5/+4
| | | | llvm-svn: 353705
* [analyzer] New checker for detecting usages of unsafe I/O functionsKristof Umann2019-02-114-3/+195
| | | | | | | | | | | | | | | | There are certain unsafe or deprecated (since C11) buffer handling functions which should be avoided in safety critical code. They could cause buffer overflows. A new checker, 'security.insecureAPI.DeprecatedOrUnsafeBufferHandling' warns for every occurrence of such functions (unsafe or deprecated printf, scanf family, and other buffer handling functions, which now have a secure variant). Patch by Dániel Kolozsvári! Differential Revision: https://reviews.llvm.org/D35068 llvm-svn: 353698
OpenPOWER on IntegriCloud