platform/upstream/llvm.git
4 years ago[X86] lowerShuffleAsLanePermuteAndRepeatedMask - variable renames. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 16:08:30 +0000 (16:08 +0000)]
[X86] lowerShuffleAsLanePermuteAndRepeatedMask - variable renames. NFCI.

Rename some variables to match lowerShuffleAsRepeatedMaskAndLanePermute - prep work toward adding some equivalent sublane functionality.

llvm-svn: 373832

4 years agoTry to fix sphinx indentation error
Simon Pilgrim [Sat, 5 Oct 2019 16:08:17 +0000 (16:08 +0000)]
Try to fix sphinx indentation error

llvm-svn: 373831

4 years ago[SelectionDAG] Add tests for LKK algorithm
David Bolvansky [Sat, 5 Oct 2019 14:29:25 +0000 (14:29 +0000)]
[SelectionDAG] Add tests for LKK algorithm

Added some tests testing urem and srem operations with a constant divisor.

Patch by TG908 (Tim Gymnich)

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

llvm-svn: 373830

4 years agoRewriteObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:42:14 +0000 (13:42 +0000)]
RewriteObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373829

4 years ago[Diagnostics] Highlight expr's source range for -Wbool-operation
David Bolvansky [Sat, 5 Oct 2019 13:28:15 +0000 (13:28 +0000)]
[Diagnostics] Highlight expr's source range for -Wbool-operation

Warning message looks better; and GCC adds it too.

llvm-svn: 373828

4 years agoSemaTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:21:08 +0000 (13:21 +0000)]
SemaTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373827

4 years agoTreeTransform - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:20:59 +0000 (13:20 +0000)]
TreeTransform - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373826

4 years agoRemove redundant !HasDependentValue check. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:20:51 +0000 (13:20 +0000)]
Remove redundant !HasDependentValue check. NFCI.

Fixes cppcheck warning.

llvm-svn: 373825

4 years agoSemaStmt - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:20:42 +0000 (13:20 +0000)]
SemaStmt - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373824

4 years agoBranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.
Simon Pilgrim [Sat, 5 Oct 2019 13:20:30 +0000 (13:20 +0000)]
BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.

Silences static analyzer null dereference warnings.

llvm-svn: 373823

4 years ago[clang-format] SpacesInSquareBrackets should affect lambdas with parameters too
Paul Hoad [Sat, 5 Oct 2019 09:55:23 +0000 (09:55 +0000)]
[clang-format] SpacesInSquareBrackets should affect lambdas with parameters too

Summary:
This patch makes the `SpacesInSquareBrackets` setting also apply to C++ lambdas with parameters.

Looking through the revision history, it appears support for only array brackets was added, and lambda brackets were ignored. Therefore, I am inclined to think it was simply an omission, rather than a deliberate choice.

See https://bugs.llvm.org/show_bug.cgi?id=17887 and https://reviews.llvm.org/D4944.

Reviewers: MyDeveloperDay, reuk, owenpan

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Patch by: mitchell-stellar

Tags: #clang-format, #clang

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

llvm-svn: 373821

4 years ago[UnitTests] Try and pacify gcc-5
James Molloy [Sat, 5 Oct 2019 08:57:17 +0000 (08:57 +0000)]
[UnitTests] Try and pacify gcc-5

This looks like a defect in gcc-5 where it chooses a constexpr
constructor from the initializer-list that it considers to be explicit.

I've tried to reproduce but I can't install anything prior to gcc-6 easily
on my system, and that doesn't have the error. So this is speculative
pacification.

Reported by Steven Wan.

llvm-svn: 373820

4 years agoDo not install lit-cpuid
Sylvestre Ledru [Sat, 5 Oct 2019 08:22:40 +0000 (08:22 +0000)]
Do not install lit-cpuid

Summary:
AFAIK, lit-cpuid is used by the tests.
Installing it causes LLVMExports*.cmake files to depend
on this program.
It causes some serious packaging issues as it would means
that llvm-dev depends on lldb.

See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941082
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941306

