Commit Graph

316819 Commits

Author SHA1 Message Date
Fangrui Song c2aded5017 [clangd] Respect clang-tidy suppression comments
This partially fixes https://bugs.llvm.org/show_bug.cgi?id=41218.

Reviewed By: sammccall

Patch by Nathan Ridge!

Differential Revision: https://reviews.llvm.org/D60953

llvm-svn: 361112
2019-05-19 04:06:52 +00:00
Petr Hosek cd78209a35 Use CMAKE_C_COMPILER_ARG1 in compiler invocation
This is needed when using compiler wrappers such as ccache or distcc
and should address the failure on clang-x86_64-debian-fast bot.

Differential Revision: https://reviews.llvm.org/D62104

llvm-svn: 361111
2019-05-19 03:29:15 +00:00
Dinar Temirbulatov 2ff72f6654 [SLP] Refactoring of EdgeInfo and UserTreeIdx in buildTree_rec().
This is a follow-up refactoring patch after the introduction of usable TreeEntry pointers in D61706.
The EdgeInfo struct can now use a TreeEntry pointer instead of an index in VectorizableTree.

Committed on behalf of @vporpo (Vasileios Porpodas)

Differential Revision: https://reviews.llvm.org/D61795

llvm-svn: 361110
2019-05-19 01:30:41 +00:00
Craig Topper 3d7ecc4618 [X86] Remove semicolons at the end of intrinsics implemented as macros so they can be used as arguments to other intrinsics.
Also fix one intrinsic that was using variable names without underscores.

Fixes PR41932

llvm-svn: 361109
2019-05-19 01:01:52 +00:00
Craig Topper 3164b50af7 [X86] Remove combineShift function. Just dispatch directly to the handler for each flavor from the main switch. NFC
llvm-svn: 361108
2019-05-19 01:01:46 +00:00
Don Hinton 4b105f5308 [CommandLine] Reduce size of Option class
Summary:
Reduce size of Option class from 184 bytes to 136 bytes by
placing more member variables in Bit Field (16 bytes), and
reducing the initial sizes of Categories and Subs to 1 (32 bytes).

Saves about 48k for bin/opt.

Reviewed By: beanz

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62091

llvm-svn: 361107
2019-05-18 20:46:35 +00:00
Roman Lebedev 1a5d623ded [NFC][AArch64] Autogenerate fcopysign.ll test
llvm-svn: 361106
2019-05-18 20:24:40 +00:00
Roman Lebedev 13ac317e4c [NFC][AArch64] Autogenerate bitfield-insert.ll, selectcc-to-shiftand.ll tests
Investigating bit-extract (ubfx) pattern with shifted mask.

llvm-svn: 361105
2019-05-18 17:42:06 +00:00
Dylan McKay e638a89166 [AVR] Fix 'symbol_relocations.s' MC test
This was broken in r360143, when the 'rela.' prefix was stripped from
section names.

llvm-svn: 361104
2019-05-18 16:38:48 +00:00
Matt Arsenault b04f3258dd GVN: Handle addrspacecast
llvm-svn: 361103
2019-05-18 14:36:06 +00:00
Roman Lebedev d1be3c446e [NFC][AArch64] Add some ubfx tests with immediates
Shows the regression in D62100

llvm-svn: 361102
2019-05-18 13:49:44 +00:00
Roman Lebedev 98092f37d0 UpdateTestChecks: fix AMDGPU handling
Summary:
Was looking into supporting `(srl (shl x, c1), c2)` with c1 != c2 in dagcombiner,
this test changes, but makes `update_llc_test_checks.py` unhappy.

**Many** AMDGPU tests specify `-march`, not `-mtriple`, which results in `update_llc_test_checks.py`
defaulting to x86 asm function detection heuristics, which don't work here.
I propose to fix this by adding an infrastructure to map from `-march` to `-mtriple`,
in the UpdateTestChecks tooling.

Reviewers: RKSimon, MaskRay, arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62099

llvm-svn: 361101
2019-05-18 13:00:03 +00:00
Roman Lebedev 822b9c971b UpdateTestChecks: arm64-eabi handlind
Summary:
Was looking into supporting `(srl (shl x, c1), c2)` with c1 != c2 in dagcombiner,
this test changes, but makes `update_llc_test_checks.py` unhappy

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62097

llvm-svn: 361100
2019-05-18 12:59:56 +00:00
Kristof Umann f40c18b628 [analyzer] PR41753: Include complex integer types in NonLoc::isCompoundType
https://bugs.llvm.org/show_bug.cgi?id=41753

Differential Revision: https://reviews.llvm.org/D61570

