platform/upstream/llvm.git
4 years ago[CMake] Clang: Don't use object libraries with Xcode
Jordan Rose [Fri, 4 Oct 2019 18:17:58 +0000 (18:17 +0000)]
[CMake] Clang: Don't use object libraries with Xcode

Undoes some of the effects of r360946 when using the Xcode CMake
generator---it doesn't handle object libraries correctly at all.
Attempts to still honor BUILD_SHARED_LIBS for Xcode, but I didn't
actually test it. Should have no effect on non-Xcode generators.

https://reviews.llvm.org/D68430

llvm-svn: 373769

4 years agoComponentize lldb/scripts to use with LLVM_DISTRIBUTION_COMPONENTS
Antonio Afonso [Fri, 4 Oct 2019 18:10:42 +0000 (18:10 +0000)]
Componentize lldb/scripts to use with LLVM_DISTRIBUTION_COMPONENTS

Summary:
I'd like to install lldb using the install-distribution target with LLVM_DISTRIBUTION_COMPONENTS but this is currently not possible as the lldb/scripts do not provide any component we can use and install the python scripts.
For this effect I created an lldb-python-scripts target and added the install-lldb-python-scripts llvm install target.

I tested with:
cmake ... -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_DISTRIBUTION_COMPONENTS="lldb;liblldb;lldb-python-scripts" ...
DESTDIR=... ninja install-distribution

Then checked with bin/lldb -x -o 'script import lldb'

Reviewers: labath, xiaobai, clayborg, lanza

Subscribers: mgorny, lldb-commits, smeenai, wallace

Tags: #lldb

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

llvm-svn: 373768

4 years ago[libc++] Move more CMake flags to per-target definitions
Louis Dionne [Fri, 4 Oct 2019 18:03:17 +0000 (18:03 +0000)]
[libc++] Move more CMake flags to per-target definitions

This daily refactoring tackles flags related to modules,
exceptions and RTTI.

llvm-svn: 373767

4 years ago[X86] Remove isel patterns for mask vpcmpgt/vpcmpeq. Switch vpcmp to these based...
Craig Topper [Fri, 4 Oct 2019 18:02:46 +0000 (18:02 +0000)]
[X86] Remove isel patterns for mask vpcmpgt/vpcmpeq. Switch vpcmp to these based on the immediate in MCInstLower

The immediate form of VPCMP can represent these completely. The
vpcmpgt/eq are just shorter encodings.

This patch removes the isel patterns and just swaps the opcodes
and removes the immediate in MCInstLower. This matches where we do
some other encodings tricks.

Removes over 10K bytes from the isel table.

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

llvm-svn: 373766

4 years ago[X86] Add DAG combine to form saturating VTRUNCUS/VTRUNCS from VTRUNC
Craig Topper [Fri, 4 Oct 2019 17:53:18 +0000 (17:53 +0000)]
[X86] Add DAG combine to form saturating VTRUNCUS/VTRUNCS from VTRUNC

We already do this for ISD::TRUNCATE, but we can do the same for X86ISD::VTRUNC

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

llvm-svn: 373765

4 years agoAdd few docs and implementation of strcpy and strcat.
Siva Chandra [Fri, 4 Oct 2019 17:30:54 +0000 (17:30 +0000)]
Add few docs and implementation of strcpy and strcat.

Summary:
This patch illustrates some of the features like modularity we want
in the new libc. Few other ideas like different kinds of testing, redirectors
etc are not yet present.

Reviewers: dlj, hfinkel, theraven, jfb, alexshap, jdoerfert

Subscribers: mgorny, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 373764

4 years ago[Automaton] Fix invalid iterator reference
James Molloy [Fri, 4 Oct 2019 17:15:30 +0000 (17:15 +0000)]
[Automaton] Fix invalid iterator reference

Found by the expensive checks bot.

llvm-svn: 373763

4 years ago[ModuloSchedule] Do not remap terminators
James Molloy [Fri, 4 Oct 2019 17:15:25 +0000 (17:15 +0000)]
[ModuloSchedule] Do not remap terminators

This is a trivial point fix. Terminator instructions aren't scheduled, so
we shouldn't expect to be able to remap them.

This doesn't affect Hexagon and PPC because their terminators are always
hardware loop backbranches that have no register operands.

llvm-svn: 373762

4 years ago[FPEnv] Strict FP tests should use the requisite function attributes.
Kevin P. Neal [Fri, 4 Oct 2019 17:03:46 +0000 (17:03 +0000)]
[FPEnv] Strict FP tests should use the requisite function attributes.

A set of function attributes is required in any function that uses constrained
floating point intrinsics. None of our tests use these attributes.

This patch fixes this.

These tests have been tested against the IR verifier changes in D68233.

Reviewed by: andrew.w.kaylor, cameron.mcinally, uweigand
Approved by: andrew.w.kaylor
Differential Revision: https://reviews.llvm.org/D67925

llvm-svn: 373761

4 years ago[process info] Remove assert in DoGetGroupName
Walter Erquinigo [Fri, 4 Oct 2019 16:56:23 +0000 (16:56 +0000)]
[process info] Remove assert in DoGetGroupName

Summary:
Disabling this assert prevents lldb-server from crashing, which prevents it from finding the user and group names of a given process list.

Before this change, the process list didn't contain names:

```
PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
27585  982    10098      10098      10098      10098                                     com.LogiaGroup.LogiaDeck
27623  982    10098      10098      10098      10098                                     com.digitalturbine.ignite.suspend.DataUsageRecorderService
28024  982    10199      10199      10199      10199                                     com.google.vr.vrcore
28061  983    10353      10353      10353      10353                                     com.instagram.android:videoplayer
28121  982    10045      10045      10045      10045                                     com.sec.spp.push
28325  982    10247      10247      10247      10247                                     com.facebook.orca
28714  982    10367      10367      10367      10367                                     com.samsung.android.dialer
29867  3208   2000       2000       2000       2000       aarch64-unknown-linux-android  /system/bin/sh-c /data/local/tmp/lldb-server platform --listen *:5557 --server --log-file /data/local/tmp/logs --log-channels gdb-remote all --log-channels lldb all
```

After this change, the list looks much better

