platform/upstream/llvm.git
4 years ago[ELF] accept thinlto options without --plugin-opt= prefix
Bob Haarman [Wed, 25 Sep 2019 01:19:48 +0000 (01:19 +0000)]
[ELF] accept thinlto options without --plugin-opt= prefix

Summary:
When support for ThinLTO was first added to lld, the options that
control it were prefixed with --plugin-opt= for compatibility with
an existing implementation as a linker plugin. This change enables
shorter versions of the options to be used, as follows:

  New                              Existing
  -thinlto-emit-imports-files      --plugin-opt=thinlto-emit-imports-files
  -thinlto-index-only              --plugin-opt=thinlto-index-only
  -thinlto-index-only=             --plugin-opt=thinlto-index-only=
  -thinlto-object-suffix-replace=  --plugin-opt=thinlto-object-suffix-replace=
  -thinlto-prefix-replace=         --plugin-opt=thinlto-prefix-replace=
  -lto-obj-path=                   --plugin-opt=obj-path=

The options with the --plugin-opt= prefix have been retained as aliases
for the shorter variants so that they continue to be accepted.

Reviewers: tejohnson, ruiu, espindola

Reviewed By: ruiu

Subscribers: emaste, arichardson, MaskRay, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 372798

4 years ago[Documentation] Expand on testing variants.
Jonas Devlieghere [Wed, 25 Sep 2019 00:58:39 +0000 (00:58 +0000)]
[Documentation] Expand on testing variants.

The testing documentation appears to be from an era when the only kind
of tests were the lldbsuite python tests. This patch adds a short
description of the unittests and LIT tests and how to run them.

Patch by: Lawrence D'Anna

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

llvm-svn: 372797

4 years ago[Docs] Moves Reference docs to new page
DeForest Richards [Wed, 25 Sep 2019 00:49:02 +0000 (00:49 +0000)]
[Docs] Moves Reference docs to new page

Moves Reference docs to new page. Also adds a table of contents to Getting Involved page.

llvm-svn: 372796

4 years agoCanonicalize variable usage in testsuite Makefiles
Adrian Prantl [Wed, 25 Sep 2019 00:36:00 +0000 (00:36 +0000)]
Canonicalize variable usage in testsuite Makefiles

This test streamlines our use of variables that are expected by
Makefile.rules throughout the test suite. Mostly it replaced
potentially dangerous overrides and updates of variables like CFLAGS
with safe assignments to variables reserved for this purpose like
CFLAGS_EXTRAS.

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

llvm-svn: 372795

4 years ago[CMake] Don't try to install the system debugserver.
Jonas Devlieghere [Wed, 25 Sep 2019 00:21:31 +0000 (00:21 +0000)]
[CMake] Don't try to install the system debugserver.

The custom target for the system debugserver has no install target, so
we need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list.

llvm-svn: 372793

4 years ago[WebAssembly][NFC] Remove duplicate SIMD instructions and predicates
Thomas Lively [Wed, 25 Sep 2019 00:15:59 +0000 (00:15 +0000)]
[WebAssembly][NFC] Remove duplicate SIMD instructions and predicates

Summary:
Instead of having different v128.load and v128.store instructions for
each MVT, just have one of each that is reused in all the
patterns. Also removes the HasSIMD128 predicate where accompanied by
HasUnimplementedSIMD128, since the latter implies the former.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 372792

4 years agoUse double quotes for LDFLAGS in -DLLVM_BUILD_INSTRUMENTED_COVERAGE
Justin Bogner [Tue, 24 Sep 2019 23:56:22 +0000 (23:56 +0000)]
Use double quotes for LDFLAGS in -DLLVM_BUILD_INSTRUMENTED_COVERAGE

Mimics the changes in r372209 to handle the change of quotes in
r372226. Probably isn't sufficient for windows, but unbreaks the cmake
flag at least.

llvm-svn: 372791

4 years ago[NFC] Invoke lipo from CMAKE_LIPO.
Puyan Lotfi [Tue, 24 Sep 2019 23:48:42 +0000 (23:48 +0000)]
[NFC] Invoke lipo from CMAKE_LIPO.

This shouldn't change anything, except that a cmake cache file that specifies
CMAKE_LIPO can specify an alternate lipo to use.

llvm-svn: 372790

4 years ago[SCEV] Disable canonical expansion for non-affine addrecs.
Artur Pilipenko [Tue, 24 Sep 2019 23:21:07 +0000 (23:21 +0000)]
[SCEV] Disable canonical expansion for non-affine addrecs.

Reviewed By: apilipenko

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

Patch by Evgeniy Brevnov (ybrevnov@azul.com)

llvm-svn: 372789

4 years agoHost: use the platform identifiers from LLVM (NFC)
Saleem Abdulrasool [Tue, 24 Sep 2019 22:55:44 +0000 (22:55 +0000)]
Host: use the platform identifiers from LLVM (NFC)

Use symbolic constants for the platform identifiers rather than replicating them
locally.

llvm-svn: 372788

4 years ago[libc++] Purge mentions of GCC 4 from the test suite
Louis Dionne [Tue, 24 Sep 2019 22:42:36 +0000 (22:42 +0000)]
[libc++] Purge mentions of GCC 4 from the test suite

We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.

llvm-svn: 372787