llvm-svn: 361099
2019-05-18 12:34:08 +00:00
Simon Pilgrim 30aa42e145 ScalarExprEmitter::EmitCompoundAssign - fix uninitialized variable warning. NFCI.
llvm-svn: 361098
2019-05-18 12:17:15 +00:00
Simon Pilgrim 3e95568dcf MIGChecker - assert we have a non-null LocationContext. NFCI.
Fixes scan-build warning.

llvm-svn: 361097
2019-05-18 11:42:19 +00:00
Simon Pilgrim 4c146ab8c4 ASTNodeImporter - fix uninitialized variable warnings. NFCI.
llvm-svn: 361096
2019-05-18 11:33:27 +00:00
Simon Pilgrim 2b45a70fd6 MemCmpExpansion::getCompareLoadPairs - assert we find a comparison diff. NFCI.
Fix scan-build uninitialized warning and assert the final diff isn't null.

llvm-svn: 361095
2019-05-18 11:31:48 +00:00
Michael Liao 63621832da Suppress false-positive GCC -Wreturn-type warning.
llvm-svn: 361094
2019-05-18 06:35:47 +00:00
Martin Storsjo 5fab538e2a [MinGW] Set the right updated option help for the updated pdb option. NFC
I forgot to amend this change before committing it in SVN r361014, this
is what was agreed upon in the review.

llvm-svn: 361093
2019-05-18 04:20:31 +00:00
Lang Hames 82c3f3dae0 [docs] Fix some RST errors.
llvm-svn: 361092
2019-05-18 03:23:18 +00:00
Michael Trent 07c96ebd94 Update llvm-nm -s to use a multi-var option
Summary:
Previously llvm-nm relied on a positional parameter to read two values
into the SegSect list. This worked, but required the "-s" paramater and
its arguments to be the last elements on the command-line. 

The CommandLine library now supports mutli-var parameters, so it can
naturally deal with "-s" expecting two arguments, and now the input file
can appear anywhere (within reason) in the command line invocation. E.g.

    llvm-nm -s __TEXT __text /bin/ls
    llvm-nm /bin/ls -s __TEXT __text

rdar://27284011

Reviewers: lhames, pete

Reviewed By: pete

Subscribers: rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62070

llvm-svn: 361091
2019-05-18 03:17:27 +00:00
Fangrui Song ed2ad77ccb [ARM][AArch64] Revert Android Bionic PT_TLS overaligning hack
This reverts D53906.

D53906 increased p_align of PT_TLS on ARM/AArch64 to 32/64 to make the
static TLS layout compatible with Android Bionic's ELF TLS. However,
this may cause glibc ARM/AArch64 programs to crash (see PR41527).

The faulty PT_TLS in the executable satisfies p_vaddr%p_align != 0. The
remainder is normally 0 but may be non-zero with the hack in place. The
problem is that we increase PT_TLS's p_align after OutputSections'
addresses are fixed (assignAddress()). It is possible that
p_vaddr%old_p_align = 0 while p_vaddr%new_p_align != 0.

For a thread local variable defined in the executable, lld computed TLS
offset (local exec) is different from glibc computed TLS offset from
another module (initial exec/generic dynamic). Note: PR41527 said the
bug affects initial exec but actually generic dynamic is affected as
well.

(glibc is correct in that it compute offsets that satisfy
`offset%p_align == p_vaddr%p_align`, which is a basic ELF requirement.
This hack appears to work on FreeBSD rtld, musl<=1.1.22, and Bionic, but
that is just because they (and lld) incorrectly compute offsets that
satisfy `offset%p_align = 0` instead.)

Android developers are fine to revert this patch, carry this patch in
their tree before figuring out a long-term solution (e.g. a dummy .tdata
with sh_addralign=64 sh_size={0,1} in crtbegin*.o files. The overhead is
now insignificant after D62059).

Reviewed By: rprichard, srhines

Differential Revision: https://reviews.llvm.org/D62055

llvm-svn: 361090
2019-05-18 03:16:00 +00:00
Lang Hames 5f36a28556 [docs][ORC] Start work on an ORC design doc. Very much a work in progress.
This initial version describes some of the high level design goals and basic
symbol lookup rules.

llvm-svn: 361089
2019-05-18 03:08:49 +00:00
Fangrui Song 898896836d [ELF][X86] Fix R_RELAX_TLS_GD_TO_LE_NEG and R_NEG_TLS after D62059
After D62059, we don't align p_memsz of PT_TLS to p_align. The
getRelocTargetVA formula should align it instead.

It becomes clear that R_NEG_TLS and R_TLS are opposite from each other.

In i386-tls-le-align.s, I put ret after call ___tls_get_addr@plt as
otherwise ld.bfd would reject the relaxation:
TLS transition from R_386_TLS_GD to R_386_TLS_LE_32 against `a' at 0x3 in section `.text' failed

