summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gn build: Merge r372712GN Sync Bot2019-09-241-0/+1
| | | | llvm-svn: 372713
* [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.Seiya Nuta2019-09-247-128/+220
| | | | | | | | | | | | | | | | | | | | | Summary: This patch splits the command-line parsing into two phases: First, parse cross-platform options and leave ELF-specific options unparsed. Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig. Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67139 llvm-svn: 372712
* [clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbotFangrui Song2019-09-241-0/+32
| | | | llvm-svn: 372711
* MCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEHPavel Labath2019-09-2410-51/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The functions different in two ways: - getLLVMRegNum could return both "eh" and "other" dwarf register numbers, while getLLVMRegNumFromEH only returned the "eh" number. - getLLVMRegNum asserted if the register was not found, while the second function returned -1. The second distinction was pretty important, but it was very hard to infer that from the function name. Aditionally, for the use case of dumping dwarf expressions, we needed a function which can work with both kinds of number, but does not assert. This patch solves both of these issues by merging the two functions into one, returning an Optional<unsigned> value. While the same thing could be achieved by adding an "IsEH" argument to the (renamed) getLLVMRegNumFromEH function, it seemed better to avoid the confusion of two functions and put the choice of asserting into the hands of the caller -- if he checks the Optional value, he can safely process "untrusted" input, and if he blindly dereferences the Optional, he gets the assertion. I've updated all call sites to the new API, choosing between the two options according to the function they were calling originally, except that I've updated the usage in DWARFExpression.cpp to use the "safe" method instead, and added a test case which would have previously triggered an assertion failure when processing (incorrect?) dwarf expressions. Reviewers: dsanders, arsenm, JDevlieghere Subscribers: wdng, aprantl, javed.absar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67154 llvm-svn: 372710
* [NFC] Update test after r372708David Bolvansky2019-09-241-1/+1
| | | | llvm-svn: 372709
* [Diagnostics] Do not diagnose unsigned shifts in boolean context ↵David Bolvansky2019-09-243-32/+39
| | | | | | | | (-Wint-in-bool-context) I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts. llvm-svn: 372708
* gn build: Merge r372706GN Sync Bot2019-09-241-0/+1
| | | | llvm-svn: 372707
* [clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test ↵Fangrui Song2019-09-247-0/+533
| | | | | | from D64736 llvm-svn: 372706
* [ASTImporter] 4th attempt to fix Windows buildbot test errorsGabor Marton2019-09-241-4/+8
| | | | llvm-svn: 372705
* Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for ↵Simon Pilgrim2019-09-244-89/+0
| | | | | | | | | | | | | | | | | | detecting obvious infinite loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 ------- Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule" llvm-svn: 372704
* [Debuginfo] dbg.value points to undef value after Induction Variable ↵Alexey Lapshin2019-09-243-9/+190
| | | | | | | | | | | | | | | | | | | | | | | | | Simplification. Induction Variable Simplification pass does not update dbg.value intrinsic. Before: %add = add nuw nsw i32 %ArgIndex.06, 1 call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression()) After: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression()) There should be: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression()) Differential Revision: https://reviews.llvm.org/D67770 llvm-svn: 372703
* [lldb][NFC] Relax completion tests for log command to make them pass on LinuxRaphael Isemann2019-09-241-15/+4
| | | | | | | | The log channels change depending on platform, so listing them breaks on some platforms. Let's just check that the 'lldb' and 'dwarf' channels are there which are independent of platform. llvm-svn: 372701
* [LLDB] Avoid warnings about redefining posix mode defines on MinGWMartin Storsjo2019-09-241-1/+11
| | | | | | | | | | | | | Since these defines were added in LLVM SVN r189364 in 2013, mingw-w64 got defines for S_I?GRP, S_IRWXG, S_I?OTH and S_IRWXO in 2015. Also change the existing defined(_MSC_VER) into ifndef S_IRUSR, for consistency. Differential Revision: https://reviews.llvm.org/D67910 llvm-svn: 372700
* [LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architecturesMartin Storsjo2019-09-241-1/+14
| | | | | | | | | | While debugging on those architectures might not be supported yet, the generic code should still be buildable. This file accesses x86 specific fields in the CONTEXT struct. Differential Revision: https://reviews.llvm.org/D67911 llvm-svn: 372699
* sanitizer_common: fix freebsd build errorDmitry Vyukov2019-09-241-1/+0
| | | | | | | | Variable flags is not used. Remove it. Suggested-by: randall77 (Keith Randall) Review: https://reviews.llvm.org/D67928 llvm-svn: 372698
* [lldb] Fix log output and UtilityTests/LogChannelTest.ListRaphael Isemann2019-09-241-0/+1
| | | | | | | I refactored this code in 372691 and it seems I didn't fully replicate the original log output, so that test was failing. llvm-svn: 372696
* [LV] Forced vectorization with runtime checks and OptForSizeSjoerd Meijer2019-09-242-3/+44
| | | | | | | | | | | | | | | When vectorisation is forced with a pragma, we optimise for min size, and we need to emit runtime memory checks, then allow this code growth and don't run in an assert like we currently do. This is the result of D65197 and D66803, and was a use-case not really considered before. If this now happens, we emit an optimisation remark warning about the code-size expansion, which can be avoided by not forcing vectorisation or possibly source-code modifications. Differential Revision: https://reviews.llvm.org/D67764 llvm-svn: 372694
* [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite ↵Adam Balogh2019-09-244-0/+89
| | | | | | | | | | | | | | | | loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 llvm-svn: 372693
* [lldb] Remove redundant argument lists in CompletionRequestRaphael Isemann2019-09-244-20/+13
| | | | | | | | | | | We currently have two lists in the CompletionRequest that we inherited from the old API: The complete list of arguments ignoring where the user requested completion and the list of arguments that stops at the cursor. Having two lists of arguments is confusing and can lead to subtle errors, so let's remove the complete list until we actually need it. llvm-svn: 372692
* [lldb] Add completion support for log enable/disable/listRaphael Isemann2019-09-244-7/+110
| | | | | | | | | | | | | | Reviewers: #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67903 llvm-svn: 372691
* Ignore generated @import statements in the expression evaluatorRaphael Isemann2019-09-243-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject `@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling and loading unrelated C++ modules because it thinks the user has requested that it should load them. As the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths), it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS). This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements in the wrapper source code. This is done by check if the import happens in the fake source file containing our wrapper code (which implies it was generated by LLDB). This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760) Reviewers: aprantl, shafik, jingham Subscribers: lldb-commits Tags: #c_modules_in_lldb, #lldb Differential Revision: https://reviews.llvm.org/D61565 llvm-svn: 372690
* [clang-format] NFC clang-format the clang-format unit testsPaul Hoad2019-09-241-324/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It is annoying that the clang-format tests aren't themselves clang-formatted, if you use a format on save option in VS or vim this file gets massively changed then you have to `git difftool` all the other changes back out, which is risky. I know people don't like mass clang-format changes but sometimes it becomes unmanageable to not. There are no other changes here other than just the reformat. clang-format tests all pass. ``` [==========] 691 tests from 21 test cases ran. (55990 ms total) [ PASSED ] 691 tests. ``` Reviewers: klimek, owenpan, timwoj Reviewed By: owenpan Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67888 llvm-svn: 372689
* [ASTImporter] 3rd attempt to fix Windows buildbot test errorsGabor Marton2019-09-241-4/+6
| | | | llvm-svn: 372688
* Revert "[static analyzer] Define __clang_analyzer__ macro in driver"Jan Korous2019-09-244-8/+9
| | | | | | This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187. llvm-svn: 372687
* Revert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"Jan Korous2019-09-241-1/+1
| | | | | | This reverts commit 4185460f758b98ea5b898c04c179704756ca8f53. llvm-svn: 372686
* Revert "[static analyzer][test] Test directly that driver sets ↵Jan Korous2019-09-241-2/+5
| | | | | | | | D__clang_analyzer__" This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb. llvm-svn: 372685
* Fix int to bool errors exposed due to r372612.Rumeet Dhindsa2019-09-243-4/+4
| | | | | | | | | Differential Revision: https://reviews.llvm.org/D67937 M lib/builtins/fp_add_impl.inc M lib/builtins/fp_lib.h M lib/builtins/fp_trunc_impl.inc llvm-svn: 372684
* [static analyzer][test] Test directly that driver sets D__clang_analyzer__Jan Korous2019-09-241-5/+2
| | | | | | Follow-up to fbd13570b0d llvm-svn: 372683
* [lit] Add -D__clang_analyzer__ to clang_analyze_cc1Jan Korous2019-09-241-1/+1
| | | | | | Fixup after fbd13570b0d llvm-svn: 372682
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-249-8/+45
| | | | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 Reapplies r372663 after adapting a failing test in the LLDB testsuite. llvm-svn: 372681
* [static analyzer] Remove --analyze-autoJan Korous2019-09-244-7/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D67934 llvm-svn: 372680
* [static analyzer] Define __clang_analyzer__ macro in driverJan Korous2019-09-244-9/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D67938 llvm-svn: 372679
* [InstCombine] Fold a shifty implementation of clamp-to-allones.Huihui Zhang2019-09-242-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fold or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) into X s> Y ? -1 : X https://rise4fun.com/Alive/d8Ab clamp255 is a common operator in image processing, can be implemented in a shifty way "(255 - X) >> 31 | X & 255". Fold shift into select enables more optimization, e.g., vmin generation for ARM target. Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon Reviewed By: lebedev.ri Subscribers: kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67800 llvm-svn: 372678
* Adapt test to upstream clang compiler changes.Adrian Prantl2019-09-241-1/+4
| | | | | | Clang now emits the correct C++ language version in DWARF. llvm-svn: 372677
* [InstCombine] Fold a shifty implementation of clamp-to-zero.Huihui Zhang2019-09-242-32/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fold and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) into X s> Y ? X : 0 https://rise4fun.com/Alive/lFH Fold shift into select enables more optimization, e.g., vmax generation for ARM target. Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon Reviewed By: lebedev.ri Subscribers: xbolva00, andreadb, craig.topper, RKSimon, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67799 llvm-svn: 372676
* [GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not ↵Amara Emerson2019-09-242-4/+46
| | | | | | | | | | | | unsigned. We were miscompiling switch value comparisons with the wrong signedness, which shows up when we have things like switch case values with i1 types, which end up being legalized incorrectly. Fixes PR43383 llvm-svn: 372675
* [llvm-cov] NFC: Specify a specific C++ standard in the test.Artem Dergachev2019-09-241-3/+6
| | | | | | Makes life easier for downstream users with customized default standard. llvm-svn: 372674
* [MemorySSA] Update Phi insertion.Alina Sbirlea2019-09-232-43/+71
| | | | | | | | | | | | | | | | | | | | | | Summary: MemoryPhis may be needed following a Def insertion inthe IDF of all the new accesses added (phis + potentially a def). Ensure this also occurs when only the new MemoryPhis are the defining accesses. Note: The need for computing IDF here is because of new Phis added with edges incoming from unreachable code, Phis that had previously been simplified. The preferred solution is to not reintroduce such Phis. This patch is the needed fix while working on the preferred solution. Reviewers: george.burgess.iv Subscribers: Prazek, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67927 llvm-svn: 372673
* Revert "Support for DWARF-5 C++ language tags."Jonas Devlieghere2019-09-239-45/+8
| | | | | | This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007. llvm-svn: 372672
* [NFC][InstCombine] Add tests for shifty implementation of clamping.Huihui Zhang2019-09-232-0/+473
| | | | | | | | | | | | | | | | | | | | | | | Summary: Clamp negative to zero and clamp positive to allOnes are common operation in image saturation. Add tests for shifty implementation of clamping, as prepare work for folding: and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> 0 ? X : 0; or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> Y ? allOnes : X. Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67798 llvm-svn: 372671
* [Make] Add support for building NeXT-style frameworksJonas Devlieghere2019-09-231-11/+40
| | | | | | | | | | This patch extends the Makefile.rules to build NeXT-style frameworks. It also fixes a bug in the clean logic that would accidentally delete the .mm source file instead of the .o object file. Thanks a lot to Adrian who was instrumental is getting this to work! llvm-svn: 372669
* [NFCI] Return PathSensitiveBugReport where appropriateAlex Langford2019-09-232-7/+10
| | | | | | | | | | Some compilers have trouble converting unique_ptr<PathSensitiveBugReport> to unique_ptr<BugReport> causing some functions to fail to compile. Changing the return type of the functions that fail to compile does not appear to have any issues. I ran into this issue building with clang 3.8 on Ubuntu 16.04. llvm-svn: 372668
* HotColdSplitting: invalidate the AssumptionCache on splitSaleem Abdulrasool2019-09-232-0/+43
| | | | | | | | | | | When a cold path is outlined, the value tracking in the assumption cache may be invalidated due to the code motion. We would previously trip an assertion in subsequent passes (but required the passes to happen in a single run as the assumption cache is shared across the passes). Invalidating the cache ensures that we get the correct information when needed with the legacy pass manager as well. llvm-svn: 372667
* [llvm-lipo] Add support for archives Alexander Shaposhnikov2019-09-232-140/+230
| | | | | | | | | | | Add support for creating universal binaries which can contain an archive. Differential revision: https://reviews.llvm.org/D67758 Test plan: make check-all llvm-svn: 372666
* [SampleFDO] Treat names in profile as not cold only when profile symbol listWei Mi2019-09-232-29/+44
| | | | | | | | | | | | | | is available In rL372232, we treated names showing up in profile as not cold when profile-sample-accurate is enabled. This caused 70k size regression in Chrome/Android. The patch put a guard and only enable the change when profile symbol list is available, i.e., keep the old behavior when profile symbol list is not available. Differential Revision: https://reviews.llvm.org/D67931 llvm-svn: 372665
* [Diagnostics] Warn for enum constants in bool context ↵David Bolvansky2019-09-233-2/+47
| | | | | | | | (-Wint-in-bool-context; GCC compatibility) Extracted from D63082. llvm-svn: 372664
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-239-8/+45
| | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 llvm-svn: 372663
* Fix uninitialized variable warning. NFCI.Simon Pilgrim2019-09-231-1/+1
| | | | llvm-svn: 372662
* [X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFCCraig Topper2019-09-231-70/+3
| | | | | | | The avx512 with prefer-256-bit generates the same code as AVX2 so just reuse that prefix. llvm-svn: 372661
* [lld][WebAssembly] Preserve symbol flags in --relocatable outputSam Clegg2019-09-235-28/+14
| | | | | | | | Fixes https://github.com/emscripten-core/emscripten/issues/8879 Differential Revision: https://reviews.llvm.org/D67729 llvm-svn: 372660
OpenPOWER on IntegriCloud