summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [Object] Fix the return type of getOffset/getSizeAlexander Shaposhnikov2019-10-171-2/+2
| | | | | | | | | | | | | | Header64.offset/Header64.size are uint64_t, thus we should not truncate them to unit32_t. Moreover, there are a number of places where we sum the offset and the size (e.g. in various checks in MachOUniversal.cpp), the truncation causes issues since the offset/size can perfectly fit into uint32_t, while the sum overflows. Differential revision: https://reviews.llvm.org/D69126 Test plan: make check-all llvm-svn: 375154
* [NFC][InstCombine] Some more preparatory cleanup for ↵Roman Lebedev2019-10-171-4/+4
| | | | | | dropRedundantMaskingOfLeftShiftInput() llvm-svn: 375153
* [PowerPC] Turn on CR-Logical reducer passNemanja Ivanovic2019-10-176-47/+66
| | | | | | | | | | | | | | | | | Quite a while ago, we implemented a pass that will reduce the number of CR-logical operations we emit. It does so by converting a CR-logical operation into a branch. We have kept this off by default because it seemed to cause a significant regression with one benchmark. However, that regression turned out to be due to a completely unrelated reason - AADB introducing a self-copy that is a priority-setting nop and it was just exacerbated by this pass. Now that we understand the reason for the only degradation, we can turn this pass on by default. We have long since fixed the cause for the degradation. Differential revision: https://reviews.llvm.org/D52431 llvm-svn: 375152
* [lldb] Don't emit artificial constructor declarations as global functionsRaphael Isemann2019-10-175-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When we have a artificial constructor DIE, we currently create from that a global function with the name of that class. That ends up causing a bunch of funny errors such as "must use 'struct' tag to refer to type 'Foo' in this scope" when doing `Foo f`. Also causes that constructing a class via `Foo()` actually just calls that global function. The fix is that when we have an artificial method decl, we always treat it as handled even if we don't create a CXXMethodDecl for it (which we never do for artificial methods at the moment). Fixes rdar://55757491 and probably some other radars. Reviewers: aprantl, vsk, shafik Reviewed By: aprantl Subscribers: jingham, shafik, labath, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68130 llvm-svn: 375151
* [Builtins] Provide a mechanism to selectively disable tests based on whether ↵Dan Liew2019-10-17180-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an implementation is provided by a builtin library. Summary: If a platform removes some builtin implementations (e.g. via the Darwin-excludes mechanism) then this can lead to test failures because the test expects an implementation to be available. To solve this lit features are added for each configuration based on which sources are included in the builtin library. The features are of the form `librt_has_<name>` where `<name>` is the name of the source file with the file extension removed. This handles C and assembly sources. With the lit features in place it is possible to make certain tests require them. Example: ``` REQUIRES: librt_has_comparedf2 ``` All top-level tests in `test/builtins/Unit` (i.e. not under `arm`, `ppc`, and `riscv`) have been annotated with the appropriate `REQUIRES: librt_has_*` statement. rdar://problem/55520987 Reviewers: beanz, steven_wu, arphaman, dexonsmith, phosek, thakis Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68064 llvm-svn: 375150
* Reapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, ↵Jordan Rupprecht2019-10-173-46/+113
| | | | | | | | | | | | | | | | | | | | | | | | and allow `]` in more places Reland r375051 (reverted in r375052) after fixing lld tests on Windows in r375126 and r375131. Original description: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway). This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy. This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon. Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap Reviewed By: MaskRay Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66613 llvm-svn: 375149
* NFC: Fix variable only used in asserts by propagating the value.Sterling Augustine2019-10-171-3/+4
| | | | | | | | | | | | | | Summary: This fixes builds with assertions disabled that would otherwise fail with unused variable warnings Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69123 llvm-svn: 375148
* [asan] Update Windows test expectations for LLVM's MS demanglerReid Kleckner2019-10-172-4/+4
| | | | | | | | After r375041 llvm-symbolizer uses it for demangling instead of UnDecorateSymbolName. LLVM puts spaces after commas while Microsoft does not. llvm-svn: 375147
* [Reproducer] Surface error if setting the cwd failsJonas Devlieghere2019-10-171-2/+7
| | | | | | | Make sure that we surface an error if setting the current working directory fails during replay. llvm-svn: 375146
* Disable TestProcessList on windowsWalter Erquinigo2019-10-171-0/+1
| | | | | | | | | | | | | | Summary: `platform process list -v` on windows doesn't show all the process arguments, making this test useless for that platform Reviewers: stella.stamenova Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69114 llvm-svn: 375144
* Revert [lit] Synthesize artificial deadlineReid Kleckner2019-10-171-19/+28
| | | | | | | | | | | | Python on Windows raises this OverflowError: gotit = waiter.acquire(True, timeout) OverflowError: timestamp too large to convert to C _PyTime_t So it seems this API behave the same way on every OS. Also reverts the dependent commit a660dc590a5e8dafa1ba6ed56447ede151d17bd9. llvm-svn: 375143
* [PowerPC] add tests for popcount with zext; NFCSanjay Patel2019-10-171-0/+304
| | | | llvm-svn: 375142
* [IndVars] Split loop predication out of optimizeLoopExits [NFC]Philip Reames2019-10-171-11/+42
| | | | | | In the process of writing D69009, I realized we have two distinct sets of invariants within this single function, and basically no shared logic. The optimize loop exit transforms (including the new one in D69009) only care about *analyzeable* exits. Loop predication, on the other hand, has to reason about *all* exits. At the moment, we have the property (due to the requirement for an exact btc) that all exits are analyzeable, but that will likely change in the future as we add widenable condition support. llvm-svn: 375138
* [codeview] Workaround for PR43479, don't re-emit instr labelsReid Kleckner2019-10-172-4/+93
| | | | | | | | | | | | | | | | | | | | Summary: In the long run we should come up with another mechanism for marking call instructions as heap allocation sites, and remove this workaround. For now, we've had two bug reports about this, so let's apply this workaround. SLH (the other client of instruction labels) probably has the same bug, but the solution there is more likely to be to mark the call instruction as not duplicatable, which doesn't work for debug info. Reviewers: akhuang Subscribers: aprantl, hiraditya, aganea, chandlerc, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69068 llvm-svn: 375137
* Revert [Sanitizers] Add support for RISC-V 64-bitSam Elliott2019-10-176-20/+9
| | | | | | This reverts r375132 (git commit 00bbe990c5d4472d5413479a539b3d6edbb3ca7a) llvm-svn: 375136
* [NFC][InstCombine] Tests for "fold variable mask before variable ↵Roman Lebedev2019-10-1711-0/+2430
| | | | | | | | shift-of-trunc" (PR42563) https://bugs.llvm.org/show_bug.cgi?id=42563 llvm-svn: 375135
* [OPENMP]Improve use of the global tid parameter.Alexey Bataev2019-10-173-18/+21
| | | | | | | | If we can determined, that the global tid parameter can be used in the function, better to use it rather than calling __kmpc_global_thread_num function. llvm-svn: 375134
* [IndVars] Factor out a helper function for readability [NFC]Philip Reames2019-10-171-7/+20
| | | | llvm-svn: 375133
* [Sanitizers] Add support for RISC-V 64-bitSam Elliott2019-10-176-9/+20
| | | | | | | | | | | | | | | | | | | Summary: This has been tested with gcc trunk on openSUSE Tumbleweed on the HiFive Unleashed. Patch by Andreas Schwab (schwab) Reviewers: luismarques Reviewed By: luismarques Subscribers: mhorne, emaste, luismarques, asb, mgorny, fedor.sergeev, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, lenary, s.egerton, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D66870 llvm-svn: 375132
* [lld][test] Speculative fix for lld+windows failuresJordan Rupprecht2019-10-171-2/+2
| | | | | | | | This updates some more places using `%T` to use `%/T` for path normalization. If this does not work, this and r375126 should be reverted together. llvm-svn: 375131
* [lit] Move computation of deadline up into base classJulian Lettner2019-10-171-16/+15
| | | | llvm-svn: 375130
* [lit] Synthesize artificial deadlineJulian Lettner2019-10-171-13/+5
| | | | | | | | We always want to use a deadline when calling `result.await`. Let's synthesize an artificial deadline (positive infinity) to simplify code and do less busy waiting. llvm-svn: 375129
* [lit] Create derived classes for serial/parallel test runsJulian Lettner2019-10-172-43/+51
| | | | | | | The hope is that with a little OO we can nicely factor out the differences. llvm-svn: 375128
* Fix an inverted condition in test.Adrian Prantl2019-10-171-3/+3
| | | | llvm-svn: 375127
* [lld][test] Fix use of escape character in an lld test on WindowsJordan Rupprecht2019-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Glob support was improved to accept `\` as an escape character in r375051, but reverted as r375052 due to a failure in this test on Windows. The reason this failure seems Windows specific is because the path separator `\` is currently being relied on to be interpreted literally instead of as an escape character. Per documentation on linker input section wildcard patterns, this seems to be a bug in lld accepting `\` as a literal instead of an escape character. For example: ``` SECTIONS{ .foo :{ /path/to/foo.o(.foo) }} # OK: standard UNIX path SECTIONS{ .foo :{ C:/path/to/foo.o(.foo) }} # OK: windows accepts slashes in either direction SECTIONS{ .foo :{ C:\\path\\to\\foo.o(.foo) }} # OK: escape character used to match a literal \ SECTIONS{ .foo :{ C:\path\to\foo.o(.foo) }} # BAD: this actually matches the path C:pathtofoo.o(.foo) ``` This avoids the problem in the test by using `%/T` in place of `%T` to normalize the path separator to `/`, which windows should also accept. This patch just fixes the test, and glob support will be be relanded separately. For a sample buildbot error, see: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/11578/steps/stage%201%20check/logs/stdio Reviewers: evgeny777, ruiu, MaskRay, espindola Reviewed By: ruiu, MaskRay Subscribers: emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69074 llvm-svn: 375126
* [ObjC] Diagnose implicit type coercion from ObjC 'Class' to objectJames Y Knight2019-10-177-50/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pointer types. For example, in Objective-C mode, the initialization of 'x' in: ``` @implementation MyType + (void)someClassMethod { MyType *x = self; } @end ``` is correctly diagnosed with an incompatible-pointer-types warning, but in Objective-C++ mode, it is not diagnosed at all -- even though incompatible pointer conversions generally become an error in C++. This patch fixes that oversight, allowing implicit conversions involving Class only to/from unqualified-id, and between qualified and unqualified Class, where the protocols are compatible. Note that this does change some behaviors in Objective-C, as well, as shown by the modified tests. Of particular note is that assignment from from 'Class<MyProtocol>' to 'id<MyProtocol>' now warns. (Despite appearances, those are not compatible types. 'Class<MyProtocol>' is not expected to have instance methods defined by 'MyProtocol', while 'id<MyProtocol>' is.) Differential Revision: https://reviews.llvm.org/D67983 llvm-svn: 375125
* [ObjC] Add some additional test cases around pointer conversions.James Y Knight2019-10-177-31/+286
| | | | | | | | | | | | | This is especially important for Objective-C++, which is entirely missing this testing at the moment. This annotates with "FIXME" the cases which I change in the next patch -- I primarily wanted to document the current state of things so that the effect of the code change is made clear. Differential Revision: https://reviews.llvm.org/D67982 llvm-svn: 375124
* [ARC] Add SystemV ABITatyana Krasnukha2019-10-175-1/+737
| | | | | | Differential Revision: https://reviews.llvm.org/D55724 llvm-svn: 375123
* [ARC] Basic support in gdb-remote process pluginTatyana Krasnukha2019-10-175-1/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D55718 llvm-svn: 375122
* Revert r375114: "[lit] Make internal diff work in pipelines"Joel E. Denny2019-10-179-304/+271
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 375121
* Revert r375116: "[lit] Extend internal diff to support `-` argument"Joel E. Denny2019-10-177-146/+5
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 375120
* [OPENMP]Fix thread id passed to outlined region in sequential parallelAlexey Bataev2019-10-172-15/+13
| | | | | | | | | regions. The real global thread id must be passed to the outlined region instead of the zero thread id. llvm-svn: 375119
* [OpenCL] Preserve addrspace in CGClass (PR43145)Sven van Haastregt2019-10-172-2/+35
| | | | | | | | | | PR43145 revealed two places where Clang was attempting to create a bitcast without considering the address space of class types during C++ class code generation. Differential Revision: https://reviews.llvm.org/D68403 llvm-svn: 375118
* [clangd] Use our own relation kind.Haojian Wu2019-10-1720-117/+69
| | | | | | | | | | | | | | | | Summary: Move the RelationKind from Serialization.h to Relation.h. This patch doesn't introduce any breaking changes. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68981 llvm-svn: 375117
* [lit] Extend internal diff to support `-` argumentJoel E. Denny2019-10-177-5/+146
| | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` doesn't recognize `-` as a command-line option. This patch adds support for `-` to mean stdin. Reviewed By: probinson, rnk Differential Revision: https://reviews.llvm.org/D67643 llvm-svn: 375116
* [lit] Make internal diff work in pipelinesJoel E. Denny2019-10-179-271/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - # RUN: not diff file1 file2 | FileCheck %s ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` cannot currently be used in pipelines and doesn't recognize `-` as a command-line option. To enable pipelines, this patch moves lit's `diff` implementation into an out-of-process script, similar to lit's `cat` implementation. A follow-up patch will implement `-` to mean stdin. Reviewed By: probinson, stella.stamenova Differential Revision: https://reviews.llvm.org/D66574 llvm-svn: 375114
* [AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large modelsXiangling Liao2019-10-177-23/+194
| | | | | | | | | This patch provides support for peudo ops including ADDIStocHA8, ADDIStocHA, LWZtocL, LDtoc, LDtocL for AIX, lowering them from MIR to assembly. Differential Revision: https://reviews.llvm.org/D68341 llvm-svn: 375113
* [OpenCL] Add doc to describe OpenCL supportSven van Haastregt2019-10-172-0/+48
| | | | | | | | | | | The idea of this page is to document work in progress functionality and also describe the plan of future development work. Patch by Anastasia Stulova. Differential Revision: https://reviews.llvm.org/D69072 llvm-svn: 375111
* [mips] [builtins] Remove clear_mips_cacheZoran Jovanovic2019-10-171-50/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D69021 llvm-svn: 375110
* [AMDGPU] Improve code size cost modelDaniil Fukalov2019-10-176-21/+61
| | | | | | | | | | | | | | | | | | | Summary: Added estimation for zero size insertelement, extractelement and llvm.fabs operators. Updated inline/unroll parameters default values. Reviewers: rampitec, arsenm Reviewed By: arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68881 llvm-svn: 375109
* [ARM][MVE] Enable truncating masked storesSam Parker2019-10-174-84/+783
| | | | | | | | | | Allow us to generate truncating masked store which take v4i32 and v8i16 vectors and can store to v4i8, v4i16 and v8i8 and memory. Removed support for unaligned masked stores. Differential Revision: https://reviews.llvm.org/D68461 llvm-svn: 375108
* [docs][llvm-ar] Fix option:: O after r375106Fangrui Song2019-10-171-1/+1
| | | | | | | | docs-llvm-html fails => unknown option: O There are lots of formatting issues in the file but they will be fixed by D68998. llvm-svn: 375107
* [llvm-ar] Implement the O modifier: display member offsets inside the archiveFangrui Song2019-10-175-16/+48
| | | | | | | | | | | | Since GNU ar 2.31, the 't' operation prints member offsets beside file names if the 'O' modifier is specified. 'O' is ignored for thin archives. Reviewed By: gbreynoo, ruiu Differential Revision: https://reviews.llvm.org/D69087 llvm-svn: 375106
* [llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not existFangrui Song2019-10-174-20/+122
| | | | | | | | | | | | | | | | | | Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due to a null pointer dereference. for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) { ... Obj.SymbolTable->addSymbol( Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections, if --add-symbol is specified. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D69093 llvm-svn: 375105
* Include leading attributes in DeclStmt's SourceRangeStephan Bergmann2019-10-172-0/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D68581 llvm-svn: 375104
* JumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> ↵Simon Pilgrim2019-10-171-1/+1
| | | | | | | | null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. llvm-svn: 375103
* clang-tidy - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-172-5/+5
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 375102
* SemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-171-3/+3
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 375101
* [LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop ↵Roman Lebedev2019-10-172-7/+476
| | | | | | | | | | | | | | | (PR43687) We can't normally stumble into that assertion because a tautological *conditional* `br` in loop body is required, one that always branches to loop latch. But that should have been always folded to an unconditional branch before we get it. But that is not guaranteed if the pass is run standalone. So let's just promote the assertion into a proper check. Fixes https://bugs.llvm.org/show_bug.cgi?id=43687 llvm-svn: 375100
* SemaDeclObjC - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-171-3/+3
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 375097
OpenPOWER on IntegriCloud