summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-objcopy] Add -B mipsJordan Rupprecht2019-04-182-8/+16
| | | | llvm-svn: 358667
* [clang-tidy] Address post-commit commentsHaojian Wu2019-04-183-33/+41
| | | | | | | | | | | | | | | | Summary: Also add a test to verify clang-tidy only apply the first alternative fix. Reviewers: alexfh Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60857 llvm-svn: 358666
* [clang][CIndex] Use llvm::set_thread_priorityKadir Cetinkaya2019-04-181-3/+1
| | | | | | | | | | | | Reviewers: jkorous, gribozavr Subscribers: dexonsmith, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60867 llvm-svn: 358665
* [clangd] Use llvm::set_thread_priority in background-indexKadir Cetinkaya2019-04-186-54/+32
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: krytarowski, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60865 llvm-svn: 358664
* [wasm] Simplify. NFCFangrui Song2019-04-183-4/+4
| | | | llvm-svn: 358663
* [MSVC] Use the correct casing of HostX64/HostX86Martin Storsjo2019-04-181-2/+2
| | | | | | | | | If accessing the MSVC installation root directly on a case sensitive filesystem, these details matter. Differential Revision: https://reviews.llvm.org/D60627 llvm-svn: 358662
* [Sema] Delete unused parameters/variablesFangrui Song2019-04-181-6/+2
| | | | llvm-svn: 358661
* [lldb] [test] Mark three more tests flakey/xfail on NetBSDMichal Gorny2019-04-182-0/+3
| | | | llvm-svn: 358660
* [LLD][ELF] - Convert out-of-order-section-in-region.s to *.test. NFCI.George Rimar2019-04-182-22/+20
| | | | | | This is consistent with the our others tests that has large scripts. llvm-svn: 358659
* [clangd] Emit better error messages when rename fails.Haojian Wu2019-04-182-6/+18
| | | | | | | | | | | | | | | | Summary: Currently we emit an unfriendly "clang diagnostic" message when rename fails. This patch makes clangd to emit a detailed diagnostic message. Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60821 llvm-svn: 358658
* [asan_symbolize] Add a simple plugin architectureDan Liew2019-04-184-48/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds a simple plugin architecture to `asan_symbolize.py`. The motivation here is that sometimes it's necessary to perform extra work to figure out where binaries with debug symbols can actually be found. For example it might be the case that a remote service needs to be queried for binaries and then copied to the local system. This "extra work" can be extremely site-specific such that adding the code directly into the `asan_symbolize.py` would just clutter the code for a very niche use case. To avoid this, the `asan_symbolize.py` can now load external code via a new `--plugins` command line option. These plugins are loaded before main command line argument parsing so that they can add their own command line options. Right now the only hook into the behaviour of symbolization is the `filter_binary_path()` function which assumes a very similar role to the `binary_name_filter` function that was previously in the code. We can add more hooks as necessary. Code in the `asan_symbolize.py` script does not call plugin code directly. Instead it uses a `AsanSymbolizerPlugInProxy` object. This object * Loads plugins from files. * Manages the lifetime of the plugins. * Provides an interface for calling into plugin functions and handles calling into multiple plugins. To unify the way binary paths are filtered the old `sysroot_path_filter` function (and associated code) has been turned into a simple plugin (`SysRootFilterPlugIn`) that is always loaded. The plugin unloads itself if the `-s` option is not present on the command line. Users should not see any functional change relating to this command line option. Some simple tests are provided to illustrate what plugin code looks like and also to check the functionality continues to work. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: srhines, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60529 llvm-svn: 358657
* [yaml2elf/obj2yaml] - Allow normal parsing/dumping of the .rela.dyn sectionGeorge Rimar2019-04-182-2/+47
| | | | | | | | | | | | | | | .rela.dyn is a section that has sh_info normally set to zero. And Info is an optional field in the description of the relocation section in YAML. But currently, yaml2obj would fail to produce the object when Info is not explicitly listed. The patch fixes the issue. Differential revision: https://reviews.llvm.org/D60820 llvm-svn: 358656
* [clangd] Log verbosely (LSP bodies) in lit tests. NFCSam McCall2019-04-181-1/+2
| | | | llvm-svn: 358655
* [CUDA][Windows] Restrict long double device functions declarations to WindowsEvgeny Mankov2019-04-183-3/+12
| | | | | | | | | | | | | As agreed in D60220, make long double declarations unobservable on non-windows platforms. [Testing] {Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.11 & 2019 16.0.1, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1} Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D60818 llvm-svn: 358654
* [LLD][ELF] - A fix for "linker script assignment loses relative nature of ↵George Rimar2019-04-183-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | section" bug. This is https://bugs.llvm.org//show_bug.cgi?id=39857. I added the comment with much more details to the bug page, the short version is below. The following script and code demonstrates the issue: aliasto__text = __text; SECTIONS { .text 0x1000 : { __text = . ; *(.text) } } ... call aliasto__text LLD fails with "cannot refer to absolute symbol: aliasto__text" error. It happens because at the moment of scanning the relocations we do not yet assign the correct/final/any section value for the symbol aliasto__text. I made a change to Relocations.cpp to fix that. Also, I had to remove the symbol-location.s test case completely, because now it does not trigger any error. Since now all linker scripts symbols are resolved to constants, no errors can be triggered at all it seems. I checked that it is consistent with the behavior of bfd and gold (they do not trigger errors for the case from symbol-location.s), so it should be OK. I.e. at least it is probably not the best possible, but natural behavior we obtained. Differential revision: https://reviews.llvm.org/D55423 llvm-svn: 358652
* [X86][SSE] Lower ICMP EQ(AND(X,C),C) -> SRA(SHL(X,LOG2(C)),BW-1) iff C is ↵Simon Pilgrim2019-04-182-709/+353
| | | | | | | | | | | | | | power-of-2. This replaces the MOVMSK combine introduced at D52121/rL342326 (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C)) with the more general icmp lowering so it can pick up more cases through bitcasts - notably vXi8 cases which use vXi16 shifts+masks, this patch can remove the mask and use pcmpgtb(0,x) for the sra. Differential Revision: https://reviews.llvm.org/D60625 llvm-svn: 358651
* [ELF] Respect NonAlloc when copying flags from the previous sectionsFangrui Song2019-04-183-1/+7
| | | | | | | | | | | | | | | | Summary: If the output section contains only symbol assignments, we copy flags from the previous sections. Don't set SHF_ALLOC if NonAlloc is true. We also have to change the type from SHT_NOBITS to SHT_PROGBITS. In ld.bfd, bfd_elf_get_default_section_type maps non-alloctable sections to SHT_PROGBITS. Non-alloctable SHT_NOBITS sections do not make sense. Fixes PR38626 Differential Revision: https://reviews.llvm.org/D59986 llvm-svn: 358650
* [llvm-objcopy][llvm-strip] Add switch to allow removing referenced sectionsJames Henderson2019-04-1812-49/+160
| | | | | | | | | | | | | | | | | | | | llvm-objcopy currently emits an error if a section to be removed is referenced by another section. This is a reasonable thing to do, but is different to GNU objcopy. We should allow users who know what they are doing to have a way to produce the invalid ELF. This change adds a new switch --allow-broken-links to both llvm-strip and llvm-objcopy to do precisely that. The corresponding sh_link field is then set to 0 instead of an error being emitted. I cannot use llvm-readelf/readobj to test the link fields because they emit an error if any sections, like the .dynsym, cannot be properly loaded. Reviewed by: rupprecht, grimar Differential Revision: https://reviews.llvm.org/D60324 llvm-svn: 358649
* Test commit access [NFC]Cullen Rhodes2019-04-181-1/+1
| | | | | | Remove a trailing space llvm-svn: 358648
* [NewPM] Add Option handling for LoopVectorizeSerguei Katkov2019-04-183-3/+55
| | | | | | | | | | | This patch enables passing options to LoopVectorizePass via the passes pipeline. Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe Reviewed By: fedor.sergeev Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D60681 llvm-svn: 358647
* [LLD][ELF] - Fix the different behavior of the linker script symbols on ↵George Rimar2019-04-182-26/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | different platforms. This generalizes code and also fixes the broken behavior shown in one of our test cases for some targets, like x86-64. The issue occurs when the forward declarations are used in the script. One of the samples is: SECTIONS { foo = ADDR(.text) - ABSOLUTE(ADDR(.text)); }; In that case, we have a broken output when output target does not use thunks. That happens because thunks creating code (called from maybeAddThunks) calls Script->assignAddresses() at least one more time, what fixups the values. As a result final symbols values can be different on AArch64 and x86, for example. In this patch, I generalize and rename maybeAddThunks to finalizeAddressDependentContent and now it is used and called by all targets. Differential revision: https://reviews.llvm.org/D55550 llvm-svn: 358646
* [ELF] Place SectionPiece::{Live,Hash} bit fields togetherFangrui Song2019-04-183-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We access Live and OutputOff (which may share the same memory location) concurrently in 2 parallelForEachN loops. Separating them avoids subtle data races like D41884/PR35788. This patch places Live and Hash together. 2 reasons this is appealing: 1) Hash is immutable. Live is almost read-only - only written once in MarkLive.cpp where Hash is not accessed 2) we already discard low bits of Hash to decide ShardID. It doesn't matter much if we make 32-bit Hash to 31-bit. For a huge internal clang -O3 executable (1.6GiB), `Strings` in StringTableBuilder::finalizeStringTable contains at most 310253 elements. The expected number of pair-wise collisions 2^(-31) * C(310253,2) ~= 22.41 is too small to have a negative impact on performance. Actually, my benchmark shows there is actually a minor performance improvement. Differential Revision: https://reviews.llvm.org/D60765 llvm-svn: 358645
* [PowerPC] Fix wrong ElemSIze when calling isConsecutiveLS()Kang Zhang2019-04-182-1/+13
| | | | | | | | | | | | | | | | | | | | Summary: This issue from the bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41177 When the two operands for BUILD_VECTOR are same, we will get assert error. llvm::SDValue combineBVOfConsecutiveLoads(llvm::SDNode*, llvm::SelectionDAG&): Assertion `!(InputsAreConsecutiveLoads && InputsAreReverseConsecutive) && "The loads cannot be both consecutive and reverse consecutive."' failed. This error caused by the wrong ElemSIze when calling isConsecutiveLS(). We should use `getScalarType().getStoreSize();` to get the ElemSize instread of `getScalarSizeInBits() / 8`. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D60811 llvm-svn: 358644
* [llvm-profdata] Fix one bad format in llvm-profdata CommandGuide doc. NFCRong Xu2019-04-181-0/+1
| | | | llvm-svn: 358643
* Add support for ARMv7-M architecture which uses the Thumb 2 ISA (unified syntax)Martin Storsjo2019-04-182-0/+6
| | | | | | | | Patch by Jérémie Faucher-Goulet! Differential Revision: https://reviews.llvm.org/D60417 llvm-svn: 358642
* Elaborate why we have an option on by default for enabling chr.Eric Christopher2019-04-182-0/+4
| | | | llvm-svn: 358641
* [AMDGPU] Avoid DAG combining assert with fneg(fadd(A,0))Tim Renouf2019-04-182-0/+32
| | | | | | | | | | | fneg combining attempts to turn it into fadd(fneg(A), fneg(0)), but creating the new fadd folds to just fneg(A). When A has multiple uses, this confuses it and you get an assert. Fixed. Differential Revision: https://reviews.llvm.org/D60633 Change-Id: I0ddc9b7286abe78edc0cd8d734fdeb05ff09821c llvm-svn: 358640
* Fix a typo in comments. [NFC]Ali Tamur2019-04-181-1/+1
| | | | llvm-svn: 358639
* lld: elf: Fix sections with explict addresses in regionsRui Ueyama2019-04-182-3/+26
| | | | | | | | | | | | | | | | | | | | | | | Patch by Gabriel Smith. The address for a section would be evaluated before the region was switched to. Because of this, the position within the region would not be updated. After the region is swapped to the dot would be set to the out of date position within the region, undoing the section address evaluation. To fix this, the region is swapped to before the section's address is evaluated. As part of the fallout of this, expandMemoryRegions needed to be gated in setDot on the condition that the evaluated address is less than the dot. This is for the case where sections are not listed from lowest address to highest address. Finally, a test for the case where sections are listed "out of order" was added. Differential Revision: https://reviews.llvm.org/D60744 llvm-svn: 358638
* [GISel]:IRTranslator: Prefer a buidInstr form that allows CSE of cast ↵Aditya Nandakumar2019-04-181-1/+1
| | | | | | | | | | instructions https://reviews.llvm.org/D60844 Use the style of buildInstr that allows CSEing. llvm-svn: 358637
* Fix bad compare function over FusionCandidate.Richard Trieu2019-04-181-6/+8
| | | | | | | Reverse the checking of the domiance order so that when a self compare happens, it returns false. This makes compare function have strict weak ordering. llvm-svn: 358636
* [Shell] Simplify Extracting Python VersionJonas Devlieghere2019-04-181-2/+1
| | | | | | | Instead of parsing the Python version with a fairly convoluted regex, just print the major and minor version and call it a day. llvm-svn: 358635
* Revert Implement sys::fs::copy_file using the macOS copyfile(3) API to ↵Adrian Prantl2019-04-182-53/+0
| | | | | | | | | support APFS clones. This reverts r358628 (git commit 91a06bee788262a294527b815354f380d99dfa9b) while investigating a crash reproducer bot failure. llvm-svn: 358634
* Split out modules-specific declaration handling from SemaDecl.cpp into aRichard Smith2019-04-183-465/+486
| | | | | | new SemaModule.cpp. llvm-svn: 358633
* Add '#pragma clang __debug module_map module.name' to dump the moduleRichard Smith2019-04-182-1/+19
| | | | | | map being used for the module 'module.name'. llvm-svn: 358632
* [c++2a] Improve diagnostic for use of declaration from another TU'sRichard Smith2019-04-184-22/+156
| | | | | | | | | | global module fragment. We know that the declaration in question should have been introduced by a '#include', so try to figure out which one and suggest it. Don't suggest importing the global module fragment itself! llvm-svn: 358631
* [clang-format] Remove unused Environment constructor.Alexander Kornienko2019-04-181-4/+0
| | | | llvm-svn: 358630
* [lldb] Don't filter variable list when doing a lookup by mangled name in ↵Kuba Mracek2019-04-184-1/+66
| | | | | | | | SymbolFileDWARF::FindGlobalVariables Differential Revision: https://reviews.llvm.org/D60737 llvm-svn: 358629
* Implement sys::fs::copy_file using the macOS copyfile(3) APIAdrian Prantl2019-04-182-0/+53
| | | | | | | | | | | | | | | to support APFS clones. This patch adds a Darwin-specific implementation of llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to support APFS copy-on-write clones, which should be faster and much more space efficient. https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html Differential Revision: https://reviews.llvm.org/D60802 llvm-svn: 358628
* Move the implementation of getInnermostBlockDecl to the .cpp file to fixAkira Hatanaka2019-04-182-11/+13
| | | | | | failing bots. llvm-svn: 358627
* Fix test on PS4 which defaults to gnu99 which does not emit the expected ↵Douglas Yung2019-04-181-3/+15
| | | | | | warnings. llvm-svn: 358626
* [Cmake] Add missing dependency for running tests.Davide Italiano2019-04-171-0/+3
| | | | | | | This is needed now that we marked lldb-test as EXCLUDE_ALL, to make sure `ninja lldb-test-deps` doesn't fail. llvm-svn: 358625
* [Sema][ObjC] Don't warn about an implicitly retained self if theAkira Hatanaka2019-04-177-23/+97
| | | | | | | | | | | | | | | | | retaining block and all of the enclosing blocks are non-escaping. If the block implicitly retaining self doesn't escape, there is no risk of creating retain cycles, so clang shouldn't diagnose it and force users to add self-> to silence the diagnostic. Also, fix a bug where clang was failing to diagnose an implicitly retained self inside a c++ lambda nested inside a block. rdar://problem/25059955 Differential Revision: https://reviews.llvm.org/D60736 llvm-svn: 358624
* Fix formatting. NFCAkira Hatanaka2019-04-171-90/+88
| | | | llvm-svn: 358623
* [x86] try to widen 'shl' as part of LEA formationSanjay Patel2019-04-172-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | The test file has pairs of tests that are logically equivalent: https://rise4fun.com/Alive/2zQ %t4 = and i8 %t1, 8 %t5 = zext i8 %t4 to i16 %sh = shl i16 %t5, 2 %t6 = add i16 %sh, %t0 => %t4 = and i8 %t1, 8 %sh2 = shl i8 %t4, 2 %z5 = zext i8 %sh2 to i16 %t6 = add i16 %z5, %t0 ...so if we can fold the shift op into LEA in the 1st pattern, then we should be able to do the same in the 2nd pattern (unnecessary 'movzbl' is a separate bug I think). We don't want to do this any sooner though because that would conflict with generic transforms that try to narrow the width of the shift. Differential Revision: https://reviews.llvm.org/D60789 llvm-svn: 358622
* [clang-tidy] Don't issue cppcoreguidelines-macro-usage on builtin macrosAlexander Kornienko2019-04-172-2/+3
| | | | | | | | | | | | | | | | | Before the patch calling clang-tidy with -header-filter=.* -system-headers would result in a few hundred useless warnings: warning: macro '_GNU_SOURCE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '_LP64' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_ACQUIRE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_ACQ_REL' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_CONSUME' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_RELAXED' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_RELEASE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_SEQ_CST' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__BIGGEST_ALIGNMENT__' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] ... and so on llvm-svn: 358621
* [clang-tidy] Add a check for [super self] in initializers 🔍Stephane Moore2019-04-178-0/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check aims to address a relatively common benign error where Objective-C subclass initializers call -self on their superclass instead of invoking a superclass initializer, typically -init. The error is typically benign because libobjc recognizes that improper initializer chaining is common¹. One theory for the frequency of this error might be that -init and -self have the same return type which could potentially cause inappropriate autocompletion to -self instead of -init. The equal selector lengths and triviality of common initializer code probably contribute to errors like this slipping through code review undetected. This check aims to flag errors of this form in the interests of correctness and reduce incidence of initialization failing to chain to -[NSObject init]. [1] "In practice, it will be hard to rely on this function. Many classes do not properly chain -init calls." From _objc_rootInit in https://opensource.apple.com/source/objc4/objc4-750.1/runtime/NSObject.mm.auto.html. Test Notes: Verified via `make check-clang-tools`. Subscribers: mgorny, xazax.hun, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59806 llvm-svn: 358620
* Test commit by Denis BakhvalovDenis Bakhvalov2019-04-171-1/+1
| | | | | Change-Id: I4d85123a157d957434902fb14ba50926b2d56212 llvm-svn: 358619
* [AsmPrinter] hoist %a output template to base class for ARM+Aarch64Nick Desaulniers2019-04-173-18/+11
| | | | | | | | | | | | | | | | | | | | | Summary: X86 is quite complicated; so I intend to leave it as is. ARM+Aarch64 do basically the same thing (Aarch64 did not correctly handle immediates, ARM has a test llvm/test/CodeGen/ARM/2009-04-06-AsmModifier.ll that uses %a with an immediate) for a flag that should be target independent anyways. Reviewers: echristo, peter.smith Reviewed By: echristo Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D60841 llvm-svn: 358618
* Add a getSizeInBits() accessor to MachineMemOperand. NFC.Amara Emerson2019-04-175-11/+20
| | | | | | | | Cleans up a bunch of places where we do getSize() * 8. Differential Revision: https://reviews.llvm.org/D60799 llvm-svn: 358617
OpenPOWER on IntegriCloud