```
PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
24459  1      wifi       1010       wifi       1010       aarch64-unknown-linux-android  /vendor/bin/hw/wpa_supplicant-O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -g@android:wpa_wlan0
25098  982    u0_a42     10042      u0_a42     10042                                     com.samsung.android.messaging
25442  982    u0_a65     10065      u0_a65     10065                                     com.samsung.android.mobileservice
25974  982    u0_a9      10009      u0_a9      10009                                     com.samsung.android.contacts
26377  982    radio      1001       radio      1001                                      com.samsung.android.incallui
26390  983    u0_a26     10026      u0_a26     10026                                     com.samsung.android.game.gametools
26876  983    u0_a306    10306      u0_a306    10306                                     com.tencent.mm:push
```

Reviewers: clayborg,aadsm,xiaobai,labath

Subscribers:

llvm-svn: 373760

4 years ago[utils] Fix incompatibility of bisect[-skip-count] with Python 3
Mikhail Maltsev [Fri, 4 Oct 2019 16:44:18 +0000 (16:44 +0000)]
[utils] Fix incompatibility of bisect[-skip-count] with Python 3

Summary:
This change replaces the print statements with print function calls
and also replaces the '/' operator (which is integer division in Py2,
but becomes floating point division in Py3) with the '//' operator
which has the same semantics in Py2 and Py3.

Reviewers: greened, michaelplatings, gottesmm

Reviewed By: greened

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373759

4 years ago[lldb-server/android] Show more processes and package name when necessary
Walter Erquinigo [Fri, 4 Oct 2019 16:35:59 +0000 (16:35 +0000)]
[lldb-server/android] Show more processes and package name when necessary

Summary:
By default `platform process list` only shows the processes of the current user that lldb-server can parse.
There are several problems:
- apk programs don't have an executable file. They instead use a package name as identifier.
- each apk also runs under a different user. That's how android works
- because of the user permission, some files like /proc/<pid>/{environ,exe} can't be read.

This results in a very small process list.

This is a local run on my machine
```
(lldb) platform process list
2 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
23291  3177              aarch64-unknown-linux-android sh
23301  23291            aarch64-unknown-linux-android lldb-server
```
However, I have 700 processes running at this time.

By implementing a few fallbacks for android, I've expanded this list to 202, filtering out kernel processes, which would presumably appear in this list if the device was rooted.

```
(lldb) platform process list
202 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
...
12647  3208              aarch64-unknown-linux-android sh
12649  12647             aarch64-unknown-linux-android lldb-server
12653  982                                        com.samsung.faceservice
13185  982                                        com.samsung.vvm
15899  982                                        com.samsung.android.spay
16220  982                                        com.sec.spp.push
17126  982                                        com.sec.spp.push:RemoteDlcProcess
19772  983                                        com.android.chrome
20209  982                                        com.samsung.cmh:CMH
20380  982                                        com.google.android.inputmethod.latin
20879  982                                        com.samsung.android.oneconnect:Receiver
21212  983                                        com.tencent.mm
24459  1                 aarch64-unknown-linux-android wpa_supplicant
25974  982                                        com.samsung.android.contacts
26293  982                                        com.samsung.android.messaging
28714  982                                        com.samsung.android.dialer
31605  982                                        com.samsung.android.MtpApplication
32256  982                                        com.bezobidny
```

Something to notice is that the architecture is unkonwn for all apks. And that's fine, because run-as would be required to gather this information and that would make this entire functionality massively slow.

There are still several improvements to make here, like displaying actual user names, which I'll try to do in a following diff.

Note: Regarding overall apk debugging support from lldb. I'm planning on having lldb spawn lldb-server by itself with the correct user, so that everything works well. The initial lldb-server used for connecting to the remote platform can be reused for such purpose. Furthermore, eventually lldb could also launch that initial lldb-server on its own.

Reviewers: clayborg, aadsm, labath, xiaobai

Subscribers: srhines, krytarowski, kristof.beyls, lldb-commits

Tags: #lldb

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

llvm-svn: 373758

4 years ago[OPENMP50]Suppport for multiple vendors in the same vendor context
Alexey Bataev [Fri, 4 Oct 2019 15:58:45 +0000 (15:58 +0000)]
[OPENMP50]Suppport for multiple vendors in the same vendor context
selector.

According to OpenMP 5.0, multiple vendors could be specified in the
vendor context selector via ',' as a separator.

llvm-svn: 373756

4 years ago[NFC] [FileCheck] Reapply fix init of objects in unit tests
Thomas Preud'homme [Fri, 4 Oct 2019 15:47:23 +0000 (15:47 +0000)]
[NFC] [FileCheck] Reapply fix init of objects in unit tests

Summary:
Fix initialization style of objects allocated on the stack and member
objects in unit test to use the "Type Var(init list)" and
"Type Member{init list}" convention. The latter fixes the buildbot
breakage.

Reviewers: jhenderson, probinson, arichardson, grimar, jdenny

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373755

4 years ago[scudo][standalone] Make malloc_info return a minimal XML
Kostya Kortchinsky [Fri, 4 Oct 2019 15:46:34 +0000 (15:46 +0000)]
[scudo][standalone] Make malloc_info return a minimal XML

Summary:
Initially, our malloc_info was returning ENOTSUP, but Android would
rather have it return successfully and write a barebone XML to the
stream, so we will oblige.

Add an associated test.

Reviewers: cferris, morehouse, hctim, eugenis, vitalybuka

Reviewed By: morehouse

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373754

4 years agoSemaDeclAttr - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Fri, 4 Oct 2019 15:02:46 +0000 (15:02 +0000)]
SemaDeclAttr - silence static analyzer getAs<> null dereference warnings. NFCI.

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: 373753

4 years agoCGBlocks - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Fri, 4 Oct 2019 15:01:54 +0000 (15:01 +0000)]
CGBlocks - silence static analyzer getAs<> null dereference warnings. NFCI.

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: 373752

4 years ago[clang-format] C++11 braced lists should respect the SpacesInParentheses setting
Paul Hoad [Fri, 4 Oct 2019 14:25:20 +0000 (14:25 +0000)]
[clang-format] C++11 braced lists should respect the SpacesInParentheses setting

Summary:
According to the clang-format documentation, "Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the `{}` were the parentheses of a function call with that name."

This patch furthers the treatment of C++11 braced list braces as parentheses by respecting the `SpacesInParentheses` setting.

Reviewers: MyDeveloperDay, reuk, owenpan

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang-format, #clang

Patch By: mitchell-stellar

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

llvm-svn: 373751