llvm-svn: 361088
2019-05-18 01:58:40 +00:00
Davide Italiano 8803124d23 [crashlog] Use loads() instead of readPlistFromString() for python 3.
<rdar://problem/50903413>

llvm-svn: 361087
2019-05-18 01:57:12 +00:00
Alex Langford 38cc896f00 Revert "Fix IPv6 support on lldb-server platform"
This reverts commit c28f81797084b8416ff5be4f9e79000a9741ca6a.
This reverts commit 7e79b64642486f510f7872174eb831df68d65b84.

Looks like there is more work to be done on this patch. I've spoken to
the author and for the time being we will revert to keep the buildbots
green.

llvm-svn: 361086
2019-05-18 01:09:44 +00:00
Fangrui Song db5cb0fce7 [ELF] Add {i386,x86-64}-tls-le-align.s to test TP offsets for TLS Variant 2
I forgot to add them in rLLD361084. I made another mistake, rLLD361084 fixed Variant 2, not Variant 1.

llvm-svn: 361085
2019-05-18 00:57:30 +00:00
Fangrui Song 348731aeed [ELF] Fix TP offset of TLS Variant I after D62059
As Ryan Prichard pointed out, after D62059, the TP offset is incorrect.

Add x86-64-tls-le-align.s to check this.  Better formulae for both
variants should take p_vaddr%p_align into account (offset%p_align =
p_vaddr%p_align is a basic ELF requirement), but I can't find a way to
test the behavior.

llvm-svn: 361084
2019-05-18 00:43:10 +00:00
Alex Langford f9399de525 Unbreak windows build bot
Commit c28f81797084b8416ff5be4f9e79000a9741ca6a (svn r361079)
broke the windows buildbot. This should fix it.

llvm-svn: 361083
2019-05-18 00:09:43 +00:00
Matt Arsenault 2f29220d6d AMDGPU/GlobalISel: Implement s64->s64 [SU]ITOFP
llvm-svn: 361082
2019-05-17 23:05:18 +00:00
Matt Arsenault 02b5ca8cd1 GlobalISel: Implement lower for S64->S32 [SU]ITOFP
This is ported from the custom AMDGPU DAG implementation. I think this
is a better default expansion than what the DAG currently uses, at
least if the target has CTLZ.

This implements the signed version in terms of the unsigned
conversion, which is implemented with bit operations. SelectionDAG has
several other implementations that should eventually be ported
depending on what instructions are legal.

llvm-svn: 361081
2019-05-17 23:05:13 +00:00
Jonas Devlieghere 2fc6b024b9 [CommandInterpreter] Refactor SourceInitFile
I was looking at the current implementation of SourceInitFile and there
were a few things that made this function hard to read:

 * The code to find the ~/.lldbinit file is duplicated across the cwd
   and non-cwd branch.
 * The ./.lldbinit is once computed by resolving .lldbinit and once by
   resolving ./.lldbinit.
 * It wasn't clear to me what happened when you're sourcing the
   .lldbinit file in the current working directory. Apparently we do
   nothing when we property to control that is set to warn (makes sense)
   and we don't care when the property is set to true (debatable).
 * There were at least two branches where the status of the
   CommandReturnObject were not set.

This patch attempts to simplify that code.

Differential revision: https://reviews.llvm.org/D61994