See also https://bugs.llvm.org/show_bug.cgi?id=43035
for a similar issue caused by
https://reviews.llvm.org/D56606

Reviewers: mgorny

Reviewed By: mgorny

Subscribers: delcypher, lldb-commits

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

llvm-svn: 373819

4 years ago[NFCI] Slightly improve warning message
David Bolvansky [Sat, 5 Oct 2019 08:09:06 +0000 (08:09 +0000)]
[NFCI] Slightly improve warning message

llvm-svn: 373818

4 years ago[Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of...
David Bolvansky [Sat, 5 Oct 2019 08:02:11 +0000 (08:02 +0000)]
[Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of bool in languages without a bool type

Thanks for this advice, Richard Trieu!

llvm-svn: 373817

4 years agoExpose ProvidePositionalOption as a public API
Mehdi Amini [Sat, 5 Oct 2019 01:37:04 +0000 (01:37 +0000)]
Expose ProvidePositionalOption as a public API

The motivation is to reuse the key value parsing logic here to
parse instance specific pass options within the context of MLIR.
The primary functionality exposed is the "," splitting for
arrays and the logic for properly handling duplicate definitions
of a single flag.

Patch by: Parker Schuh <parkers@google.com>

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

llvm-svn: 373815

4 years agoFix a *nasty* miscompile in experimental unordered atomic lowering
Philip Reames [Sat, 5 Oct 2019 00:32:10 +0000 (00:32 +0000)]
Fix a *nasty* miscompile in experimental unordered atomic lowering

This is an omission in rL371441.  Loads which happened to be unordered weren't being added to the PendingLoad set, and thus weren't be ordered w/respect to side effects which followed before the end of the block.

Included test case is how I spotted this.  We had an atomic load being folded into a using instruction after a fence that load was supposed to be ordered with.  I'm sure it showed up a bunch of other ways as well.

Spotted via manual inspecting of assembly differences in a corpus w/and w/o the new experimental mode.  Finding this with testing would have been "unpleasant".

llvm-svn: 373814

4 years ago[Test] Add a test case fo a missed oppurtunity in implicit null checking
Philip Reames [Fri, 4 Oct 2019 23:46:26 +0000 (23:46 +0000)]
[Test] Add a test case fo a missed oppurtunity in implicit null checking

llvm-svn: 373813

4 years ago[RISCV] Added missing ImmLeaf predicates
Ana Pazos [Fri, 4 Oct 2019 23:42:07 +0000 (23:42 +0000)]
[RISCV] Added missing ImmLeaf predicates

simm9_lsb0 and simm12_lsb0 operand types were missing predicates.

llvm-svn: 373812

4 years agoAdd a unittest to verify for assumption cache
Aditya Kumar [Fri, 4 Oct 2019 23:36:59 +0000 (23:36 +0000)]
Add a unittest to verify for assumption cache

Reviewers: vsk, tejohnson

Reviewed By: vsk

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

llvm-svn: 373811

4 years ago[MachO] Reduce indentation further in ParseSymtab (NFC)
Jonas Devlieghere [Fri, 4 Oct 2019 23:09:55 +0000 (23:09 +0000)]
[MachO] Reduce indentation further in ParseSymtab (NFC)

llvm-svn: 373810

4 years ago[libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY
Alex Langford [Fri, 4 Oct 2019 23:08:20 +0000 (23:08 +0000)]
[libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY

If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your
project will fail to configure because the cxx_experimental target
doesn't exist.

llvm-svn: 373809

4 years ago[libc++] Localize common build flags into a single CMake function
Louis Dionne [Fri, 4 Oct 2019 22:50:23 +0000 (22:50 +0000)]
[libc++] Localize common build flags into a single CMake function

Also, set those flags for the cxx_experimental target. Otherwise,
cxx_experimental doesn't build properly when neither the static nor
the shared library is compiled (yes, that is a weird setup).

llvm-svn: 373808

4 years agoInvalidate assumption cache before outlining.
Aditya Kumar [Fri, 4 Oct 2019 22:46:42 +0000 (22:46 +0000)]
Invalidate assumption cache before outlining.

Subscribers: llvm-commits

Tags: #llvm

Reviewers: compnerd, vsk, sebpop, fhahn, tejohnson

Reviewed by: vsk

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

llvm-svn: 373807

4 years ago[libomptarget][nfc] Update remaining uint32 to use lanemask_t
Jon Chesterfield [Fri, 4 Oct 2019 22:30:28 +0000 (22:30 +0000)]
[libomptarget][nfc] Update remaining uint32 to use lanemask_t

Summary:
[libomptarget][nfc] Update remaining uint32 to use lanemask_t

Update a few functions in the API to use lanemask_t instead of i32. NFC for
nvptx. Also update the ActiveThreads type in DataSharingStateTy.
This removes a lot of #ifdef from the downsteam amdgcn implementation.

Reviewers: ABataev, jdoerfert, grokos, ronlieb, RaviNarayanaswamy

Subscribers: openmp-commits

Tags: #openmp

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

llvm-svn: 373806

4 years agoRevert [CodeGen] Do the Simple Early Return in block-placement pass to optimize the...
Reid Kleckner [Fri, 4 Oct 2019 22:24:21 +0000 (22:24 +0000)]
Revert [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

This reverts r371177 (git commit f879c6875563c0a8cd838f1e13b14dd33558f1f8)

It caused PR43566 by removing empty, address-taken MachineBasicBlocks.
Such blocks may have references from blockaddress or other operands, and
need more consideration to be removed.

See the PR for a test case to use when relanding.

llvm-svn: 373805

4 years ago[test] Run TestLaunchWithShellExpand with /bin/sh on POSIX.
Jonas Devlieghere [Fri, 4 Oct 2019 22:21:35 +0000 (22:21 +0000)]
[test] Run TestLaunchWithShellExpand with /bin/sh on POSIX.

Now that we do shell expansion on POSIX with the user's shel, this test
can potentially fail. This should ensure that we always use /bin/sh.

llvm-svn: 373804

4 years ago[MachO] Move nlist parsing into helper function (NFC)
Jonas Devlieghere [Fri, 4 Oct 2019 22:21:32 +0000 (22:21 +0000)]
[MachO] Move nlist parsing into helper function (NFC)

llvm-svn: 373803

4 years ago[InstCombine] Fold 'icmp eq/ne (?trunc (lshr/ashr %x, bitwidth(x)-1)), 0' -> 'icmp...
Roman Lebedev [Fri, 4 Oct 2019 22:16:22 +0000 (22:16 +0000)]
[InstCombine] Fold 'icmp eq/ne (?trunc (lshr/ashr %x, bitwidth(x)-1)), 0' -> 'icmp sge/slt %x, 0'

We do indeed already get it right in some cases, but only transitively,
with one-use restrictions. Since we only need to produce a single
comparison, it makes sense to match the pattern directly:
  https://rise4fun.com/Alive/kPg

llvm-svn: 373802

4 years ago[InstCombine] Right-shift shift amount reassociation with truncation (PR43564, PR42391)
Roman Lebedev [Fri, 4 Oct 2019 22:16:11 +0000 (22:16 +0000)]
[InstCombine] Right-shift shift amount reassociation with truncation (PR43564, PR42391)

Initially (D65380) i believed that if we have rightshift-trunc-rightshift,
we can't do any folding. But as it usually happens, i was wrong.

https://rise4fun.com/Alive/GEw
https://rise4fun.com/Alive/gN2O

In https://bugs.llvm.org/show_bug.cgi?id=43564 we happen to have
this very sequence, of two right shifts separated by trunc.
And "just" so that happens, we apparently can fold the pattern
if the total shift amount is either 0, or it's equal to the bitwidth
of the innermost widest shift - i.e. if we are left with only the
original sign bit. Which is exactly what is wanted there.

llvm-svn: 373801

4 years ago[NFC][InstCombine] Autogenerate shift.ll test
Roman Lebedev [Fri, 4 Oct 2019 22:15:57 +0000 (22:15 +0000)]
[NFC][InstCombine] Autogenerate shift.ll test

llvm-svn: 373800

4 years ago[NFC][InstCombine] Autogenerate icmp-shr-lt-gt.ll test
Roman Lebedev [Fri, 4 Oct 2019 22:15:49 +0000 (22:15 +0000)]
[NFC][InstCombine] Autogenerate icmp-shr-lt-gt.ll test

llvm-svn: 373799

4 years ago[NFC][InstCombine] Tests for bit test via highest sign-bit extract (w/ trunc) (PR43564)
Roman Lebedev [Fri, 4 Oct 2019 22:15:41 +0000 (22:15 +0000)]
[NFC][InstCombine] Tests for bit test via highest sign-bit extract (w/ trunc) (PR43564)

https://rise4fun.com/Alive/x5IS

llvm-svn: 373798

4 years ago[NFC][InstCombine] Tests for right-shift shift amount reassociation (w/ trunc) (PR435...
Roman Lebedev [Fri, 4 Oct 2019 22:15:32 +0000 (22:15 +0000)]
[NFC][InstCombine] Tests for right-shift shift amount reassociation (w/ trunc) (PR43564, PR42391)

https://rise4fun.com/Alive/GEw

llvm-svn: 373797

4 years agoAdd an off-by-default option to enable testing for gdb pretty printers.
Sterling Augustine [Fri, 4 Oct 2019 22:15:28 +0000 (22:15 +0000)]
Add an off-by-default option to enable testing for gdb pretty printers.

Summary:
The current version of the pretty printers are not python3 compatible,
so turn them off by default until sufficiently improved.

Reviewers: MaskRay, tamur

Subscribers: mgorny, christof, llvm-commits

Tags: #llvm

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

llvm-svn: 373796

4 years ago[debugserver] Don't link against Cocoa, it's not needed.
Davide Italiano [Fri, 4 Oct 2019 21:51:35 +0000 (21:51 +0000)]
[debugserver] Don't link against Cocoa, it's not needed.

<rdar://problem/55916729>

llvm-svn: 373795

4 years ago[lit] Use better name for "test in parallel" concept
Julian Lettner [Fri, 4 Oct 2019 21:40:20 +0000 (21:40 +0000)]
[lit] Use better name for "test in parallel" concept

In the past, lit used threads to run tests in parallel. Today we use
`multiprocessing.Pool`, which uses processes. Let's stay more abstract
and use "worker" everywhere.

Reviewed By: rnk

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

llvm-svn: 373794

4 years agoUse named constant to indicate all lanes, to handle 32 and 64 wide architectures
Jon Chesterfield [Fri, 4 Oct 2019 21:39:22 +0000 (21:39 +0000)]
Use named constant to indicate all lanes, to handle 32 and 64 wide architectures

Summary: Use named constant to indicate all lanes, to handle 32 and 64 wide architectures

Reviewers: ABataev, jdoerfert, grokos, ronlieb

Reviewed By: grokos

Subscribers: ronlieb, openmp-commits

Tags: #openmp

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

llvm-svn: 373793

4 years ago[clang] fix a typo from r372531
Yuanfang Chen [Fri, 4 Oct 2019 21:37:20 +0000 (21:37 +0000)]
[clang] fix a typo from r372531

Reviewers: xbolva00

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373792

4 years ago[MachineOutliner] Disable outlining from noreturn functions
Jessica Paquette [Fri, 4 Oct 2019 21:24:12 +0000 (21:24 +0000)]
[MachineOutliner] Disable outlining from noreturn functions

Outlining from noreturn functions doesn't do the correct thing right now. The
outliner should respect that the caller is marked noreturn. In the event that
we have a noreturn function, and the outlined code is in tail position, the
outliner will not see that the outlined function should be tail called. As a
result, you end up with a regular call containing a return.

Fixing this requires that we check that all candidates live inside noreturn
functions. So, for the sake of correctness, don't outline from noreturn
functions right now.

Add machine-outliner-noreturn.mir to test this.

llvm-svn: 373791

4 years agoExpand on the qfProcessInfo documentation, add examples from
Jason Molenda [Fri, 4 Oct 2019 21:01:52 +0000 (21:01 +0000)]
Expand on the qfProcessInfo documentation, add examples from
lldb-gdb-remote.txt and text explaining the no-criteria mode.

llvm-svn: 373789

4 years ago[InstCombine] add tests for fneg disguised as fmul; NFC
Sanjay Patel [Fri, 4 Oct 2019 20:54:14 +0000 (20:54 +0000)]
[InstCombine] add tests for fneg disguised as fmul; NFC

llvm-svn: 373788

4 years ago[lldb] [testsuite] Mark TestSBCommandReturnObject as failing on Windows
Jan Kratochvil [Fri, 4 Oct 2019 20:49:44 +0000 (20:49 +0000)]
[lldb] [testsuite] Mark TestSBCommandReturnObject as failing on Windows

Filed:
testsuite: TestSBCommandReturnObject: object has no attribute 'dylibPath'
https://bugs.llvm.org/show_bug.cgi?id=43570

http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9530/steps/test/logs/stdio

AttributeError: 'TestSBCommandReturnObject' object has no attribute 'dylibPath'

Fix crash on SBCommandReturnObject & assignment
https://reviews.llvm.org/D67589
  env = {self.dylibPath: self.getLLDBLibraryEnvVal()}

I do not know how to link with liblldb on Windows so marking it as failing on
Windows.

llvm-svn: 373787

4 years ago[clang-tools-extra] [cmake] Link against libclang-cpp whenever possible
Michal Gorny [Fri, 4 Oct 2019 20:30:02 +0000 (20:30 +0000)]
[clang-tools-extra] [cmake] Link against libclang-cpp whenever possible

Use clang_target_link_libraries() in order to support linking against
libclang-cpp instead of static libraries.

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

llvm-svn: 373786

4 years ago[clang] [cmake] Use add_clang_tool() to install all tools
Michal Gorny [Fri, 4 Oct 2019 20:28:59 +0000 (20:28 +0000)]
[clang] [cmake] Use add_clang_tool() to install all tools

Switch clang-check, clang-extdef-mapping and clang-offload-bundler
to use add_clang_tool() rather than add_clang_executable() with a custom
install rule.  This makes them LLVM_DISTRIBUTION_COMPONENTS-friendly.

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

llvm-svn: 373785

4 years ago[NFC] Add { } to silence compiler warning [-Wmissing-braces].
Huihui Zhang [Fri, 4 Oct 2019 20:04:34 +0000 (20:04 +0000)]
[NFC] Add { } to silence compiler warning [-Wmissing-braces].

../llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:48: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
                                               ^
                                               {}

llvm-svn: 373784

4 years ago[Host] Return status directly from RunShellCommand
Jonas Devlieghere [Fri, 4 Oct 2019 19:54:45 +0000 (19:54 +0000)]
[Host] Return status directly from RunShellCommand

Thanks for catching this, Pavel!

llvm-svn: 373783

4 years ago[ScheduleDAG] When a node is cloned, add an edge between the nodes.
Eli Friedman [Fri, 4 Oct 2019 19:51:40 +0000 (19:51 +0000)]
[ScheduleDAG] When a node is cloned, add an edge between the nodes.

InstrEmitter's virtual register handling assumes that clones are emitted
after the cloned node.  Make sure this assumption actually holds.

Fixes a "Node emitted out of order - early" assertion on the testcase.

This is probably a very rare case to actually hit in practice; even
without the explicit edge, the scheduler will usually end up scheduling
the nodes in the expected order due to other constraints.

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

llvm-svn: 373782

4 years ago[LLD] [COFF] Always demangle the __imp_ prefix to __declspec(dllimport)
Martin Storsjo [Fri, 4 Oct 2019 19:47:59 +0000 (19:47 +0000)]
[LLD] [COFF] Always demangle the __imp_ prefix to __declspec(dllimport)

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

llvm-svn: 373781

4 years ago[test] Remove another two unnecessary uses of REQUIRES: target-windows. NFC.
Martin Storsjo [Fri, 4 Oct 2019 19:47:48 +0000 (19:47 +0000)]
[test] Remove another two unnecessary uses of REQUIRES: target-windows. NFC.

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

llvm-svn: 373780

4 years ago[JITLink] Silence GCC warnings. NFC.
Martin Storsjo [Fri, 4 Oct 2019 19:47:42 +0000 (19:47 +0000)]
[JITLink] Silence GCC warnings. NFC.

Use parentheses in an expression with mixed && and ||.

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

llvm-svn: 373779

4 years ago[MachO] Add early returns to save some indentation.
Jonas Devlieghere [Fri, 4 Oct 2019 19:37:59 +0000 (19:37 +0000)]
[MachO] Add early returns to save some indentation.

This file really suffered from the Great Reformat. I'm adding a few
early returns to give the deeply nested code some more breathing room.

llvm-svn: 373778

4 years ago[MachO] Reformat before making changes to this file (NFC)
Jonas Devlieghere [Fri, 4 Oct 2019 19:37:52 +0000 (19:37 +0000)]
[MachO] Reformat before making changes to this file (NFC)

llvm-svn: 373777

4 years ago[Host] Don't discard return value from RunShellCommand
Jonas Devlieghere [Fri, 4 Oct 2019 19:37:46 +0000 (19:37 +0000)]
[Host] Don't discard return value from RunShellCommand

The recent change to expand arguments with the user's shell sometimes
caused a timeout and the error was not propagated.

llvm-svn: 373776

4 years ago[lldb] Fix crash on SBCommandReturnObject & assignment
Jan Kratochvil [Fri, 4 Oct 2019 19:32:57 +0000 (19:32 +0000)]
[lldb] Fix crash on SBCommandReturnObject & assignment

I was writing an SB API client and it was crashing on:
bool DoExecute(SBDebugger dbg, char **command, SBCommandReturnObject &result) {
  result = subcommand(dbg, "help");

That is because SBCommandReturnObject &result gets initialized inside LLDB by:
bool DoExecute(Args &command, CommandReturnObject &result) override {
  // std::unique_ptr gets initialized here from `&result`!!!
  SBCommandReturnObject sb_return(&result);
  DoExecute(...);
  sb_return.Release();

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

llvm-svn: 373775

4 years ago[Sema] Split out -Wformat-type-confusion from -Wformat-pedantic
Erik Pilkington [Fri, 4 Oct 2019 19:20:27 +0000 (19:20 +0000)]
[Sema] Split out -Wformat-type-confusion from -Wformat-pedantic

The warnings now in -Wformat-type-confusion don't align with how we interpret
'pedantic' in clang, and don't belong in -pedantic.

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

llvm-svn: 373774

4 years ago[libc++] Make the modules-related flags PUBLIC instead of PRIVATE
Louis Dionne [Fri, 4 Oct 2019 19:10:56 +0000 (19:10 +0000)]
[libc++] Make the modules-related flags PUBLIC instead of PRIVATE

It appears that those need to be propagated to targets that use libc++
as well, otherwise they don't build properly.

llvm-svn: 373773

4 years agoAdd missing null pointer check in -ftime-trace code
Reid Kleckner [Fri, 4 Oct 2019 18:57:01 +0000 (18:57 +0000)]
Add missing null pointer check in -ftime-trace code

createOutputFile diagnoses the error for the caller already, so recover
by not writing the output.

Fixes PR43555

No test, since I couldn't think of a good, portable, simple way to make
the regular -o output file writable, but outputfile.json not writable.

llvm-svn: 373771

4 years ago[libc++abi] Link against libSystem on Apple platforms
Louis Dionne [Fri, 4 Oct 2019 18:32:46 +0000 (18:32 +0000)]
[libc++abi] Link against libSystem on Apple platforms

On Apple platforms, libSystem is an umbrella for all other system
libraries, and libpthread (and friends) are actually just symlinks
to libSystem.

llvm-svn: 373770

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