4 years ago[clang-format] [PR43531] clang-format damages "alternative representations" for operators
Paul Hoad [Fri, 4 Oct 2019 14:16:59 +0000 (14:16 +0000)]
[clang-format] [PR43531] clang-format damages "alternative representations" for operators

Summary:
https://bugs.llvm.org/show_bug.cgi?id=43531

Fix for clang-format incorrectly handles "alternative operators" as described by https://en.cppreference.com/w/cpp/language/operator_alternative

compl = ~
not = !

these are unary operators, and clang-format will remove the space between them and a numeric constant

this incorrectly formats the following code

```
int a compl 5;
int a not 5;
```

into:

```
int a compl5;
int a not5;
```

The code adds FIXME unit tests for "alternative token" representations for {} [] and # as defined by the same link, which would require a more detailed change to the FormatTokenLexer

Reviewers: klimek, reuk, owenpan, mitchell-stellar, STL_MSFT

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang-tools-extra, #clang

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

llvm-svn: 373750

4 years agoFurther improve -Wbool-operation bitwise negation message
Sam McCall [Fri, 4 Oct 2019 14:11:05 +0000 (14:11 +0000)]
Further improve -Wbool-operation bitwise negation message

llvm-svn: 373749

4 years ago[clang-rename] Fix a crash when renaming a class without definition.
Haojian Wu [Fri, 4 Oct 2019 14:09:31 +0000 (14:09 +0000)]
[clang-rename] Fix a crash when renaming a class without definition.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373748