llvm-svn: 361080
2019-05-17 22:53:04 +00:00
Alex Langford d84d02e197 Fix IPv6 support on lldb-server platform
This is a general fix for the ConnectionFileDescriptor class but my main
motivation was to make lldb-server working with IPv6.
The connect URI can use square brackets ([]) to wrap the interface part
of the URI (e.g.: <scheme>://[<interface>]:<port>). For IPv6 addresses
this is a must since its ip can include colons and it will overlap with
the port colon otherwise. The URIParser class parses the square brackets
correctly but the ConnectionFileDescriptor doesn't generate them for
IPv6 addresses making it impossible to connect to the gdb server when
using this protocol.

How to reproduce the issue:

$ lldb-server p --server --listen [::1]:8080
...
$ lldb
(lldb) platform select remote-macosx
(lldb) platform connect connect://[::1]:8080
(lldb) platform process -p <pid>
error: unable to launch a GDB server on 'computer'

The server was actually launched we were just not able to connect to it.
With this fix lldb will correctly connect. I fixed this by wrapping the
ip portion with [].

Differential Revision: https://reviews.llvm.org/D61833

Patch by António Afonso <antonio.afonso@gmail.com>

llvm-svn: 361079
2019-05-17 22:30:53 +00:00
Davide Italiano 53f68c5764 [EditLine] Check string pointers before dereferencing them.
Get*AtIndex() can return nullptr. This only happens in the swift
REPL support, so it's hard to test upstream.

<rdar://problem/50875178>

llvm-svn: 361078
2019-05-17 21:49:17 +00:00
Vitaly Buka a9c7b2583f [sanitizer] Update symbolizer/scripts/global_symbols.txt
llvm-svn: 361077
2019-05-17 21:37:34 +00:00
Cameron McInally 12de5425c1 [NFC][InstSimplify] Add more unary fneg tests to floating-point-arithmetic.ll
llvm-svn: 361076
2019-05-17 21:10:11 +00:00
Eric Fiselier 236317d216 Fix missing std:: qualifier in __gnu_cxx::hash_map in C++03
llvm-svn: 361075
2019-05-17 20:59:57 +00:00
Eric Fiselier 549ddae58f Remove `using namespace std;` in __gnu_cxx namespace.
The `using namespace std;` opens us up to ambiguity
when any of the std:: names are also present in the global namespace.
Instead we should properly qualify names we use from std::.

llvm-svn: 361074
2019-05-17 20:46:00 +00:00
Mitch Phillips 182c638fe0 Explicitly remove -stdlib=libc++, as we pass -nostdinc++ anyway. This should fix the android builtbots, and is a direct copy from what Scudo does.
llvm-svn: 361073
2019-05-17 20:34:37 +00:00
Saleem Abdulrasool dc1c41fb6f build: use clang-cl for runtimes when targeting Windows
When targeting Windows and building a runtime (subproject) prefer to use
`clang-cl` rather than the `clang` driver.  This allows us to cross-compile
runtimes for the Windows environment from Linux.

llvm-svn: 361072
2019-05-17 20:09:06 +00:00
Sam Clegg 13717bd54b [WebAssembly] Remove expected failure of builtin-location.C test
This seems to have been fixed by https://reviews.llvm.org/D61956

Yay

Differential Revision: https://reviews.llvm.org/D62075

llvm-svn: 361071
2019-05-17 19:55:17 +00:00
Matt Morehouse 2fd318e543 [libFuzzer] Dump input on failure for sigusr tests.
Should help with debugging failures on the bots.

llvm-svn: 361070
2019-05-17 19:33:31 +00:00
Stefan Granitz fd0779181f [CMake] Add first CMake cache files
Summary:
CMake cache scripts pre-populate the CMakeCache in a build directory with commonly used settings.
The CMake invocation from D61952 could look like this:

```
cmake -G Ninja -C /path/to/llvm-project/lldb/cmake/caches/Apple-lldb-osx.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" ../llvm-project/llvm
```

Options specified on the command line will override options in the cache files (as long as caches don't use `FORCE`).
What do you think? (This is a first proposal and not set in stone.)

Reviewers: xiaobai, compnerd, JDevlieghere, aprantl, labath

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D61956

llvm-svn: 361069
2019-05-17 19:19:41 +00:00
Stefan Granitz dcc477e38c [CMake] Inline info plist in lldb driver
llvm-svn: 361068
2019-05-17 19:19:34 +00:00
Richard Smith a933030f84 [c++20] P1327R1: Support for typeid applied to objects of polymorphic
class type in constant evaluation.

This reinstates r360977, reverted in r360987, now that its rerequisite
patch is reinstated and fixed.

llvm-svn: 361067
2019-05-17 19:19:28 +00:00
Gheorghe-Teodor Bercea 144291e14c [OpenMP][bugfix] Add missing math functions variants for log and abs.
Summary: When including the random header in C++, some of the math functions it relies on are not present in the CUDA headers. We include this variants in this case.

Reviewers: jdoerfert, hfinkel, tra, caomhin

Reviewed By: tra

Subscribers: efriedma, guansong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62046

llvm-svn: 361066
2019-05-17 19:15:53 +00:00
Aaron Ballman bbfd8d1885 Add more tests for AST JSON output; NFC.
This adds tests for dumping records and statements.

llvm-svn: 361065
2019-05-17 19:14:01 +00:00
Stella Stamenova 5bac706343 [CommandInterpreter] Fix trailing blanks after `all` or [0-9]+ for bt
The change that was committed for this used \\s to match spaces which does not work correctly on all platforms. Using [:space:] makes the test pass on both Linux and Windows

llvm-svn: 361064
2019-05-17 18:52:42 +00:00
Evgeniy Stepanov bf161e6783 [hwasan] Limit try-catch tests to aarch64.
HWASan C++ tests do not do well on x86_64.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41923

llvm-svn: 361063
2019-05-17 18:40:06 +00:00