4 years ago[CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVER
Jonas Devlieghere [Tue, 24 Sep 2019 22:39:04 +0000 (22:39 +0000)]
[CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVER

r366433 broke support for the system debugserver. Although the change
was well-intended, it (presumably) unintentionally removed the logic to
copy over the debugserver. As a result, even with
LLDB_USE_SYSTEM_DEBUGSERVER enabled, we ended up building, signing and
using the just-built debugserver.

This patch partially recovers the old behavior: when
LLDB_USE_SYSTEM_DEBUGSERVER is set we don't build debugserver and just
copy over the system one.

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

llvm-svn: 372786

4 years ago[BPF] Generate array dimension size properly for zero-size elements
Yonghong Song [Tue, 24 Sep 2019 22:38:43 +0000 (22:38 +0000)]
[BPF] Generate array dimension size properly for zero-size elements

Currently, if an array element type size is 0, the number of
array elements will be set to 0, regardless of what user
specified. This implementation is done in the beginning where
BTF is mostly used to calculate the member offset.

For example,
  struct s {};
  struct s1 {
        int b;
        struct s a[2];
  };
  struct s1 s1;
The BTF will have struct "s1" member "a" with element count 0.

Now BTF types are used for compile-once and run-everywhere
relocations and we need more precise type representation
for type comparison. Andrii reported the issue as there
are differences between original structure and BTF-generated
structure.

This patch made the change to correctly assign "2"
as the number elements of member "a".
Some dead codes related to ElemSize compuation are also removed.

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

llvm-svn: 372785

4 years agoAdding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
Puyan Lotfi [Tue, 24 Sep 2019 22:38:18 +0000 (22:38 +0000)]
Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.

Second attempt: Now with ';' -> '|' replacement.

On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).

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

llvm-svn: 372784

4 years ago[PGO][PGSO] ProfileSummary changes.
Hiroshi Yamauchi [Tue, 24 Sep 2019 22:17:51 +0000 (22:17 +0000)]
[PGO][PGSO] ProfileSummary changes.

(Split of off D67120)

ProfileSummary changes for profile guided size optimization.

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

llvm-svn: 372783

4 years ago[libc++] Try fixing tests that fail on GCC 5 and older
Louis Dionne [Tue, 24 Sep 2019 22:13:17 +0000 (22:13 +0000)]
[libc++] Try fixing tests that fail on GCC 5 and older

llvm-svn: 372782

4 years ago[ELF][ARM] Fix crash when discarding InputSections that have .ARM.exidx
Peter Smith [Tue, 24 Sep 2019 21:44:14 +0000 (21:44 +0000)]
[ELF][ARM] Fix crash when discarding InputSections that have .ARM.exidx

When /DISCARD/ is used on an input section, that input section may have
a .ARM.exidx metadata section that depends on it. As the discard handling
comes after the .ARM.exidx synthetic section is created we need to make
sure that we account for the case where the .ARM.exidx output section
should be removed because there are no more live input sections.

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

llvm-svn: 372781

4 years ago [libc++] Remove C++03 variadics in shared_ptr
Zoe Carver [Tue, 24 Sep 2019 20:55:54 +0000 (20:55 +0000)]
[libc++] Remove C++03 variadics in shared_ptr

    Summary: As suggested by @ldionne in D66178, this patch removes C++03 variadics //only//. Following patches will apply more updates.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits, ldionne

    Tags: #libc

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

llvm-svn: 372780

4 years ago[lld][WebAssembly] Fix static linking of -fPIC code with external undefined functions
Sam Clegg [Tue, 24 Sep 2019 20:52:12 +0000 (20:52 +0000)]
[lld][WebAssembly] Fix static linking of -fPIC code with external undefined functions

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

llvm-svn: 372779

4 years ago[libc++] Implement LWG 3158
Louis Dionne [Tue, 24 Sep 2019 20:22:34 +0000 (20:22 +0000)]
[libc++] Implement LWG 3158

Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 372778

4 years ago[libc++] Implement LWG 2510
Louis Dionne [Tue, 24 Sep 2019 20:18:54 +0000 (20:18 +0000)]
[libc++] Implement LWG 2510

Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 372777

4 years ago[NFC][COFF] fix typo in comment ("algortihm" -> "algorithm")
Bob Haarman [Tue, 24 Sep 2019 20:17:54 +0000 (20:17 +0000)]
[NFC][COFF] fix typo in comment ("algortihm" -> "algorithm")

llvm-svn: 372776

4 years ago[NFC] Strenghten preconditions for warning
David Bolvansky [Tue, 24 Sep 2019 20:10:57 +0000 (20:10 +0000)]
[NFC] Strenghten preconditions for warning

llvm-svn: 372775

4 years ago[unittest] Skip the socket tests if we $TMPDIR is too long.
Jonas Devlieghere [Tue, 24 Sep 2019 19:34:50 +0000 (19:34 +0000)]
[unittest] Skip the socket tests if we $TMPDIR is too long.

Adrian added a sanity check to the socket tests to ensure the $TMPDIR is
not too long for a socket. While this is great for diagnosing the
problem it doesn't really solve the problem for environment where you
have no control over that variable such as in CI. I propose to just skip
the test in that case similar to what we do for tests that rely on
targets that are not currently build, etc.

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

llvm-svn: 372774

4 years ago[HIP] Support new kernel launching API
Yaxun Liu [Tue, 24 Sep 2019 19:16:40 +0000 (19:16 +0000)]
[HIP] Support new kernel launching API

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

llvm-svn: 372773

4 years agoExtends the expansion of the LWZtoc pseduo op for AIX.
Sean Fertile [Tue, 24 Sep 2019 18:04:51 +0000 (18:04 +0000)]
Extends the expansion of the LWZtoc pseduo op for AIX.

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

llvm-svn: 372772

4 years ago[GCRelocate] Add a peephole to canonicalize base pointer relocation
Philip Reames [Tue, 24 Sep 2019 17:24:16 +0000 (17:24 +0000)]
[GCRelocate] Add a peephole to canonicalize base pointer relocation

If we generate the gc.relocate, and then later prove two arguments to the statepoint are equivalent, we should canonicalize the gc.relocate to the form we would have produced if this had been known before rewriting.

llvm-svn: 372771

4 years ago[X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding
Simon Pilgrim [Tue, 24 Sep 2019 16:15:32 +0000 (16:15 +0000)]
[X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding

llvm-svn: 372770

4 years ago[InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)
Roman Lebedev [Tue, 24 Sep 2019 16:10:50 +0000 (16:10 +0000)]
[InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)

Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

For
```
#include <cassert>
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}
```
We produce

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
```
Name: 0
Pre: C != 0
  %adjusted = add i8 %base, C
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ult i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, C
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/ALap
https://rise4fun.com/Alive/slnN

There are 3 other variants of this pattern,
i believe they all will go into InstSimplify.

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372768

4 years ago[InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)
Roman Lebedev [Tue, 24 Sep 2019 16:10:38 +0000 (16:10 +0000)]
[InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)

Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

This pattern isn't exactly what we get there
(strict vs. non-strict predicate), but this pattern does not
require known-bits analysis, so it is best to handle it first.

```
Name: 0
  %adjusted = add i8 %base, %offset
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ule i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, %offset
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/knp

There are 3 other variants of this pattern,
they all will go into InstSimplify:
https://rise4fun.com/Alive/bIDZ

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: hiraditya, majnemer, vsk, llvm-commits

Tags: #llvm

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

llvm-svn: 372767

4 years ago[X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores
Simon Pilgrim [Tue, 24 Sep 2019 15:40:09 +0000 (15:40 +0000)]
[X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores

llvm-svn: 372766

4 years ago[TextAPI] Remove redundant checking causing warnings. NFC.
Michael Liao [Tue, 24 Sep 2019 14:52:13 +0000 (14:52 +0000)]
[TextAPI] Remove redundant checking causing warnings. NFC.

- Minor coding format.

llvm-svn: 372765

4 years agoRegex: Make "match" and "sub" const member functions
Thomas Preud'homme [Tue, 24 Sep 2019 14:42:36 +0000 (14:42 +0000)]
Regex: Make "match" and "sub" const member functions

Summary:
The Regex "match" and "sub" member functions were previously not "const"
because they wrote to the "error" member variable. This commit removes
those assignments, and instead assumes that the validity of the regex
is already known after the initial compilation of the regular
expression. As a result, these member functions were possible to make
"const". This makes it easier to do things like pre-compile Regexes
up-front, and makes "match" and "sub" thread-safe. The error status is
now returned as an optional output, which also makes the API of "match"
and "sub" more consistent with each other.

Also, some uses of Regex that could be refactored to be const were made const.

Patch by Nicolas Guillemot

Reviewers: jankratochvil, thopre

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 372764

4 years ago[NFC] Fix typo in the "kind" description for the software single-step breakpoint
Tatyana Krasnukha [Tue, 24 Sep 2019 14:24:52 +0000 (14:24 +0000)]
[NFC] Fix typo in the "kind" description for the software single-step breakpoint

llvm-svn: 372763

4 years ago[yaml2obj/obj2yaml] - Add support for .stack_sizes sections.
George Rimar [Tue, 24 Sep 2019 14:22:37 +0000 (14:22 +0000)]
[yaml2obj/obj2yaml] - Add support for .stack_sizes sections.

.stack_sizes is a SHT_PROGBITS section that contains pairs of
<address (4/8 bytes), stack size (uleb128)>.

This patch teach tools to parse and dump it.

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

llvm-svn: 372762

4 years ago[Compiler] Fix LLVM_NODISCARD for GCC
David Bolvansky [Tue, 24 Sep 2019 14:01:14 +0000 (14:01 +0000)]
[Compiler] Fix LLVM_NODISCARD for GCC

Summary:
This branch is currently dead since we don't use C++17.
 #if __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
 #define LLVM_NODISCARD [[nodiscard]]

This branch is Clang-only.
 #elif LLVM_HAS_CPP_ATTRIBUTE(clang::warn_unused_result)
 #define LLVM_NODISCARD [[clang::warn_unused_result]]

While we could use gnu variant  [[gnu::warn_unused_result]], it is not ideal because it works only on functions.
/home/xbolva00/LLVM/llvm/include/llvm/ADT/ArrayRef.h:41:24: warning: â€˜warn_unused_result’ attribute only applies to function types [-Wattributes]

GCC (checked 5,6,7,8) seems to enable [[nodiscard]] even in C++14 mode and does not produce warnings that nodiscard is C++17 feature. but Clang does - but we do not reach it due the code above. So it affects only GCC and does what we want.

Reviewers: jfb, rsmith, echristo, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: MaskRay, dexonsmith

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

llvm-svn: 372761

4 years ago[clang-format] [PR36858] Add missing .hh and .cs extensions from python support utilities
Paul Hoad [Tue, 24 Sep 2019 14:00:06 +0000 (14:00 +0000)]
[clang-format] [PR36858] Add missing .hh and .cs extensions from python support utilities

Summary: https://bugs.llvm.org/show_bug.cgi?id=36858 identifies .hh as a missing C++ header extension file while making this change I realized there was no support for .cs files which were added recently

Reviewers: pseyfert, klimek, owenpan

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 372760

4 years agoAggressiveAntiDepBreaker - silence static analyzer null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 13:57:51 +0000 (13:57 +0000)]
AggressiveAntiDepBreaker - silence static analyzer null dereference warning. NFCI.

Assert that we've found the critical path.

llvm-svn: 372759

4 years agoSafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null dereference...
Simon Pilgrim [Tue, 24 Sep 2019 13:57:44 +0000 (13:57 +0000)]
SafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null dereference warnings. NFCI.

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

llvm-svn: 372758

4 years ago[COFF] Silence static analyzer null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 13:57:38 +0000 (13:57 +0000)]
[COFF] Silence static analyzer null dereference warning. NFCI.

Assert that the COFFSymbolRef is correct.

llvm-svn: 372757

4 years agoRevert r372333: [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a targe...
Ilya Biryukov [Tue, 24 Sep 2019 13:48:02 +0000 (13:48 +0000)]
Revert r372333: [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)

Reason: this caused severe compile time regressions in JAX.
See email thread  of original revision on llvm-commits for details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190923/697042.html

llvm-svn: 372756

4 years ago[lldb] [Process/NetBSD] Fix handling LLDB_INVALID_SIGNAL_NUMBER
Michal Gorny [Tue, 24 Sep 2019 13:41:54 +0000 (13:41 +0000)]
[lldb] [Process/NetBSD] Fix handling LLDB_INVALID_SIGNAL_NUMBER

Fix NativeProcessNetBSD::Resume() to handle LLDB_INVALID_SIGNAL_NUMBER
correctly.  Fixes breakage caused by r372090 and r372300.  I have major
rewrite of that function pending; however, the fixes to gdb-remote
were committed prior to that.

llvm-svn: 372755

4 years ago[docs][llvm-strip][llvm-objcopy] Improve wording and fix highlighting
James Henderson [Tue, 24 Sep 2019 13:41:39 +0000 (13:41 +0000)]
[docs][llvm-strip][llvm-objcopy] Improve wording and fix highlighting

llvm-svn: 372754

4 years ago[clangd] Add semantic selection to ClangdLSPServer.
Utkarsh Saxena [Tue, 24 Sep 2019 13:38:33 +0000 (13:38 +0000)]
[clangd] Add semantic selection to ClangdLSPServer.

Summary:
This adds semantic selection to the LSP Server.
Adds support for serialization of input request and the output reply.
Also adds regression tests for the feature.

Currently we do not support multi cursor.The LSP Server only accepts single position in the request as opposed to many position in the spec.

Spec:
https://github.com/microsoft/language-server-protocol/blob/dbaeumer/3.15/specification.md#textDocument_selectionRange

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 372753

4 years ago[clangd] Save an unnecessary copy, NFC.
Haojian Wu [Tue, 24 Sep 2019 13:25:38 +0000 (13:25 +0000)]
[clangd] Save an unnecessary copy, NFC.

llvm-svn: 372752

4 years ago[docs][llvm-size] Fix typo
James Henderson [Tue, 24 Sep 2019 13:14:22 +0000 (13:14 +0000)]
[docs][llvm-size] Fix typo

llvm-svn: 372750

4 years ago[Diagnostics] Handle tautological left shifts in boolean context
David Bolvansky [Tue, 24 Sep 2019 13:14:18 +0000 (13:14 +0000)]
[Diagnostics] Handle tautological left shifts in boolean context

llvm-svn: 372749

4 years ago[LLD][ELF][MIPS] - Inline the short helper function. NFC.
George Rimar [Tue, 24 Sep 2019 12:53:53 +0000 (12:53 +0000)]
[LLD][ELF][MIPS] - Inline the short helper function. NFC.

It was requested in a post-commit comment for r372570.

llvm-svn: 372747

4 years ago[Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:43:55 +0000 (12:43 +0000)]
[Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.

llvm-svn: 372746

4 years ago[llvm-objcopy] Fix a warningon unused variable. NFC.
Michael Liao [Tue, 24 Sep 2019 12:43:44 +0000 (12:43 +0000)]
[llvm-objcopy] Fix a warningon unused variable. NFC.

llvm-svn: 372745

4 years agoEnhance SymbolFileDWARF::ParseDeclsForContext performance
Pavel Labath [Tue, 24 Sep 2019 12:36:54 +0000 (12:36 +0000)]
Enhance SymbolFileDWARF::ParseDeclsForContext performance

This implements
DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed so as to
provide a faster way to ensure all DIEs linked to a certain declaration
context have been parsed.

Currently, we rely on SymbolFileDWARF::ParseDeclsForContext calling
DWARFASTParserClang::GetDIEForDeclContext, and only then
DWARFASTParserClang::GetDeclForUIDFromDWARF. This change shortcuts that
logic and removes redundant calls to DWARFASTParserClang::
GetClangDeclForDIE by deleting DIEs from the m_decl_ctx_to_die map once
they have been parsed.

Differential Revision: https://reviews.llvm.org/D67760
Patch by Guilherme Andrade <guiandrade@google.com>.

llvm-svn: 372744

4 years agoConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:30:13 +0000 (12:30 +0000)]
ConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Early out if the vector element is not Constant.

llvm-svn: 372743

4 years agoFix cppcheck "reduce variable scope" warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:30:07 +0000 (12:30 +0000)]
Fix cppcheck "reduce variable scope" warning. NFCI.

llvm-svn: 372742

4 years ago[LLDB] Add tests for PECOFF arm architecture identification
Martin Storsjo [Tue, 24 Sep 2019 12:20:52 +0000 (12:20 +0000)]
[LLDB] Add tests for PECOFF arm architecture identification

Add a test case for the change from SVN r372657, and for the
preexisting ARM identification.

Add a missing ArchDefinitionEntry for PECOFF/arm64, and tweak
the ArmNt case to set the architecture to armv7 (ArmNt never ran
on anything lower than that). (This avoids a case where
ArchSpec::MergeFrom would override the arch from arm to armv7 and
ArchSpec::CoreUpdated would reset the OS to unknown at the same time.)

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

llvm-svn: 372741

4 years ago[LLDB] [test] Allow differing order of some matches
Martin Storsjo [Tue, 24 Sep 2019 12:20:38 +0000 (12:20 +0000)]
[LLDB] [test] Allow differing order of some matches

These can appear in a different order depending on the relative
layout of the source and build trees.

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

llvm-svn: 372740

4 years ago[LLDB] [test] Add a few missing cases of REQUIRES: python
Martin Storsjo [Tue, 24 Sep 2019 12:20:33 +0000 (12:20 +0000)]
[LLDB] [test] Add a few missing cases of REQUIRES: python

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

llvm-svn: 372739

4 years ago[LLDB] Fix typo in RegisterContextDarwin_arm64
Martin Storsjo [Tue, 24 Sep 2019 12:20:21 +0000 (12:20 +0000)]
[LLDB] Fix typo in RegisterContextDarwin_arm64

In these cases, the register number should be calculated from
fpu_d0, not fpu_s0.

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

llvm-svn: 372738

4 years ago[lldb] Also force posix paths in CppModuleConfigurationTest
Raphael Isemann [Tue, 24 Sep 2019 12:13:35 +0000 (12:13 +0000)]
[lldb] Also force posix paths in CppModuleConfigurationTest

llvm-svn: 372737

4 years ago[lldb][NFC] Use default member initializers in ReadStringAndDumpToStreamOptions
Raphael Isemann [Tue, 24 Sep 2019 12:01:15 +0000 (12:01 +0000)]
[lldb][NFC] Use default member initializers in ReadStringAndDumpToStreamOptions

llvm-svn: 372736

4 years ago[ELF] Delete SectionBase::assigned
Fangrui Song [Tue, 24 Sep 2019 11:48:46 +0000 (11:48 +0000)]
[ELF] Delete SectionBase::assigned

D67504 removed uses of `assigned` from OutputSection::addSection, which
makes `assigned` purely used in processSectionCommands() and its
callees. By replacing its references with `parent`, we can remove
`assigned`.

Reviewed By: grimar

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

llvm-svn: 372735

4 years ago[ELF] Make MergeInputSection merging aware of output sections
Fangrui Song [Tue, 24 Sep 2019 11:48:31 +0000 (11:48 +0000)]
[ELF] Make MergeInputSection merging aware of output sections

Fixes PR38748

mergeSections() calls getOutputSectionName() to get output section
names. Two MergeInputSections may be merged even if they are made
different by SECTIONS commands.

This patch moves mergeSections() after processSectionCommands() and
addOrphanSections() to fix the issue. The new pass is renamed to
OutputSection::finalizeInputSections().

processSectionCommands() and addorphanSections() are changed to add
sections to InputSectionDescription::sectionBases.

finalizeInputSections() merges MergeInputSections and migrates
`sectionBases` to `sections`.

For the -r case, we drop an optimization that tries keeping sh_entsize
non-zero. This is for the simplicity of addOrphanSections(). The
updated merge-entsize2.s reflects the change.

Reviewed By: grimar

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

llvm-svn: 372734

4 years ago[IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings...
Simon Pilgrim [Tue, 24 Sep 2019 11:40:45 +0000 (11:40 +0000)]
[IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

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

llvm-svn: 372733

4 years agoLoopVectorize - silence static analyzer dyn_cast<CmpInst> null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:27:38 +0000 (11:27 +0000)]
LoopVectorize - silence static analyzer dyn_cast<CmpInst> null dereference warning. NFCI.

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

llvm-svn: 372732

4 years ago[tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM
Kamil Rytarowski [Tue, 24 Sep 2019 11:22:34 +0000 (11:22 +0000)]
[tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM

Summary: Add support for sanitizing TableGen.cpp with ASan/GCC and LSan/LLVM.

Reviewers: fjricci, kcc, aaron.ballman, mgorny

Reviewed By: fjricci

Subscribers: jakubjelinek, llvm-commits, #llvm

Tags: #llvm

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

llvm-svn: 372731

4 years ago[TSAN] Add read/write range interface functions with PC
Joachim Protze [Tue, 24 Sep 2019 11:19:02 +0000 (11:19 +0000)]
[TSAN] Add read/write range interface functions with PC

Adding annotation function variants __tsan_write_range_pc and
__tsan_read_range_pc to annotate ranged access to memory while providing a
program counter for the access.

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

llvm-svn: 372730

4 years ago[lldb] Use convert_to_slash in CppModuleConfiguration
Raphael Isemann [Tue, 24 Sep 2019 11:17:38 +0000 (11:17 +0000)]
[lldb] Use convert_to_slash in CppModuleConfiguration

That's what we actually want to do. Might fix the Windows bot.

llvm-svn: 372729

4 years ago[SimplifyCFG] FoldTwoEntryPHINode - silence static analyzer null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:20 +0000 (11:17 +0000)]
[SimplifyCFG] FoldTwoEntryPHINode - silence static analyzer null dereference warning. NFCI.

Assert that we've found the DomBlock.

llvm-svn: 372728

4 years agoSimplifyCFG - silence static analyzer dyn_cast<LandingPadInst> null dereference warni...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:13 +0000 (11:17 +0000)]
SimplifyCFG - silence static analyzer dyn_cast<LandingPadInst> null dereference warning. NFCI.

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

llvm-svn: 372727

4 years agoSimplifyCFG - silence static analyzer dyn_cast<Instruction> null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:06 +0000 (11:17 +0000)]
SimplifyCFG - silence static analyzer dyn_cast<Instruction> null dereference warning. NFCI.

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

llvm-svn: 372726

4 years ago[clangd] Collect macros in the preamble region of the main file
Haojian Wu [Tue, 24 Sep 2019 11:14:06 +0000 (11:14 +0000)]
[clangd] Collect macros in the preamble region of the main file

Summary:
- store all macro references in the ParsedAST;
- unify the two variants of CollectMainFileMacros;

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 372725

4 years ago[lldb][NFC] Use llvm::StringRef in formatters::NSStringSummaryProvider
Raphael Isemann [Tue, 24 Sep 2019 11:00:37 +0000 (11:00 +0000)]
[lldb][NFC] Use llvm::StringRef in formatters::NSStringSummaryProvider

llvm-svn: 372724

4 years ago[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null...
Simon Pilgrim [Tue, 24 Sep 2019 10:58:42 +0000 (10:58 +0000)]
[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Assert that we've found the start of the MI schedule list.

llvm-svn: 372723

4 years ago[ARM] Split large widening MVE loads
David Green [Tue, 24 Sep 2019 10:53:09 +0000 (10:53 +0000)]
[ARM] Split large widening MVE loads

Similar to rL372717, we can force the splitting of extends of vector loads in
MVE, in order to use the better widening loads as opposed to going through
expensive extends. This adds a combine to early-on detect extends of loads and
split the load in two, from where normal legalisation will kick in and we get a
series of widening loads.

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

llvm-svn: 372721

4 years agolowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings...
Simon Pilgrim [Tue, 24 Sep 2019 10:46:30 +0000 (10:46 +0000)]
lowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings. NFCI.

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

llvm-svn: 372720

4 years ago[ARM] MVE sext and widen/narrow tests from larger types. NFC
David Green [Tue, 24 Sep 2019 10:39:58 +0000 (10:39 +0000)]
[ARM] MVE sext and widen/narrow tests from larger types. NFC

llvm-svn: 372719

4 years ago[ARM] Split large truncating MVE stores
David Green [Tue, 24 Sep 2019 10:10:41 +0000 (10:10 +0000)]
[ARM] Split large truncating MVE stores

MVE does not have a simple sign extend instruction that can move elements
across lanes. We currently often end up moving each lane into and out of a GPR,
in order to get elements into the correct places. When we have a store of a
trunc (or a extend of a load), we can instead just split the store/load in two,
using the narrowing/widening load/store instructions from each half of the
vector.

This does that for stores. It happens very early in a store combine, so as to
easily detect the truncates. (It would be possible to do this later, but that
would involve looking through a buildvector of extract elements. Not impossible
but this way seemed simpler).

By enabling store combines we also get a vmovdrr combine for free, helping some
other tests.

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

llvm-svn: 372717

4 years ago[lldb] Decouple importing the std C++ module from the way the program is compiled
Raphael Isemann [Tue, 24 Sep 2019 10:08:18 +0000 (10:08 +0000)]
[lldb] Decouple importing the std C++ module from the way the program is compiled

Summary:
At the moment, when trying to import the `std` module in LLDB, we look at the imported modules used in the compiled program
and try to infer the Clang configuration we need from the DWARF module-import. That was the initial idea but turned out to
cause a few problems or inconveniences:

* It requires that users compile their programs with C++ modules. Given how experimental C++ modules are makes this feature inaccessible
for many users. Also it means that people can't just get the benefits of this feature for free when we activate it by default
(and we can't just close all the associated bug reports).
* Relying on DWARF's imported module tags (that are only emitted by default on macOS) means this can only be used when using DWARF (and with -glldb on Linux).
* We essentially hardcoded the C standard library paths on some platforms (Linux) or just couldn't support this feature on other platforms (macOS).

This patch drops the whole idea of looking at the imported module DWARF tags and instead just uses the support files of the compilation unit.
If we look at the support files and see file paths that indicate where the C standard library and libc++ are, we can just create the module
configuration this information. This fixes all the problems above which means we can enable all the tests now on Linux, macOS and with other debug information
than what we currently had. The only debug information specific code is now the iteration over external type module when -gmodules is used (as `std` and also the
`Darwin` module are their own external type module with their own files).

The meat of this patch is the CppModuleConfiguration which looks at the file paths from the compilation unit and then figures out the include paths
based on those paths. It's quite conservative in that it only enables modules if we find a single C library and single libc++ library. It's still missing some
test mode where we try to compile an expression before we actually activate the config for the user (which probably also needs some caching mechanism),
but for now it works and makes the feature usable.

Reviewers: aprantl, shafik, jdoerfert

Reviewed By: aprantl

Subscribers: mgorny, abidh, JDevlieghere, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 372716

4 years ago[clang-tidy][test] Add -fexceptions to bugprone-infinite-loop.test
Fangrui Song [Tue, 24 Sep 2019 09:55:35 +0000 (09:55 +0000)]
[clang-tidy][test] Add -fexceptions to bugprone-infinite-loop.test

This fixes llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast.

-fexceptions is disabled by default on XCore and PS4.

llvm-svn: 372715

4 years ago[modularize] Fix compilation warning after r372681
Mikael Holmen [Tue, 24 Sep 2019 09:44:55 +0000 (09:44 +0000)]
[modularize] Fix compilation warning after r372681

In r372681 lang_cxx_11 and lang_cxx_14 were added to LanguageIDs
but they were not handled in the switch in VisitLinkageSpecDecl in
Modularize.cpp so at clang 8 complained with

/data/repo/master/clang-tools-extra/modularize/Modularize.cpp:583:13: error: enumeration values 'lang_cxx_11' and 'lang_cxx_14' not handled in switch [-Werror,-Wswitch]
    switch (D->getLanguage()) {
            ^
1 error generated.

With this patch we now treat lang_cxx, lang_cxx_11 and lang_cxx_14 the
same way in the switch in VisitLinkageSpecDecl.

llvm-svn: 372714

4 years agogn build: Merge r372712
GN Sync Bot [Tue, 24 Sep 2019 09:43:29 +0000 (09:43 +0000)]
gn build: Merge r372712

llvm-svn: 372713

4 years ago [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Seiya Nuta [Tue, 24 Sep 2019 09:38:23 +0000 (09:38 +0000)]
 [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.

Summary:
This patch splits the command-line parsing into two phases:

First, parse cross-platform options and leave ELF-specific options unparsed.

Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.

Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay

Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay

Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 372712

4 years ago[clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbot
Fangrui Song [Tue, 24 Sep 2019 09:32:00 +0000 (09:32 +0000)]
[clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbot

llvm-svn: 372711

4 years agoMCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH
Pavel Labath [Tue, 24 Sep 2019 09:31:02 +0000 (09:31 +0000)]
MCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH

Summary:
The functions different in two ways:
- getLLVMRegNum could return both "eh" and "other" dwarf register
  numbers, while getLLVMRegNumFromEH only returned the "eh" number.
- getLLVMRegNum asserted if the register was not found, while the second
  function returned -1.

The second distinction was pretty important, but it was very hard to
infer that from the function name. Aditionally, for the use case of
dumping dwarf expressions, we needed a function which can work with both
kinds of number, but does not assert.

This patch solves both of these issues by merging the two functions into
one, returning an Optional<unsigned> value. While the same thing could
be achieved by adding an "IsEH" argument to the (renamed)
getLLVMRegNumFromEH function, it seemed better to avoid the confusion of
two functions and put the choice of asserting into the hands of the
caller -- if he checks the Optional value, he can safely process
"untrusted" input, and if he blindly dereferences the Optional, he gets
the assertion.

I've updated all call sites to the new API, choosing between the two
options according to the function they were calling originally, except
that I've updated the usage in DWARFExpression.cpp to use the "safe"
method instead, and added a test case which would have previously
triggered an assertion failure when processing (incorrect?) dwarf
expressions.

Reviewers: dsanders, arsenm, JDevlieghere

Subscribers: wdng, aprantl, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 372710

4 years ago[NFC] Update test after r372708
David Bolvansky [Tue, 24 Sep 2019 09:24:48 +0000 (09:24 +0000)]
[NFC] Update test after r372708

llvm-svn: 372709

4 years ago[Diagnostics] Do not diagnose unsigned shifts in boolean context (-Wint-in-bool-context)
David Bolvansky [Tue, 24 Sep 2019 09:14:33 +0000 (09:14 +0000)]
[Diagnostics] Do not diagnose unsigned shifts in boolean context (-Wint-in-bool-context)

I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts.

llvm-svn: 372708

4 years agogn build: Merge r372706
GN Sync Bot [Tue, 24 Sep 2019 09:11:31 +0000 (09:11 +0000)]
gn build: Merge r372706

llvm-svn: 372707

4 years ago[clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test from...
Fangrui Song [Tue, 24 Sep 2019 09:06:31 +0000 (09:06 +0000)]
[clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test from D64736

llvm-svn: 372706

4 years ago[ASTImporter] 4th attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 09:00:46 +0000 (09:00 +0000)]
[ASTImporter] 4th attempt to fix Windows buildbot test errors

llvm-svn: 372705

4 years agoRevert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious...
Simon Pilgrim [Tue, 24 Sep 2019 08:56:44 +0000 (08:56 +0000)]
Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

Differential Revision: https://reviews.llvm.org/D64736
-------
Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule"

llvm-svn: 372704

4 years ago[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.
Alexey Lapshin [Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)]
[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Induction Variable Simplification pass does not update dbg.value intrinsic.

Before:

%add = add nuw nsw i32 %ArgIndex.06, 1
call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression())

After:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression())

There should be:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression())

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

llvm-svn: 372703

4 years ago[lldb][NFC] Relax completion tests for log command to make them pass on Linux
Raphael Isemann [Tue, 24 Sep 2019 08:41:10 +0000 (08:41 +0000)]
[lldb][NFC] Relax completion tests for log command to make them pass on Linux

The log channels change depending on platform, so listing them breaks on
some platforms. Let's just check that the 'lldb' and 'dwarf' channels are
there which are independent of platform.

llvm-svn: 372701

4 years ago[LLDB] Avoid warnings about redefining posix mode defines on MinGW
Martin Storsjo [Tue, 24 Sep 2019 08:39:12 +0000 (08:39 +0000)]
[LLDB] Avoid warnings about redefining posix mode defines on MinGW

Since these defines were added in LLVM SVN r189364 in 2013,
mingw-w64 got defines for S_I?GRP, S_IRWXG, S_I?OTH and S_IRWXO
in 2015.

Also change the existing defined(_MSC_VER) into ifndef S_IRUSR, for
consistency.

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

llvm-svn: 372700

4 years ago[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures
Martin Storsjo [Tue, 24 Sep 2019 08:39:06 +0000 (08:39 +0000)]
[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures

While debugging on those architectures might not be supported yet,
the generic code should still be buildable. This file accesses x86
specific fields in the CONTEXT struct.

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

llvm-svn: 372699

4 years agosanitizer_common: fix freebsd build error
Dmitry Vyukov [Tue, 24 Sep 2019 08:27:51 +0000 (08:27 +0000)]
sanitizer_common: fix freebsd build error

Variable flags is not used. Remove it.

Suggested-by: randall77 (Keith Randall)
Review: https://reviews.llvm.org/D67928
llvm-svn: 372698

4 years ago[lldb] Fix log output and UtilityTests/LogChannelTest.List
Raphael Isemann [Tue, 24 Sep 2019 08:20:05 +0000 (08:20 +0000)]
[lldb] Fix log output and UtilityTests/LogChannelTest.List

I refactored this code in 372691 and it seems I didn't fully
replicate the original log output, so that test was failing.

llvm-svn: 372696

4 years ago[LV] Forced vectorization with runtime checks and OptForSize
Sjoerd Meijer [Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)]
[LV] Forced vectorization with runtime checks and OptForSize

When vectorisation is forced with a pragma, we optimise for min size, and we
need to emit runtime memory checks, then allow this code growth and don't run
in an assert like we currently do.

This is the result of D65197 and D66803, and was a use-case not really
considered before. If this now happens, we emit an optimisation remark warning
about the code-size expansion, which can be avoided by not forcing
vectorisation or possibly source-code modifications.

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

llvm-svn: 372694

4 years ago[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops
Adam Balogh [Tue, 24 Sep 2019 07:43:26 +0000 (07:43 +0000)]
[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

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

llvm-svn: 372693

4 years ago[lldb] Remove redundant argument lists in CompletionRequest
Raphael Isemann [Tue, 24 Sep 2019 07:22:44 +0000 (07:22 +0000)]
[lldb] Remove redundant argument lists in CompletionRequest

We currently have two lists in the CompletionRequest that we
inherited from the old API: The complete list of arguments ignoring
where the user requested completion and the list of arguments that
stops at the cursor. Having two lists of arguments is confusing
and can lead to subtle errors, so let's remove the complete list
until we actually need it.

llvm-svn: 372692

4 years ago[lldb] Add completion support for log enable/disable/list
Raphael Isemann [Tue, 24 Sep 2019 07:18:09 +0000 (07:18 +0000)]
[lldb] Add completion support for log enable/disable/list

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 372691

4 years agoIgnore generated @import statements in the expression evaluator
Raphael Isemann [Tue, 24 Sep 2019 06:58:39 +0000 (06:58 +0000)]
Ignore generated @import statements in the expression evaluator

Summary:
The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression
wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject
`@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling
and loading unrelated C++ modules because it thinks the user has requested that it should load them. As
the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths),
it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes
these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).

This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements
in the wrapper source code. This is done by check if the import happens in the fake source file containing
our wrapper code (which implies it was generated by LLDB).

This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)

Reviewers: aprantl, shafik, jingham

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 372690