4 years ago[clang-format] [PR42417] clang-format inserts a space after '->' for operator->(...
Paul Hoad [Fri, 4 Oct 2019 13:24:15 +0000 (13:24 +0000)]
[clang-format] [PR42417] clang-format inserts a space after '->' for operator->() overloading

Summary:
https://bugs.llvm.org/show_bug.cgi?id=42417

This revision removes the extra space between the opertor-> and the parens ()

```
class Bug {
    auto operator-> () -> int*;
    auto operator++(int) -> int;
};
```

Reviewers: klimek, owenpan, byoungyoung, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 373746

4 years ago[AMDGPU][MC][GFX10][WS32] Corrected decoding of dst operand for v_cmp_*_sdwa opcodes
Dmitry Preobrazhensky [Fri, 4 Oct 2019 13:04:17 +0000 (13:04 +0000)]
[AMDGPU][MC][GFX10][WS32] Corrected decoding of dst operand for v_cmp_*_sdwa opcodes

See bug 43484: https://bugs.llvm.org/show_bug.cgi?id=43484

Reviewers: arsenm, rampitec

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

llvm-svn: 373745

4 years ago[clang] Prevent false positives in arm-mfpu-none codegen test.
Simon Tatham [Fri, 4 Oct 2019 13:01:41 +0000 (13:01 +0000)]
[clang] Prevent false positives in arm-mfpu-none codegen test.

A user pointed out to me in private email that this test will fail if
it sees the letter 's' followed by a digit in any part of clang's
assembly output after the function label. That includes the .ident at
the end, which can include a full pathname or hostname or both from
the system clang was built on. So if that path or hostname includes
any text like 's5' then it will cause the test to fail.

Fixed by adding a check for `.fnend`, to limit the scope of the
`CHECK-NOT` to only the actual generated code for the test function.

(Committed without prior review on the basis that it's a simple and
obvious pure test-suite fix and also in a test I contributed myself.)

llvm-svn: 373744

4 years ago[NFCI] Improve the -Wbool-operation's warning message
David Bolvansky [Fri, 4 Oct 2019 12:55:13 +0000 (12:55 +0000)]
[NFCI] Improve the -Wbool-operation's warning message

Based on the request from the post commit review. Also added one new test.

llvm-svn: 373743

4 years agoFix uninitialized variable warnings in directory_entry default constructor. NFCI
Simon Pilgrim [Fri, 4 Oct 2019 12:45:42 +0000 (12:45 +0000)]
Fix uninitialized variable warnings in directory_entry default constructor. NFCI

llvm-svn: 373742

4 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 4 Oct 2019 12:45:27 +0000 (12:45 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 373741

4 years ago[AMDGPU][MC][GFX10] Enabled decoding of 'null' operand
Dmitry Preobrazhensky [Fri, 4 Oct 2019 12:38:36 +0000 (12:38 +0000)]
[AMDGPU][MC][GFX10] Enabled decoding of 'null' operand

See bug 43485: https://bugs.llvm.org/show_bug.cgi?id=43485

Reviewers: arsenm, rampitec

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

llvm-svn: 373740

4 years ago[clangd] update the package-lock.json.
Haojian Wu [Fri, 4 Oct 2019 12:35:16 +0000 (12:35 +0000)]
[clangd] update the package-lock.json.

llvm-svn: 373739

4 years agoARM-Darwin: keep the frame register reserved even if not updated.
Tim Northover [Fri, 4 Oct 2019 12:29:32 +0000 (12:29 +0000)]
ARM-Darwin: keep the frame register reserved even if not updated.

Darwin platforms need the frame register to always point at a valid record even
if it's not updated in a leaf function. Backtraces are more important than one
extra GPR.

llvm-svn: 373738

4 years ago[llvm-ar][test] Clarified comment
Owen Reynolds [Fri, 4 Oct 2019 12:26:25 +0000 (12:26 +0000)]
[llvm-ar][test] Clarified comment

The test is dependant on the installation of the en_US.UTF-8
locale. The reasoning for this is clarified in the amended comment.

llvm-svn: 373737

4 years ago[AMDGPU][MC][GFX10] Corrected definition of FLAT GLOBAL/SCRATCH instructions
Dmitry Preobrazhensky [Fri, 4 Oct 2019 12:10:22 +0000 (12:10 +0000)]
[AMDGPU][MC][GFX10] Corrected definition of FLAT GLOBAL/SCRATCH instructions

See bug 43483: https://bugs.llvm.org/show_bug.cgi?id=43483

Reviewers: arsenm, rampitec

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

llvm-svn: 373736

4 years ago[llvm-readobj] Remove redundant semicolon. NFC
Simon Atanasyan [Fri, 4 Oct 2019 12:08:10 +0000 (12:08 +0000)]
[llvm-readobj] Remove redundant semicolon. NFC

llvm-svn: 373735

4 years ago[lldb] [cmake] Support linking against clang-cpp dylib
Michal Gorny [Fri, 4 Oct 2019 12:03:03 +0000 (12:03 +0000)]
[lldb] [cmake] Support linking against clang-cpp dylib

Link against clang-cpp dylib rather than split libs when
CLANG_LINK_CLANG_DYLIB is enabled.

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

llvm-svn: 373734

4 years ago[llvm-readobj][mips] Inline `printMipsPLTGOT` method
Simon Atanasyan [Fri, 4 Oct 2019 11:59:23 +0000 (11:59 +0000)]
[llvm-readobj][mips] Inline `printMipsPLTGOT` method

llvm-svn: 373733

4 years ago[llvm-readobj][mips] Implement GNU-style printing of .MIPS.abiflags section
Simon Atanasyan [Fri, 4 Oct 2019 11:59:16 +0000 (11:59 +0000)]
[llvm-readobj][mips] Implement GNU-style printing of .MIPS.abiflags section

In this patch `llvm-readobj` prints ASEs flags on a single line
separated by a comma. GNU `readelf` prints each ASEs flag on
a separate line. It will be fixed later.

llvm-svn: 373732

4 years ago[llvm-readobj] Replace arch-specific ObjDumper methods by the single `printArchSpecif...
Simon Atanasyan [Fri, 4 Oct 2019 11:59:06 +0000 (11:59 +0000)]
[llvm-readobj] Replace arch-specific ObjDumper methods by the single `printArchSpecificInfo`

Initially llvm-readobj supports multiple command line options like
`--arm-attributes` and `--mips-plt-got` for display ELF arch-specific
information. Now all these options are superseded by the
`--arch-specific` one. It makes sense to have a single `printArchSpecificInfo`
method in the base `ObjDumper`, and hide all ELF/target specific details
in the `ELFDumper::printArchSpecificInfo` override.

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

llvm-svn: 373731

4 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 4 Oct 2019 11:24:51 +0000 (11:24 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 373730

4 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Fri, 4 Oct 2019 11:24:35 +0000 (11:24 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

llvm-svn: 373729

4 years agoRevert [test] Remove locale dependency for mri-utf8.test
Owen Reynolds [Fri, 4 Oct 2019 11:12:37 +0000 (11:12 +0000)]
Revert [test] Remove locale dependency for mri-utf8.test

This reverts r373700 (git commit b455ebf921c5c940c2366bec226959e3a4127fee)

llvm-svn: 373728

4 years ago[DebugInfo] LiveDebugValues: move DBG_VALUE creation into VarLoc class
Jeremy Morse [Fri, 4 Oct 2019 10:53:47 +0000 (10:53 +0000)]
[DebugInfo] LiveDebugValues: move DBG_VALUE creation into VarLoc class

Rather than having a mixture of location-state shared between DBG_VALUEs
and VarLoc objects in LiveDebugValues, this patch makes VarLoc the
master record of variable locations. The refactoring means that the
transfer of locations from one place to another is always a performed by
an operation on an existing VarLoc, that produces another transferred
VarLoc. DBG_VALUEs are only created at the end of LiveDebugValues, once
all locations are known. As a plus, there is now only one method where
DBG_VALUEs can be created.

The test case added covers a circumstance that is now impossible to
express in LiveDebugValues: if an already-indirect DBG_VALUE is spilt,
previously it would have been restored-from-spill as a direct DBG_VALUE.
We now don't lose this information along the way, as VarLocs always
refer back to the "original" non-transfer DBG_VALUE, and we can always
work out whether a location was "originally" indirect.

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

llvm-svn: 373727

4 years agogn build: (manually) merge r373718
Nico Weber [Fri, 4 Oct 2019 10:20:47 +0000 (10:20 +0000)]
gn build: (manually) merge r373718

llvm-svn: 373726

4 years ago[lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresent
Raphael Isemann [Fri, 4 Oct 2019 09:54:58 +0000 (09:54 +0000)]
[lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresent

Summary:
We should get the TargetAPI lock here to prevent the process of being destroyed while we are in the function. Thanks Jim for explaining what's going on.

Fixes rdar://54424754

Reviewers: jingham

Reviewed By: jingham

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 373725

4 years ago[Format] Fix docs after r373439
Sam McCall [Fri, 4 Oct 2019 09:52:54 +0000 (09:52 +0000)]
[Format] Fix docs after r373439

llvm-svn: 373724

4 years ago[lldb] Fix that 'ninja clean' breaks the build by deleting debugserver_vers.c
Raphael Isemann [Fri, 4 Oct 2019 09:52:26 +0000 (09:52 +0000)]
[lldb] Fix that 'ninja clean' breaks the build by deleting debugserver_vers.c

Summary:
We mark debugserver_vers.c as a generated file in CMake. This means that when we run `ninja clean` we end up deleting that file,
but any following `ninja` invocation will fail due to the file missing. The file can't be generated as `ninja` doesn't know it has to
rerun CMake to create the file. Turns out that marking the output of configure_file as generated is wrong as explained in this bug report:
https://gitlab.kitware.com/cmake/cmake/issues/18032

This patch just removes that property. The only side effect of this seems to be that this file maybe shows up in your IDE when
opening our CMake project, but that seems like a small sacrifice.

This patch can be quickly tested by running `ninja clean ; ninja lldbDebugserverCommon`. Before this patch the build will fail
due to debugserver_vers.c missing.

Reviewers: JDevlieghere, labath

Reviewed By: labath

Subscribers: mgorny, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 373723

4 years agoRevert "[NFC] [FileCheck] Fix init of stack objects in unit tests"
Dmitri Gribenko [Fri, 4 Oct 2019 09:42:19 +0000 (09:42 +0000)]
Revert "[NFC] [FileCheck] Fix init of stack objects in unit tests"

This reverts commit r373717. It broke the build:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18721.

llvm-svn: 373722

4 years ago[lldb] Fix -Wreorder-ctor in r373673
Sam McCall [Fri, 4 Oct 2019 09:41:43 +0000 (09:41 +0000)]
[lldb] Fix -Wreorder-ctor in r373673

llvm-svn: 373721

4 years ago[DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis
Jeremy Morse [Fri, 4 Oct 2019 09:38:05 +0000 (09:38 +0000)]
[DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis

When transfering variable locations from one place to another,
LiveDebugValues immediately creates a DBG_VALUE representing that
transfer. This causes trouble if the variable location should
subsequently be invalidated by a loop back-edge, such as in the added
test case: the transfer DBG_VALUE from a now-invalid location is used
as proof that the variable location is correct. This is effectively a
self-fulfilling prophesy.

To avoid this, defer the insertion of transfer DBG_VALUEs until after
analysis has completed. Some of those transfers are still sketchy, but
we don't propagate them into other blocks now.

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

llvm-svn: 373720

4 years ago[lldb] Fix typo in r373675
Sam McCall [Fri, 4 Oct 2019 09:33:04 +0000 (09:33 +0000)]
[lldb] Fix typo in r373675

llvm-svn: 373719

4 years ago[TableGen] Introduce a generic automaton (DFA) backend
James Molloy [Fri, 4 Oct 2019 09:03:36 +0000 (09:03 +0000)]
[TableGen] Introduce a generic automaton (DFA) backend

Summary:
This patch introduces -gen-automata, a backend for generating deterministic finite-state automata.

DFAs are already generated by the -gen-dfa-packetizer backend. This backend is more generic and will
hopefully be used to implement the DFA generation (and determinization) for the packetizer in the
future.

This backend allows not only generation of a DFA from an NFA (nondeterministic finite-state
automaton), it also emits sidetables that allow a path through the DFA under a sequence of inputs to
be analyzed, and the equivalent set of all possible NFA transitions extracted.

This allows a user to not just answer "can my problem be solved?" but also "what is the
solution?". Clearly this analysis is more expensive than just playing a DFA forwards so is
opt-in. The DFAPacketizer has this behaviour already but this is a more compact and generic
representation.

Examples are bundled in unittests/TableGen/Automata.td. Some are trivial, but the BinPacking example
is a stripped-down version of the original target problem I set out to solve, where we pack values
(actually immediates) into bins (an immediate pool in a VLIW bundle) subject to a set of esoteric
constraints.

Reviewers: t.p.northover

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 373718

4 years ago[NFC] [FileCheck] Fix init of stack objects in unit tests
Thomas Preud'homme [Fri, 4 Oct 2019 09:00:44 +0000 (09:00 +0000)]
[NFC] [FileCheck] Fix init of stack objects in unit tests

Summary:
Fix initialization style of objects allocated on the stack in unit test
to use the "Type Var(init list)" convention.

Reviewers: jhenderson, probinson, arichardson, grimar, jdenny

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373717

4 years agoAMDGPU/GlobalISel: Fix using wrong addrspace for aperture
Matt Arsenault [Fri, 4 Oct 2019 08:35:38 +0000 (08:35 +0000)]
AMDGPU/GlobalISel: Fix using wrong addrspace for aperture

This was always passing the destination flat address space, when it
should be picking between the two valid source options.

llvm-svn: 373716

4 years agoAMDGPU/GlobalISel: Select G_PTRTOINT
Matt Arsenault [Fri, 4 Oct 2019 08:35:37 +0000 (08:35 +0000)]
AMDGPU/GlobalISel: Select G_PTRTOINT

llvm-svn: 373715

4 years agoAMDGPU/GlobalISel: Support wave32 waterfall loops
Matt Arsenault [Fri, 4 Oct 2019 08:35:35 +0000 (08:35 +0000)]
AMDGPU/GlobalISel: Support wave32 waterfall loops

llvm-svn: 373714

4 years agoRevert r371732: "lld-link: Fix tests that do not run on macOS after r371729."
Martin Storsjo [Fri, 4 Oct 2019 08:34:26 +0000 (08:34 +0000)]
Revert r371732: "lld-link: Fix tests that do not run on macOS after r371729."

This commit should be reverted along with r371729.

llvm-svn: 373713

4 years ago[Driver] NFC: Remove duplicate call to getLibGccType
Cullen Rhodes [Fri, 4 Oct 2019 08:26:37 +0000 (08:26 +0000)]
[Driver] NFC: Remove duplicate call to getLibGccType

Reviewed By: saugustine

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

llvm-svn: 373712

4 years ago[lldb][modern-type-lookup] No longer import temporary declarations into the persisten...
Raphael Isemann [Fri, 4 Oct 2019 08:26:17 +0000 (08:26 +0000)]
[lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST

Summary:
As we figured out in D67803, importing declarations from a temporary ASTContext that were originally from a persistent ASTContext
causes a bunch of duplicated declarations where we end up having declarations in the target AST that have no associated ASTImporter that
can complete them.

I haven't figured out how/if we can solve this in the current way we do things in LLDB, but in the modern-type-lookup this is solvable
as we have a saner architecture with the ExternalASTMerger. As we can (hopefully) make modern-type-lookup the default mode in the future,
I would say we try fixing this issue here. As we don't use the hack that was reinstated in D67803 during modern-type-lookup, the test case for this
is essentially just printing any kind of container in `std::` as we would otherwise run into the issue that required a hack like D67803.

What this patch is doing in essence is that instead of importing a declaration from a temporary ASTContext, we instead check if the
declaration originally came from a persistent ASTContext (e.g. the debug information) and we directly import from there. The ExternalASTMerger
is already connected with ASTImporters to these different sources, so this patch is essentially just two parts:
1. Mark our temporary ASTContext/ImporterSource as temporary when we import from the expression AST.
2. If the ExternalASTMerger sees we import from the expression AST, instead of trying to import these temporary declarations, check if we
can instead import from the persistent ASTContext that is already connected. This ensures that all records from the persistent source actually
come from the persistent source and are minimally imported in a way that allows them to be completed later on in the target AST.

The next step is to run the ASTImporter for these temporary expressions with the MinimalImport mode disabled, but that's a follow up patch.

This patch fixes most test failures with modern-type-lookup enabled by default (down to 73 failing tests, which includes the 22 import-std-module tests
which need special treatment).

Reviewers: shafik, martong

Reviewed By: martong

Subscribers: aprantl, rnkovacs, christof, abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 373711

4 years ago[CodeComplete] Ensure object is the same in compareOverloads()
Ilya Biryukov [Fri, 4 Oct 2019 08:10:27 +0000 (08:10 +0000)]
[CodeComplete] Ensure object is the same in compareOverloads()

Summary:
This fixes a regression that led to size() not being available in clangd
when completing 'deque().^' and using libc++.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 373710

4 years ago[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords
Paul Hoad [Fri, 4 Oct 2019 08:10:22 +0000 (08:10 +0000)]
[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

Summary:
When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic types

The C# code

```
public class Foo
{
    Dictionary<string,string> foo;
}

```
will be formatted as

```
public class Foo
{
    Dictionary<string, string>foo;
                           ^^^^^   missing a space
}
```

This revision also reverts some of {D66662} in order to make this cleaner and resolve an issues seen by @owenpan that the formatting didn't add a space when not in a code block

This also transforms C# foreach commands to be seen as tok::kw_for commands (to ensure foreach gets the same Brace Wrapping behavior as for without littering the code with `if(Style.isCSharp())`

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

llvm-svn: 373709

4 years ago[ELF] Use union-find set and doubly linked list in Call-Chain Clustering (C³) heuristic
Fangrui Song [Fri, 4 Oct 2019 07:56:54 +0000 (07:56 +0000)]
[ELF] Use union-find set and doubly linked list in Call-Chain Clustering (C³) heuristic

Before, SecToClusters[*] was used to track the belonged cluster.
During a merge (From -> Into), every element of From has to be updated.
Use a union-find set to speed up this use case.

Also, replace `std::vector<int> Sections;` with a doubly-linked
pointers: int Next, Prev;

Reviewed By: Bigcheese

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

llvm-svn: 373708

4 years ago[clang-format] [PR43333] Fix C# breaking before function name when using Attributes
Paul Hoad [Fri, 4 Oct 2019 07:56:49 +0000 (07:56 +0000)]
[clang-format] [PR43333] Fix C# breaking before function name when using Attributes

Summary:
This is  a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

This comes with 3 main parts

  - C# attributes cause function names on a new line even when AlwaysBreakAfterReturnType is set to None
  - Add AlwaysBreakAfterReturnType  to None by default in the Microsoft style,
  - C# unit tests are not using Microsoft style (which we created to define the default C# style to match a vanilla C# project).

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang, #clang-format

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

llvm-svn: 373707

4 years ago[X86] Enable inline memcmp() to use AVX512
David Zarzycki [Fri, 4 Oct 2019 07:42:34 +0000 (07:42 +0000)]
[X86] Enable inline memcmp() to use AVX512

llvm-svn: 373706

4 years ago[MinGW] Add --reproduce option
Rui Ueyama [Fri, 4 Oct 2019 07:27:45 +0000 (07:27 +0000)]
[MinGW] Add --reproduce option

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

llvm-svn: 373705

4 years agoAdd /reproduce option to lld/COFF
Rui Ueyama [Fri, 4 Oct 2019 07:27:38 +0000 (07:27 +0000)]
Add /reproduce option to lld/COFF

This patch adds /reproduce:<path> option to lld/COFF. This is an
lld-specific option, so we can name it freely. I chose /reproduce
over other names (e.g. /lldlinkrepro) for consistency with other lld
ports.

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

llvm-svn: 373704

4 years agoRevert r371729: lld-link: Make /linkrepro: take a filename, not a directory.
Rui Ueyama [Fri, 4 Oct 2019 07:27:31 +0000 (07:27 +0000)]
Revert r371729: lld-link: Make /linkrepro: take a filename, not a directory.

This reverts commit r371729 because /linkrepro option also exists
in Microsoft link.exe and their linker takes not a filename but a
directory name as an argument for /linkrepro.

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

llvm-svn: 373703

4 years ago[compiler-rt] Remove O1 tests from signal_line.cpp
Vitaly Buka [Fri, 4 Oct 2019 07:25:53 +0000 (07:25 +0000)]
[compiler-rt] Remove O1 tests from signal_line.cpp

It does not work on arm

llvm-svn: 373702

4 years agoRevert "[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp...
Martin Storsjo [Fri, 4 Oct 2019 07:22:37 +0000 (07:22 +0000)]
Revert "[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC."

This reverts SVN r373698, as it broke sanitizer tests, e.g. in
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52441.

llvm-svn: 373701

4 years ago[test] Remove locale dependency for mri-utf8.test
Thomas Preud'homme [Fri, 4 Oct 2019 07:13:46 +0000 (07:13 +0000)]
[test] Remove locale dependency for mri-utf8.test

Summary:
llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
installed for its last RUN line to work. If not installed, the unicode
string gets encoded (interpreted) as ascii which fails since the most
significant byte is non zero. This commit changes the call to open to
use a binary literal of the UTF-8 encoding for the pound sign instead,
thus bypassing the encoding step.

Note that the echo to create the <pound sign>.txt file will work
regardless of the locale because both the shell and the echo (in case
it's not a builtin of the shell concerned) only care about ascii
character to operate. Indeed, the mri-utf8.test file (and in particular
the pound sign) is encoded in UTF-8 and UTF-8 guarantees only ascii
characters can create bytes that can be interpreted as ascii characters
(i.e. bytes with the most significant bit null).

So the process to break down the filename in the line goes something
along:
- find an ascii chevron '>'
- find beginning of the filename by removing ascii space-like characters
- find ascii newline character indicating the end of the redirection (no
  semicolon ';', closing curly bracket '}' or parenthesis ')' or the
  like
- create a file whose name is made of all the bytes in between beginning
  and end of filename *without interpretting them*

Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373700

4 years ago[AMDGPU][SILoadStoreOptimizer] NFC: Refactor code
Piotr Sobczak [Fri, 4 Oct 2019 07:09:40 +0000 (07:09 +0000)]
[AMDGPU][SILoadStoreOptimizer] NFC: Refactor code

Summary:
This patch fixes a potential aliasing problem in InstClassEnum,
where local values were mixed with machine opcodes.

Introducing InstSubclass will keep them separate and help extending
InstClassEnum with other instruction types (e.g. MIMG) in the future.

This patch also makes getSubRegIdxs() more concise.

Reviewers: nhaehnle, arsenm, tstellar

Reviewed By: arsenm

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

Tags: #llvm

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

llvm-svn: 373699

4 years ago[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.
Martin Storsjo [Fri, 4 Oct 2019 07:05:42 +0000 (07:05 +0000)]
[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.

This allows making a couple llvm-symbolizer tests run in all
environments.

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

llvm-svn: 373698

4 years ago[test] Remove a needless declaration of REQUIRES: target-windows
Martin Storsjo [Fri, 4 Oct 2019 07:05:29 +0000 (07:05 +0000)]
[test] Remove a needless declaration of REQUIRES: target-windows

This test only relies on running on a case insensitive file system,
the exact target triple of the toolchain shouldn't matter.

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

llvm-svn: 373697

4 years ago[JITLink] Remove a redundant semicolon, silencing -Wpedantic warnings with GCC. NFC.
Martin Storsjo [Fri, 4 Oct 2019 07:05:22 +0000 (07:05 +0000)]
[JITLink] Remove a redundant semicolon, silencing -Wpedantic warnings with GCC. NFC.

llvm-svn: 373696

4 years ago[clang] [cmake] Add distribution install targets for remaining components
Michal Gorny [Fri, 4 Oct 2019 05:43:20 +0000 (05:43 +0000)]
[clang] [cmake] Add distribution install targets for remaining components

Add install targets as necessary to install bash-autocomplete,
scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS.

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

llvm-svn: 373695

4 years ago[clang-tools-extra] [cmake] Use add_clang_tool() to install tools
Michal Gorny [Fri, 4 Oct 2019 05:40:29 +0000 (05:40 +0000)]
[clang-tools-extra] [cmake] Use add_clang_tool() to install tools

Replace add_clang_executable() calls with add_clang_tool() that takes
care of creating correct, distribution-friendly install target.  While
at it, remove redundant install calls.

This change also causes clang-move and pp-trace to be installed.

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

llvm-svn: 373694

4 years ago[JITLink] Explicitly destroy bumpptr-allocated blocks to avoid a memory leak.
Lang Hames [Fri, 4 Oct 2019 05:24:40 +0000 (05:24 +0000)]
[JITLink] Explicitly destroy bumpptr-allocated blocks to avoid a memory leak.

llvm-svn: 373693

4 years ago[JITLink] Fix an unused variable warning.
Lang Hames [Fri, 4 Oct 2019 05:24:39 +0000 (05:24 +0000)]
[JITLink] Fix an unused variable warning.

llvm-svn: 373692

4 years agoMake libc++ gdb pretty printer Python 3 compatible
Fangrui Song [Fri, 4 Oct 2019 04:47:33 +0000 (04:47 +0000)]
Make libc++ gdb pretty printer Python 3 compatible

llvm-svn: 373691

4 years agogn build: Merge r373689
GN Sync Bot [Fri, 4 Oct 2019 04:00:11 +0000 (04:00 +0000)]
gn build: Merge r373689

llvm-svn: 373690

4 years ago[JITLink] Switch from an atom-based model to a "blocks and symbols" model.
Lang Hames [Fri, 4 Oct 2019 03:55:26 +0000 (03:55 +0000)]
[JITLink] Switch from an atom-based model to a "blocks and symbols" model.

In the Atom model the symbols, content and relocations of a relocatable object
file are represented as a graph of atoms, where each Atom represents a
contiguous block of content with a single name (or no name at all if the
content is anonymous), and where edges between Atoms represent relocations.
If more than one symbol is associated with a contiguous block of content then
the content is broken into multiple atoms and layout constraints (represented by
edges) are introduced to ensure that the content remains effectively contiguous.
These layout constraints must be kept in mind when examining the content
associated with a symbol (it may be spread over multiple atoms) or when applying
certain relocation types (e.g. MachO subtractors).

This patch replaces the Atom model in JITLink with a blocks-and-symbols model.
The blocks-and-symbols model represents relocatable object files as bipartite
graphs, with one set of nodes representing contiguous content (Blocks) and
another representing named or anonymous locations (Symbols) within a Block.
Relocations are represented as edges from Blocks to Symbols. This scheme
removes layout constraints (simplifying handling of MachO alt-entry symbols,
and hopefully ELF sections at some point in the future) and simplifies some
relocation logic.

llvm-svn: 373689

4 years ago[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and...
Shiva Chen [Fri, 4 Oct 2019 02:00:57 +0000 (02:00 +0000)]
[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore

We would like to split the SP adjustment to reduce the instructions in
prologue and epilogue as the following case. In this way, the offset of
the callee saved register could fit in a single store.

    add     sp,sp,-2032
    sw      ra,2028(sp)
    sw      s0,2024(sp)
    sw      s1,2020(sp)
    sw      s3,2012(sp)
    sw      s4,2008(sp)
    add     sp,sp,-64

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

llvm-svn: 373688

4 years agoRevert "Explicitly set entry point arch when it's thumb"
Antonio Afonso [Fri, 4 Oct 2019 01:45:58 +0000 (01:45 +0000)]
Revert "Explicitly set entry point arch when it's thumb"

Backing out because SymbolFile/Breakpad/symtab.test is failing and it seems to be a legit issue. Will investigate.

This reverts commit 72153f95ee4c1b52d2f4f483f0ea4f650ec863be.

llvm-svn: 373687

4 years ago[Python] Remove unused variable
Jonas Devlieghere [Fri, 4 Oct 2019 01:38:57 +0000 (01:38 +0000)]
[Python] Remove unused variable

warning: unused variable 'py_func_obj' [-Wunused-variable]
  PyObject *py_func_obj = m_py_obj;
llvm-svn: 373686

4 years agoProperly handle instantiation-dependent array bounds.
Richard Smith [Fri, 4 Oct 2019 01:25:59 +0000 (01:25 +0000)]
Properly handle instantiation-dependent array bounds.

We previously failed to treat an array with an instantiation-dependent
but not value-dependent bound as being an instantiation-dependent type.
We now track the array bound expression as part of a constant array type
if it's an instantiation-dependent expression.

llvm-svn: 373685

4 years ago[compiler-rt] Fix signal_line.cpp test
Vitaly Buka [Fri, 4 Oct 2019 00:43:05 +0000 (00:43 +0000)]
[compiler-rt] Fix signal_line.cpp test

r373682 committed wrong experimental version

llvm-svn: 373684

4 years ago[dsymutil] Fix stack-use-after-scope
Jonas Devlieghere [Fri, 4 Oct 2019 00:39:48 +0000 (00:39 +0000)]
[dsymutil] Fix stack-use-after-scope

The lambda is taking the stack-allocated Verify boolean by reference and
it would go out of scope on the next iteration. Moving it out of the
loop should fix the issue.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43549

llvm-svn: 373683

4 years ago[compiler-rt] Remove O2, O3 from signal_line test for fix android tests
Vitaly Buka [Fri, 4 Oct 2019 00:38:08 +0000 (00:38 +0000)]
[compiler-rt] Remove O2, O3 from signal_line test for fix android tests

llvm-svn: 373682

4 years agocompiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM
Vitaly Buka [Fri, 4 Oct 2019 00:38:07 +0000 (00:38 +0000)]
compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM

Summary: Fixes https://github.com/google/oss-fuzz/issues/2836

Reviewers: eugenis

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373681

4 years agoExplicitly set entry point arch when it's thumb
Antonio Afonso [Fri, 4 Oct 2019 00:11:22 +0000 (00:11 +0000)]
Explicitly set entry point arch when it's thumb

Summary:
I found a case where the main android binary (app_process32) had thumb code at its entry point but no entry in the symbol table indicating this. This made lldb set a 4 byte breakpoint at that address (we default to arm code) instead of a 2 byte one (like we should for thumb).
The big deal with this is that the expression evaluator uses the entry point as a way to know when a JITed expression has finished executing by putting a breakpoint there. Because of this, evaluating expressions on certain android devices (Google Pixel something) made the process crash.
This was fixed by checking this specific situation when we parse the symbol table and add an artificial symbol for this 2 byte range and indicating that it's arm thumb.

I created 2 unit tests for this, one to check that now we know that the entry point is arm thumb, and the other to make sure we didn't change the behaviour for arm code.

I also run the following on the command line with the `app_process32` where I found the issue:
**Before:**
```
(lldb) dis -s 0x1640 -e 0x1644
app_process32[0x1640]: .long  0xf0004668                ; unknown opcode
```
**After:**
```
(lldb) dis -s 0x1640 -e 0x1644
app_process32`:
app_process32[0x1640] <+0>: mov    r0, sp
app_process32[0x1642]:      andeq  r0, r0, r0
```

Reviewers: clayborg, labath, wallace, espindola

Subscribers: srhines, emaste, arichardson, kristof.beyls, MaskRay, lldb-commits

Tags: #lldb

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

llvm-svn: 373680

4 years agoPython3 doesn't seem to allow you to tell whether an object is a class
Jim Ingham [Thu, 3 Oct 2019 23:57:34 +0000 (23:57 +0000)]
Python3 doesn't seem to allow you to tell whether an object is a class

PyClass_Check and everything it relied on seems gone from Python3.7.  So
I won't check whether it is a class first...

Also cleaned up a couple of warnings.

llvm-svn: 373679

4 years agoLowerTypeTests: Rename local functions to avoid collisions with identically named...
Peter Collingbourne [Thu, 3 Oct 2019 23:42:44 +0000 (23:42 +0000)]
LowerTypeTests: Rename local functions to avoid collisions with identically named functions in ThinLTO modules.

Without this we can encounter link errors or incorrect behaviour
at runtime as a result of the wrong function being referenced.

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

llvm-svn: 373678

4 years agoForgot to change the header guards on OptionGroupPythonClassWithDict.
Jim Ingham [Thu, 3 Oct 2019 23:32:42 +0000 (23:32 +0000)]
Forgot to change the header guards on OptionGroupPythonClassWithDict.

I think that's what is confusing the modules build on the bots.

llvm-svn: 373677

4 years ago[llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on non-x86
Jordan Rupprecht [Thu, 3 Oct 2019 23:08:22 +0000 (23:08 +0000)]
[llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on non-x86

llvm-svn: 373676

4 years agoPass an SBStructuredData to scripted ThreadPlans on use.
Jim Ingham [Thu, 3 Oct 2019 22:50:18 +0000 (22:50 +0000)]
Pass an SBStructuredData to scripted ThreadPlans on use.

This will allow us to write reusable scripted ThreadPlans, since
you can use key/value pairs with known keys in the plan to parametrize
its behavior.

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

llvm-svn: 373675

4 years ago[MemorySSA] Don't hoist stores if interfering uses (as calls) exist.
Alina Sbirlea [Thu, 3 Oct 2019 22:20:04 +0000 (22:20 +0000)]
[MemorySSA] Don't hoist stores if interfering uses (as calls) exist.

llvm-svn: 373674

4 years agoBreak out the Python class & key/value options into a separate OptionGroup.
Jim Ingham [Thu, 3 Oct 2019 22:18:51 +0000 (22:18 +0000)]
Break out the Python class & key/value options into a separate OptionGroup.

Use this in the scripted breakpoint command.  Added some tests for parsing
the key/value options.  This uncovered a bug in handling parsing errors mid-line.
I also fixed that bug.

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

llvm-svn: 373673

4 years ago[OPENMP]Fix the test on Windows, NFC.
Alexey Bataev [Thu, 3 Oct 2019 22:10:33 +0000 (22:10 +0000)]
[OPENMP]Fix the test on Windows, NFC.

llvm-svn: 373672

4 years ago[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Jordan Rupprecht [Thu, 3 Oct 2019 22:01:08 +0000 (22:01 +0000)]
[llvm-objdump] Further rearrange llvm-objdump sections for compatability

Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.

I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly

Reviewers: jhenderson, justice_adams, grimar, ychen, espindola

Reviewed By: jhenderson

Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay

Tags: #llvm

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

llvm-svn: 373671

4 years ago[process list] make the TRIPLE column wider
Walter Erquinigo [Thu, 3 Oct 2019 21:57:01 +0000 (21:57 +0000)]
[process list] make the TRIPLE column wider

Summary:
Now that `process list` works better on the android platform, the arch aarch64-unknown-linux-android appears quite often.
The existing printed width of the TRIPLE column is not long enough, which doesn't look okay.
E.g.
```
1561   1016                    aarch64-unknown-linux-android ip6tables-restore
1999   1                       aarch64-unknown-linux-android tlc_server
2332   982                                              com.android.systemui
2378   983                                              webview_zygote
```

Now, after adding 6 spaces, it looks better

```
PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
...
1561   1016              aarch64-unknown-linux-android  ip6tables-restore
1999   1                 aarch64-unknown-linux-android  tlc_server
2332   982                                              com.android.systemui
2378   983                                              webview_zygote
2448   982                                              com.sec.location.nsflp2
```

Reviewers: clayborg, labath, xiaobai, aadsm

Reviewed By: labath

Subscribers: srhines, kristof.beyls, lldb-commits

Tags: #lldb

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

llvm-svn: 373670

4 years ago[lldb] Remove unused variables.
Haibo Huang [Thu, 3 Oct 2019 21:56:59 +0000 (21:56 +0000)]
[lldb] Remove unused variables.

Fixes the comment in https://reviews.llvm.org/D67993

llvm-svn: 373669

4 years ago[lldb] Calculate relative path for symbol links
Haibo Huang [Thu, 3 Oct 2019 21:52:20 +0000 (21:52 +0000)]
[lldb] Calculate relative path for symbol links

Summary: This replaces the hard coded path.

Reviewers: labath, mgorny

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373668