summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clang-format] [PR35518] C++17 deduction guides are wrongly formattedpaulhoad2019-11-062-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: see https://bugs.llvm.org/show_bug.cgi?id=35518 clang-format removes spaces around deduction guides but not trailing return types, make the consistent ``` template <typename T> S(T)->S<T>; auto f(int, int) -> double; ``` becomes ``` template <typename T> S(T) -> S<T>; auto f(int, int) -> double; ``` Reviewers: klimek, mitchell-stellar, owenpan, sammccall, lichray, curdeius, KyrBoh Reviewed By: curdeius Subscribers: merge_guards_bot, hans, lichray, cfe-commits Tags: #clang-format, #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D69577
* gn build: Merge 24130d661edLLVM GN Syncbot2019-11-061-0/+1
|
* [clang-tidy] Add readability-make-member-function-constMatthias Gehre2019-11-068-0/+708
| | | | | | | | | | | | | | | | | | Summary: Finds non-static member functions that can be made ``const`` because the functions don't use ``this`` in a non-const way. The check conservatively tries to preserve logical costness in favor of physical costness. See readability-make-member-function-const.rst for more details. Reviewers: aaron.ballman, gribozavr, hokein, alexfh Subscribers: mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68074
* YAML parser robustness improvementsThomas Finch2019-11-053-14/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a number of bugs found in the YAML parser through fuzzing. In general, this makes the parser more robust against malformed inputs. The fixes are mostly improved null checking and returning errors in more cases. In some cases, asserts were changed to regular errors, this provides the same robustness but also protects release builds from the triggering conditions. This also improves the fuzzability of the YAML parser since asserts can act as a roadblock to further fuzzing once they're hit. Each fix has a corresponding test case: - TestAnchorMapError - Added proper null pointer handling in `Stream::printError` if N is null and `KeyValueNode::getValue` if getKey returns null, `Input::createHNodes` `dyn_casts` changed to `dyn_cast_or_null` so the null pointer checks are actually able to fail - TestFlowSequenceTokenErrors - Added case in `Document::parseBlockNode` for FlowMappingEnd, FlowSequenceEnd, or FlowEntry tokens outside of mappings or sequences - TestDirectiveMappingNoValue - Changed assert to regular error return in `Scanner::scanValue` - TestUnescapeInfiniteLoop - Fixed infinite loop in `ScalarNode::unescapeDoubleQuoted` by returning an error for unrecognized escape codes - TestScannerUnexpectedCharacter - Changed asserts to regular error returns in `Scanner::consume` - TestUnknownDirective - For both of the inputs the stream doesn't fail and correctly returns TK_Error, but there is no valid root node for the document. There's no reasonable way to make the scanner fail for unknown directives without breaking the YAML spec (see spec-07-01.test). I think the assert is unnecessary given that an error is still generated for this case. The `SimpleKeys.clear()` line fixes a bug found by AddressSanitizer triggered by multiple test cases - when TokenQueue is cleared SimpleKeys is still holding dangling pointers into it, so SimpleKeys should be cleared as well. Patch by Thomas Finch! Reviewers: chandlerc, Bigcheese, hintonda Reviewed By: Bigcheese, hintonda Subscribers: hintonda, kristina, beanz, dexonsmith, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61608
* [ADT] Add equality operator for SmallPtrSetYevgeny Rouban2019-11-062-0/+64
| | | | | Reviewed By: tellenbach Differential Revision: https://reviews.llvm.org/D69429
* [PowerPC] Fix the incorrect 'RM' flag set on load/store instrQingShan Zhang2019-11-062-1/+10
| | | | | | The 'RM' flag model the "Rounding Mode" and it has nothing to do with the load/store instructions. Differential Revision: https://reviews.llvm.org/D69551
* Implement `sys::getHostCPUName()` for Darwin ARMChris Bieneman2019-11-051-1/+28
| | | | | | | | | | | | | | Summary: Currently there is no implementation of `sys::getHostCPUName()` for Darwin ARM targets. This patch makes it so that LLVM running on ARM makes reasonable guesses about the CPU features of the host CPU. Reviewers: t.p.northover, lhames, efriedma Reviewed By: efriedma Subscribers: rjmccall, efriedma, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69597
* Fixed a profdata file size detection on Windows system.Vladimir Vereschaka2019-11-051-1/+1
| | | | | | | | | | | The space symbols are allowed in the group names on Windows system (as example: Domain Users). In that case the test extracts a wrong field from the output to get a size of the profdata file. This patch avoids a printing of the group names in the test output and extracts a proper field as a file size. Differential Revision: https://reviews.llvm.org/D69317
* [IRMover] Set Address Space for moved global valuesTeresa Johnson2019-11-052-4/+17
| | | | | | | | | | | | | | | | | | | Summary: Set Address Space when creating a new function (from another). Fix PR41154. Patch by Ehud Katz <ehudkatz@gmail.com> Reviewers: tejohnson, chandlerc Reviewed By: tejohnson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69361
* [globalisel][docs] Rework GMIR documentation and add an early GenericOpcode ↵Daniel Sanders2019-11-052-22/+38
| | | | | | | | | reference It looks like I pushed an older version of this commit without the review fixups earlier. This applies the review changes Differential Revision: https://reviews.llvm.org/D69545
* [globalisel][docs] Rework GMIR documentation and add an early GenericOpcode ↵Daniel Sanders2019-11-057-76/+803
| | | | | | | | | | | | | | | | | | | | | | | | | | | reference Summary: Rework the GMIR documentation to focus more on the end user than the implementation and tie it in to the MIR document. There was also some out-of-date information which has been removed. The quality of the GenericOpcode reference is highly variable and drops sharply as I worked through them all but we've got to start somewhere :-). It would be great if others could expand on this too as there is an awful lot to get through. Also fix a typo in the definition of G_FLOG. Previously, the comments said we had two base-2's (G_FLOG and G_FLOG2). Reviewers: aemerson, volkan, rovka, arsenm Reviewed By: rovka Subscribers: wdng, arphaman, jfb, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69545
* [Automaton] Make Automaton thread-safeJames Molloy2019-11-051-1/+11
| | | | | | | | | | In an optimization to improve performance (rL375240) we added a std::shared_ptr around the main table map. This is safe, but we also ended up making the transcriber object a std::shared_ptr too. This has mutable state, so must be copied when we copy the Automaton object. This is very cheap; the main optimization was about the map `M` only. Reported by Dan Palermo. No test as triggering this is rather hard from a unit test.
* [globalisel][docs] Add a section about debugging with the block extractorDaniel Sanders2019-11-052-0/+55
| | | | | | | | | | | | Summary: Depends on D69644 Reviewers: rovka, volkan, arsenm Subscribers: wdng, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69645
* [AMDGPU] Add missing flags to DS_RealStanislav Mekhanoshin2019-11-051-0/+2
| | | | Differential Revision: https://reviews.llvm.org/D69867
* [SLP] add tests for 2-wide reductions; NFCSanjay Patel2019-11-051-2/+115
|
* [TestMTCSimple] Disable the test if you don't have libMTCAlex Langford2019-11-051-1/+5
| | | | | | If you are running on macOS and have the CommandLineTools installed of Xcode, this test will fail because CommandLineTools doesn't ship with libMainThreadChecker. Skip the test if you don't have it installed.
* Revert "[analyzer] Add test directory for scan-build."Volodymyr Sapsai2019-11-0510-152/+1
| | | | | | | | This reverts commit 0aba69eb1a01c44185009f50cc633e3c648e9950 with subsequent changes to test files. It caused test failures on GreenDragon, e.g., http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/
* [IRMover] Use GlobalValue::getAddressSpace instead of directly from its type ↵Teresa Johnson2019-11-051-10/+10
| | | | | | | | | | | | | | | | | | [NFC] Summary: Change the old form of G->getType()->getAddressSpace() to the new G->getAddressSpace() (underneath does the same). Patch by Ehud Katz <ehudkatz@gmail.com> Reviewers: tejohnson, chandlerc Reviewed By: tejohnson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69550
* [mips] Fix `getRegForInlineAsmConstraint` to do not crash on empty ConstraintSimon Atanasyan2019-11-062-4/+20
|
* [CMake] Prevent adding lld to test dependency (TEST_DEPS) when lld project ↵Kelvin Li2019-11-051-1/+1
| | | | | | | | | | is not built D69405 causes failure if running LIT when the compiler was built without lld. Patch by Anh Tuyen Tran (anhtuyen) Differential Revision: https://reviews.llvm.org/D69685
* [LoopRotationUtils] Check values are newly inserted into maps.Alina Sbirlea2019-11-051-5/+14
| | | | | This is a cleanup that came up in D63680. All values added to the ValueMaps should be newly added.
* [Hexagon] getCompoundCandidateGroup - fix 'false' value is implicitly cast ↵Simon Pilgrim2019-11-051-5/+5
| | | | | | to unsigned warning. NFCI. Consistently return HexagonII::HCG_None.
* [lldb] Add a install target for lldb python on darwinHaibo Huang2019-11-051-12/+15
| | | | | | | | | | | | Summary: Similar to D68370 but for darwin framework build. Reviewers: aadsm Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69834
* [X86/Atomics] Correct a few transforms for new atomic loweringPhilip Reames2019-11-051-4/+3
| | | | | | This is a partial fix for the issues described in commit message of 027aa27 (the revert of G24609). Unfortunately, I can't provide test coverage for it on it's own as the only (known) wrong example is still wrong, but due to a separate issue. These fixes are cases where when performing unrelated DAG combines, we were dropping the atomicity flags entirely.
* Fix typo so that '-O0' is correctly specifiedBill Wendling2019-11-051-3/+3
|
* [OPENMP50]Simplify processing of context selector scores.Alexey Bataev2019-11-056-79/+32
| | | | | | If the context selector score was not specified, its value must be set to 0. Simplify the processing of unspecified scores + save memory in attribute representation.
* [MIR] Add MIR parsing for heap alloc site instruction markersAmy Huang2019-11-057-5/+131
| | | | | | | | | | | | | | | Summary: This patch adds MIR parsing and printing for heap alloc markers, which were added in D69136. They are printed as an operand similar to pre-/post-instr symbols, with a heap-alloc-marker token and a metadata node. Reviewers: rnk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69864
* [Sema] Fixes templated friend member assertionMark de Wever2019-11-052-1/+13
| | | | | | Fixes PR41792: Clang assertion failure on templated friend member function Differential Revision: https://reviews.llvm.org/D69481
* [ValueObject] Upstream early exit from swift-lldb. (NFC)Adrian Prantl2019-11-051-0/+4
|
* [ValueObject] Upstream initialization from swift-lldb.Adrian Prantl2019-11-051-0/+10
| | | | | | | This is a non-Swift-specific change in swift-lldb that seems to be useful for remote debugging. If does in fact turn out to be redundant we can remove it from llvm.org and then it will disappear in swift-lldb, too.
* [Reproducer] Add test case for expression evaluationJonas Devlieghere2019-11-052-0/+28
|
* [X86] Gate select->fmin/fmax transform on NoSignedZeros instead of UnsafeFPMathBenjamin Kramer2019-11-052-9/+8
|
* TestBatchMode.py: add missing @skipIfRemoteFred Riss2019-11-051-0/+1
| | | | | All the tests in this file were already marked as skipped for remote tests except for this one.
* testsuite: skipIfNoSBHeaders should skip when running remotelyFred Riss2019-11-051-0/+3
| | | | | The LLDB dylib/framework will not be available on the remote host, it makes no sense to try to run those tests in a remote scenario.
* Modernize add-dsym test MakefileFred Riss2019-11-051-17/+7
|
* Revert "[lit] Better/earlier errors when no tests are executed"Julian Lettner2019-11-054-29/+9
| | | | This reverts commit d8f2bff75126c6dde694ad245f9807fa12ad5630.
* [AMDGPU] Removed dead code from R600ISelLowering.cppStanislav Mekhanoshin2019-11-051-6/+1
| | | | | | | | | This was added to inhibit a warning from gcc 7.3 according to the comment. However, it triggers warning from PVS. In addition I cannot reproduce it with gcc 7.4 and I also cannot reproduce it with gcc 7.3 using compiler explorer. Differential Revision: https://reviews.llvm.org/D69863
* [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic ↵Philip Reames2019-11-054-47/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | example When writing an email for a follow up proposal, I realized one of the diffs in the committed change was incorrect. Digging into it revealed that the fix is complicated enough to require some thought, so reverting in the meantime. The problem is visible in this diff (from the revert): ; X64-SSE-LABEL: store_fp128: ; X64-SSE: # %bb.0: -; X64-SSE-NEXT: movaps %xmm0, (%rdi) +; X64-SSE-NEXT: subq $24, %rsp +; X64-SSE-NEXT: .cfi_def_cfa_offset 32 +; X64-SSE-NEXT: movaps %xmm0, (%rsp) +; X64-SSE-NEXT: movq (%rsp), %rsi +; X64-SSE-NEXT: movq {{[0-9]+}}(%rsp), %rdx +; X64-SSE-NEXT: callq __sync_lock_test_and_set_16 +; X64-SSE-NEXT: addq $24, %rsp +; X64-SSE-NEXT: .cfi_def_cfa_offset 8 ; X64-SSE-NEXT: retq store atomic fp128 %v, fp128* %fptr unordered, align 16 ret void The problem here is three fold: 1) x86-64 doesn't guarantee atomicity of anything larger than 8 bytes. Some platforms observably break this guarantee, others don't, but the codegen isn't considering this, so it's wrong on at least some platforms. 2) When I started to track down the problem, I discovered that DAGCombiner had stripped the atomicity off the store entirely. This comes down to idiomatic usage of DAG.getStore passing all MMO components separately as opposed to just passing the MMO. 3) On x86 (not -64), there are cases where 8 byte atomiciy is supported, but only for floating point operations. This would seem to imply that operation typing matters for correctness, and DAGCombine happily folds away bitcasts. I'm not 100% sure there's a problem here, but I'm not entirely sure there isn't either. I plan on returning to each issue in turn; sorry for the churn here.
* [HIP] Fix visibility for 'extern' device variables.Michael Liao2019-11-052-3/+13
| | | | | | | | | | | | | | Summary: - Fix a bug which misses the change for a variable to be set with target-specific attributes. Reviewers: yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63020
* [llvm-objdump] Fix spurious "The end of the file was unexpectedly ↵Sid Manning2019-11-052-0/+39
| | | | | | | | | | | | | | | | | | | | | encountered" if a SHT_NOBITS sh_offset is larger than the file size llvm-objdump -D this file: int a[100000]; int main() { return 0; } Will produce an error: "The end of the file was unexpectedly encountered". This happens because of a check in Binary.h checkOffset. (Addr + Size > M.getBufferEnd()). The sh_offset and sh_size fields can be ignored for SHT_NOBITS sections. Fix the error by changing ELFObjectFile<ELFT>::getSectionContents to use the file base for SHT_NOBITS sections. Reviewed By: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69192
* [lit] Fix `not` calling internal commandsJoel E. Denny2019-11-0521-33/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, when using lit's internal shell, if `not` on a lit RUN line calls `env`, `diff`, or any of the other in-process shell builtins that lit implements, lit accidentally searches for the latter as an external executable. What's worse is that works fine when a developer is testing on a platform where those executables are available and behave as expected, but it then breaks on other platforms. `not` seems useful for some builtins, such as `diff`, so this patch supports such uses. `not --crash` does not seem useful for builtins, so this patch diagnoses such uses. In all cases, this patch ensures shell builtins are found behind any sequence of `env` and `not` commands. `not` calling `env` calling an external command appears useful when the `env` and external command are part of a lit substitution, as in D65156. This patch supports that by looking through any sequence of `env` and `not` commands, building the environment from the `env`s, and storing the `not`s. The `not`s are then added back to the command line without the `env`s to execute externally. This avoids the need to replicate the `not` implementation, in particular the `--crash` option, in lit. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D66531
* [AMDGPU] Removed dead code handling M0CopyRegStanislav Mekhanoshin2019-11-051-14/+0
| | | | | | | Static analyzer complains about always false condition. See https://bugs.llvm.org/show_bug.cgi?id=43886 Differential Revision: https://reviews.llvm.org/D69860
* ValueObject: Upstream early-exit from swift-lldb. (NFC)Adrian Prantl2019-11-051-3/+8
|
* [dexter] Fix feature tests on WindowsReid Kleckner2019-11-053-2/+9
| | | | | | | | | | | | | | | | | | | | | First, add LLD as a dependency on Windows. The windows batch scripts pass -fuse-ld=lld, so they need it. Second, decode builder stdout/stderr even if the command fails. Otherwise it gets printed as b'line 1\n\rline 2\n\r'. Last, make the batch script one line less noisy. We might want to try to do more here, though. It would be nice if we could get as close to possible as lit, where you can literally copy & paste the failing command to re-run it. With the two changes above, now the feature tests that use clang++.bat pass for me. The clang-cl_vs2015 ones still fail, and I'll fix them separately. Reviewers: jmorse Differential Revision: https://reviews.llvm.org/D69725
* [dexter] Remove lit check for python 3Reid Kleckner2019-11-051-6/+0
| | | | | | | | | | | | | | | This is checking the version of Python used to run lit, which is not necessarily the same as the version used to run the dexter tests. If the tests are run via the build/bin/llvm-lit[.py] helper script, then that is likely to pick up whatever version of Python is on PATH. Conventionally, this will find Python 2. CMake already checks that Python 3 is in use and puts the path to it in the lit site config, so this check is redundant, and Python 3 will ultimately be used to run dexter. Reviewers: jmorse Differential Revision: https://reviews.llvm.org/D69724
* [X86] Specifically limit fmin/fmax commutativity to NoNaNs + NoSignedZerosBenjamin Kramer2019-11-055-13/+17
| | | | | The backend UnsafeFPMath flag is not a superset of all the others, so limit it to the exact bits needed.
* [globalisel] Rename G_GEP to G_PTR_ADDDaniel Sanders2019-11-05125-7222/+7224
| | | | | | | | | | | | | | | | Summary: G_GEP is rather poorly named. It's a simple pointer+scalar addition and doesn't support any of the complexities of getelementptr. I therefore propose that we rename it. There's a G_PTR_MASK so let's follow that convention and go with G_PTR_ADD Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69734
* [AMDGPU] return Fail instead of SolfFail from addOperand()Stanislav Mekhanoshin2019-11-052-1/+5
| | | | | | | | | | | | | | | | | | | | addOperand() method of AMDGPU disassembler returns SoftFail on error. All instances which may lead to that place are an impossible encdoing, not something which is possible to encode, but semantically incorrect as described for SoftFail. Then tablegen generates a check of the following form: if (Decode...(..) == MCDisassembler::Fail) { return MCDisassembler::Fail; } Since we can only return Success and SoftFail that is dead code as detected by the static code analyzer. Solution: return Fail as it should be. See https://bugs.llvm.org/show_bug.cgi?id=43886 Differential Revision: https://reviews.llvm.org/D69819
* [clangd] Implement semantic highlightings via findExplicitReferencesIlya Biryukov2019-11-054-151/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To keep the logic of finding locations of interesting AST nodes in one place. The advantage is better coverage of various AST nodes, both now and in the future: as new nodes get added to `findExplicitReferences`, semantic highlighting will automatically pick them up. The drawback of this change is that we have to traverse declarations inside our file twice in order to highlight dependent names, 'auto' and 'decltype'. Hopefully, this should not affect the actual latency too much, most time should be spent in building the AST and not traversing it. Reviewers: hokein Reviewed By: hokein Subscribers: nridge, merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69673
* [lldb] Fix Python 3 incompatibility in API/lit.cfg.pyJonas Devlieghere2019-11-051-3/+4
| | | | | This code path is only taken on the sanitized bot, where it caused a TypeError: "Can't mix strings and bytes in path components".
OpenPOWER on IntegriCloud