platform/upstream/llvm.git
3 years agoRevert "[CodeGen] emit CG profile for COFF object file"
Reid Kleckner [Tue, 22 Sep 2020 20:45:22 +0000 (13:45 -0700)]
Revert "[CodeGen] emit CG profile for COFF object file"

This reverts commit 91aed9bf975f1e4346cc8f4bdefc98436386ced2, it is
causing link errors.

3 years ago[LoopInfo] empty() -> isInnermost(), add isOutermost()
Stefanos Baziotis [Tue, 22 Sep 2020 20:28:00 +0000 (23:28 +0300)]
[LoopInfo] empty() -> isInnermost(), add isOutermost()

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

3 years ago[AArch64] Avoid pairing loads with same result reg
Congzhe Cao [Tue, 22 Sep 2020 20:21:27 +0000 (16:21 -0400)]
[AArch64] Avoid pairing loads with same result reg

When pairing ldr instructions to an ldp instruction, we cannot pair two ldr
destination registers where one is a sub or super register of the other.

Reviewed By: fhahn

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

3 years ago[ThinLTO] Option to bypass function importing.
Mircea Trofin [Wed, 16 Sep 2020 19:08:15 +0000 (12:08 -0700)]
[ThinLTO] Option to bypass function importing.

This completes the circle, complementing -lto-embed-bitcode
(specifically, post-merge-pre-opt). Using -thinlto-assume-merged skips
function importing. The index file is still needed for the other data it
contains.

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

3 years ago[compiler-rt][AIX] Add CMake support for 32-bit Power builds
David Tenty [Thu, 3 Sep 2020 15:40:13 +0000 (11:40 -0400)]
[compiler-rt][AIX] Add CMake support for 32-bit Power builds

This patch enables support for building compiler-rt builtins for 32-bit
Power arch on AIX. For now, we leave out the specialized ppc builtin
implementations for 128-bit long double and friends since those will
need some special handling for AIX.

Reviewed By: hubert.reinterpretcast

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

3 years ago[lldb][test] Remove accidental import pdb in 783dc7dc7ed7487d0782c2feb8854df949b98e69
Fangrui Song [Tue, 22 Sep 2020 20:08:12 +0000 (13:08 -0700)]
[lldb][test] Remove accidental import pdb in 783dc7dc7ed7487d0782c2feb8854df949b98e69

3 years agoTwo patches to fix the broken build.
Paul C. Anagnostopoulos [Tue, 22 Sep 2020 19:55:51 +0000 (15:55 -0400)]
Two patches to fix the broken build.
One to fix a C++ compiler warning.
One to allow Sphinx to find a new document.

3 years agoRevert "The wrong placement of add pass with optimizations led to -funique-internal...
Sriraman Tallam [Tue, 22 Sep 2020 19:12:21 +0000 (12:12 -0700)]
Revert "The wrong placement of add pass with optimizations led to -funique-internal-linkage-names being disabled."

This reverts commit 6950db36d33d85d18e3241ab6c87494c05ebe0fb.

3 years ago[flang][msvc] Explicitly reference "this" inside closure. NFC.
Michael Kruse [Tue, 22 Sep 2020 19:20:37 +0000 (14:20 -0500)]
[flang][msvc] Explicitly reference "this" inside closure. NFC.

The Microsoft compiler seems to have difficulties to decide between a const/non-const method of a captured object context in a closure. The error message is:
```
symbol.cpp(261): error C2668: 'Fortran::semantics::Symbol::detailsIf': ambiguous call to overloaded function
symbol.h(535): note: could be 'const D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void) const'
symbol.h(534): note: or       'D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void)'
symbol.cpp(261): note: while trying to match the argument list '()'
```
Explicitly using the this-pointer resolves this problem.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

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

3 years ago[flang][msvc] Add explicit function template argument to applyLamda. NFC.
Michael Kruse [Tue, 22 Sep 2020 19:19:40 +0000 (14:19 -0500)]
[flang][msvc] Add explicit function template argument to applyLamda. NFC.

Like in D87961, msvc has difficulties deducing the template argument. The error message is:
```
expr-parsers.cpp(383): error C2672: 'applyLambda': no matching overloaded function found
```
Explicitly pass the first template argument to help it.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

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

3 years ago[flang][msvc] Add explicit function template argument to applyFunction. NFC.
Michael Kruse [Tue, 22 Sep 2020 19:17:46 +0000 (14:17 -0500)]
[flang][msvc] Add explicit function template argument to applyFunction. NFC.

Msvc has difficulties deducing the template argument here. The error message is:
```
basic-parsers.h(790,12): error C2672: 'applyFunction': no matching overloaded function found
```
Explicitly pass the first template argument to help it.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

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

3 years agoRevert "[lldb] XFAIL TestMemoryHistory on Linux"
Raphael Isemann [Tue, 22 Sep 2020 19:13:44 +0000 (21:13 +0200)]
Revert "[lldb] XFAIL TestMemoryHistory on Linux"

This reverts commit 7518006d75accd21325747430d6bced66b2c5ada.

This test apparently works on the Swift CI ubuntu bot, so it shouldn't be
XFAIL'd on Linux.

3 years agoImplement a new kind of Pass: dynamic pass pipeline
Mehdi Amini [Tue, 22 Sep 2020 00:51:27 +0000 (00:51 +0000)]
Implement a new kind of Pass: dynamic pass pipeline

Instead of performing a transformation, such pass yields a new pass pipeline
to run on the currently visited operation.
This feature can be used for example to implement a sub-pipeline that
would run only on an operation with specific attributes. Another example
would be to compute a cost model and dynamic schedule a pipeline based
on the result of this analysis.

Discussion: https://llvm.discourse.group/t/rfc-dynamic-pass-pipeline/1637

Recommit after fixing an ASAN issue: the callback lambda needs to be
allocated to a temporary to have its lifetime extended to the end of the
current block instead of just the current call expression.

Reviewed By: silvas

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

3 years ago[CVP] Narrow SDiv/SRem to the smallest power-of-2 that's sufficient to contain its...
Roman Lebedev [Tue, 22 Sep 2020 13:33:18 +0000 (16:33 +0300)]
[CVP] Narrow SDiv/SRem to the smallest power-of-2 that's sufficient to contain its operands

This is practically identical to what we already do for UDiv/URem:
  https://rise4fun.com/Alive/04K

Name: narrow udiv
Pre: C0 u<= 255 && C1 u<= 255
%r = udiv i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = udiv i8 %t0, %t1
%r = zext i8 %t2 to i16

Name: narrow exact udiv
Pre: C0 u<= 255 && C1 u<= 255
%r = udiv exact i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = udiv exact i8 %t0, %t1
%r = zext i8 %t2 to i16

Name: narrow urem
Pre: C0 u<= 255 && C1 u<= 255
%r = urem i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = urem i8 %t0, %t1
%r = zext i8 %t2 to i16

... only here we need to look for 'min signed bits', not 'active bits',
and there's an UB to be aware of:
  https://rise4fun.com/Alive/KG86
  https://rise4fun.com/Alive/LwR

Name: narrow sdiv
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128
%r = sdiv i16 C0, C1
  =>
%t0 = trunc i16 C0 to i9
%t1 = trunc i16 C1 to i9
%t2 = sdiv i9 %t0, %t1
%r = sext i9 %t2 to i16

Name: narrow exact sdiv
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128
%r = sdiv exact i16 C0, C1
  =>
%t0 = trunc i16 C0 to i9
%t1 = trunc i16 C1 to i9
%t2 = sdiv exact i9 %t0, %t1
%r = sext i9 %t2 to i16

Name: narrow srem
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128
%r = srem i16 C0, C1
  =>
%t0 = trunc i16 C0 to i9
%t1 = trunc i16 C1 to i9
%t2 = srem i9 %t0, %t1
%r = sext i9 %t2 to i16

Name: narrow sdiv
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1)
%r = sdiv i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = sdiv i8 %t0, %t1
%r = sext i8 %t2 to i16

Name: narrow exact sdiv
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1)
%r = sdiv exact i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = sdiv exact i8 %t0, %t1
%r = sext i8 %t2 to i16

Name: narrow srem
Pre: C0 <= 127 && C1 <= 127 && C0 >= -128 && C1 >= -128 && !(C0 == -128 && C1 == -1)
%r = srem i16 C0, C1
  =>
%t0 = trunc i16 C0 to i8
%t1 = trunc i16 C1 to i8
%t2 = srem i8 %t0, %t1
%r = sext i8 %t2 to i16

The ConstantRangeTest.losslessSignedTruncationSignext test sanity-checks
the logic, that we can losslessly truncate ConstantRange to
`getMinSignedBits()` and signext it back, and it will be identical
to the original CR.

On vanilla llvm test-suite + RawSpeed, this fires 1262 times,
while the same fold for UDiv/URem only fires 384 times. Sic!

Additionally, this causes +606.18% (+1079) extra cases of
aggressive-instcombine.NumDAGsReduced, and +473.14% (+1145)
of aggressive-instcombine.NumInstrsReduced folds.

3 years ago[NFC][CVP] Add tests for SDiv/SRem narrowing
Roman Lebedev [Tue, 22 Sep 2020 14:33:39 +0000 (17:33 +0300)]
[NFC][CVP] Add tests for SDiv/SRem narrowing

3 years ago[NFC][CVP] Give a better name STATISTIC() counting udiv i16 -> udiv i8 xforms
Roman Lebedev [Tue, 22 Sep 2020 13:21:19 +0000 (16:21 +0300)]
[NFC][CVP] Give a better name STATISTIC() counting udiv i16 -> udiv i8 xforms

3 years ago[ConstantRange] Introduce getMinSignedBits() method
Roman Lebedev [Tue, 22 Sep 2020 12:51:25 +0000 (15:51 +0300)]
[ConstantRange] Introduce getMinSignedBits() method

Similar to the ConstantRange::getActiveBits(), and to similarly-named
methods in APInt, returns the bitwidth needed to represent
the given signed constant range

3 years ago[NFC][APInt] Refactor getMinSignedBits() in terms of getNumSignBits()
Roman Lebedev [Tue, 22 Sep 2020 18:34:31 +0000 (21:34 +0300)]
[NFC][APInt] Refactor getMinSignedBits() in terms of getNumSignBits()

This is fully identical to the old implementation, just easier to read.

3 years ago[NFC][CVP] processUDivOrURem(): refactor to use ConstantRange::getActiveBits()
Roman Lebedev [Tue, 22 Sep 2020 12:34:45 +0000 (15:34 +0300)]
[NFC][CVP] processUDivOrURem(): refactor to use ConstantRange::getActiveBits()

As an exhaustive test shows, this logic is fully identical to the old
implementation, with exception of the case where both of the operands
had empty ranges:

```
TEST_F(ConstantRangeTest, CVP_UDiv) {
  unsigned Bits = 4;
  EnumerateConstantRanges(Bits, [&](const ConstantRange &CR0) {
    if(CR0.isEmptySet())
      return;
    EnumerateConstantRanges(Bits, [&](const ConstantRange &CR1) {
      if(CR0.isEmptySet())
        return;

      unsigned MaxActiveBits = 0;
      for (const ConstantRange &CR : {CR0, CR1})
        MaxActiveBits = std::max(MaxActiveBits, CR.getActiveBits());

      ConstantRange OperandRange(Bits, /*isFullSet=*/false);
      for (const ConstantRange &CR : {CR0, CR1})
        OperandRange = OperandRange.unionWith(CR);
      unsigned NewWidth = OperandRange.getUnsignedMax().getActiveBits();

      EXPECT_EQ(MaxActiveBits, NewWidth) << CR0 << " " << CR1;
    });
  });
}
```

3 years ago[ConstantRange] Introduce getActiveBits() method
Roman Lebedev [Tue, 22 Sep 2020 12:17:24 +0000 (15:17 +0300)]
[ConstantRange] Introduce getActiveBits() method

Much like APInt::getActiveBits(), computes how many bits are needed
to be able to represent every value in this constant range,
treating the values as unsigned.

3 years ago[ConstantRange] binaryXor(): special-case binary complement case - the result is...
Roman Lebedev [Tue, 22 Sep 2020 08:50:25 +0000 (11:50 +0300)]
[ConstantRange] binaryXor(): special-case binary complement case - the result is precise

Use the fact that `~X` is equivalent to `-1 - X`, which gives us
fully-precise answer, and we only need to special-handle the wrapped case.

This fires ~16k times for vanilla llvm test-suite + RawSpeed.

3 years ago[CVP] Enhance SRem -> URem fold to work not just on non-negative operands
Roman Lebedev [Tue, 22 Sep 2020 07:37:15 +0000 (10:37 +0300)]
[CVP] Enhance SRem -> URem fold to work not just on non-negative operands

This is a continuation of 8d487668d09fb0e4e54f36207f07c1480ffabbfd,
the logic is pretty much identical for SRem:

Name: pos pos
Pre: C0 >= 0 && C1 >= 0
%r = srem i8 C0, C1
  =>
%r = urem i8 C0, C1

Name: pos neg
Pre: C0 >= 0 && C1 <= 0
%r = srem i8 C0, C1
  =>
%r = urem i8 C0, -C1

Name: neg pos
Pre: C0 <= 0 && C1 >= 0
%r = srem i8 C0, C1
  =>
%t0 = urem i8 -C0, C1
%r = sub i8 0, %t0

Name: neg neg
Pre: C0 <= 0 && C1 <= 0
%r = srem i8 C0, C1
  =>
%t0 = urem i8 -C0, -C1
%r = sub i8 0, %t0

https://rise4fun.com/Alive/Vd6

Now, this new logic does not result in any new catches
as of vanilla llvm test-suite + RawSpeed.
but it should be virtually compile-time free,
and it may be important to be consistent in their handling,
because if we had a pair of sdiv-srem, and only converted one of them,
-divrempairs will no longer see them as a pair,
and thus not "merge" them.

3 years ago[NFC][CVP] Add tests for srem with potentially different sigdness domains
Roman Lebedev [Mon, 21 Sep 2020 20:57:13 +0000 (23:57 +0300)]
[NFC][CVP] Add tests for srem with potentially different sigdness domains

3 years ago[test][NewPM] Pin do-nothing-intrinsic.ll to legacy PM
Arthur Eubanks [Tue, 22 Sep 2020 18:33:38 +0000 (11:33 -0700)]
[test][NewPM] Pin do-nothing-intrinsic.ll to legacy PM

It tests CallGraph infra around the legacy PM which isn't relevant in NPM.

3 years ago[LoopInfo][NewPM] Fix tests in Analysis/LoopInfo under NPM
Arthur Eubanks [Tue, 22 Sep 2020 18:30:05 +0000 (11:30 -0700)]
[LoopInfo][NewPM] Fix tests in Analysis/LoopInfo under NPM

3 years ago[lldb] Skip TestMiniDumpUUID with reproducers
Jonas Devlieghere [Tue, 22 Sep 2020 18:28:00 +0000 (11:28 -0700)]
[lldb] Skip TestMiniDumpUUID with reproducers

The modules not getting orphaned is wreaking havoc when the UUIDs match
between tests.

3 years ago[lldb] Skip test_common_completion_process_pid_and_name with reproducers
Jonas Devlieghere [Tue, 22 Sep 2020 18:06:09 +0000 (11:06 -0700)]
[lldb] Skip test_common_completion_process_pid_and_name with reproducers

This test launches a subprocess which will have a different PID during
capture and replay.

3 years ago[InstCombine] For pow(x, +/-0.5), stop falling into pow(x, 1.5), etc. case
Hubert Tong [Tue, 22 Sep 2020 18:04:13 +0000 (14:04 -0400)]
[InstCombine] For pow(x, +/-0.5), stop falling into pow(x, 1.5), etc. case

The current code for handling pow(x, y) where y is an integer plus 0.5
is not explicitly guarded against attempting to transform the case where
abs(y) is exactly 0.5.

The latter case is meant to be handled by `replacePowWithSqrt`. Indeed,
if the pow(x, integer+0.5) case proceeds past a certain point, it will
hit an assertion by attempting to form pow(x, 0) using `getPow`.

This patch adds an explicit check to prevent attempting the
pow(x, integer+0.5) transformation on pow(x, +/-0.5) as suggested during
the review of D87877. This has the effect of retaining the shrinking of
`pow` to `powf` when the `sqrt` libcall cannot be formed.

Reviewed By: spatel

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

3 years ago[NFC] Replace tabs with spaces in PPCInstrPrefix.td
Hubert Tong [Tue, 22 Sep 2020 18:01:58 +0000 (14:01 -0400)]
[NFC] Replace tabs with spaces in PPCInstrPrefix.td

3 years ago[test][MC] Rehabilitate llvm/test/MC/COFF/bigobj.py
Hubert Tong [Tue, 22 Sep 2020 17:59:00 +0000 (13:59 -0400)]
[test][MC] Rehabilitate llvm/test/MC/COFF/bigobj.py

The subject test was not actually running. This patch adds the
relevant suffix to the list of lit case filename extensions for the
enclosing directory.

Minor adjustments are also made to deal with bit rot.

Reviewed By: daltenty

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

3 years ago[clang] Fix a typo-correction crash
Haojian Wu [Tue, 22 Sep 2020 18:20:42 +0000 (20:20 +0200)]
[clang] Fix a typo-correction crash

We leave a dangling TypoExpr when typo-correction is performed
successfully in `checkArgsForPlaceholders`, which leads a crash in the
later TypoCorrection.

This code was added in https://github.com/llvm/llvm-project/commit/1586782767938df3a20f7abc4d8335c48b100bc4,
and it didn't seem to have enough test coverage.
The fix is to remove this part, and no failuer tests.

Reviewed By: rsmith

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

3 years ago[gn build] Port 8a64689e264
LLVM GN Syncbot [Tue, 22 Sep 2020 18:07:36 +0000 (18:07 +0000)]
[gn build] Port 8a64689e264

3 years ago[gn build] Port 848d66fafd2
LLVM GN Syncbot [Tue, 22 Sep 2020 18:07:35 +0000 (18:07 +0000)]
[gn build] Port 848d66fafd2

3 years ago[Analyzer][WebKit] UncountedLocalVarsChecker
Jan Korous [Thu, 6 Aug 2020 19:07:47 +0000 (11:07 -0800)]
[Analyzer][WebKit] UncountedLocalVarsChecker

Differential Review: https://reviews.llvm.org/D83259

3 years agoVersion 0.5 of the new "TableGen Backend Developer's Guide."
Paul C. Anagnostopoulos [Mon, 21 Sep 2020 17:56:06 +0000 (13:56 -0400)]
Version 0.5 of the new "TableGen Backend Developer's Guide."
Files modified to take comments into account.
MLIR documentation updated for new TableGen documentation files.

3 years ago[NFC][regalloc] Simplify/conform to style guide indvars in Greedy
Mircea Trofin [Mon, 21 Sep 2020 23:27:09 +0000 (16:27 -0700)]
[NFC][regalloc] Simplify/conform to style guide indvars in Greedy

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

3 years ago[ASTMatchers] Avoid recursion in ancestor matching to save stack space.
Sam McCall [Tue, 1 Sep 2020 18:22:59 +0000 (20:22 +0200)]
[ASTMatchers] Avoid recursion in ancestor matching to save stack space.

A recent change increased the stack size of memoizedMatchesAncestorOfRecursively
leading to stack overflows on real code involving large fold expressions.
It's not totally unreasonable to choke on very deep ASTs, but as common
infrastructure it's be nice if ASTMatchFinder is more robust.
(It already uses data recursion for the regular "downward" traversal.)

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

3 years ago[SyntaxTree] Test the List API
Eduardo Caldas [Thu, 17 Sep 2020 15:31:30 +0000 (15:31 +0000)]
[SyntaxTree] Test the List API

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

3 years ago[mlir][ods] Make OpBuilder and OperationState optional
Jacques Pienaar [Tue, 22 Sep 2020 17:04:21 +0000 (10:04 -0700)]
[mlir][ods] Make OpBuilder and OperationState optional

The OpBuilder is required to start with OpBuilder and OperationState, so remove
the need for the user to specify it. To make it simpler to update callers,
retain the legacy behavior for now and skip injecting OpBuilder/OperationState
when params start with OpBuilder.

Related to bug 47442.

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

3 years ago[mlir] NFC: fix trivial typos under include directory
Kazuaki Ishizaki [Tue, 22 Sep 2020 17:01:54 +0000 (02:01 +0900)]
[mlir] NFC: fix trivial typos under include directory

Reviewed By: mravishankar, jpienaar

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

3 years ago[PowerPC] Implement Vector String Isolate Builtins in Clang/LLVM
Amy Kwan [Tue, 22 Sep 2020 14:41:16 +0000 (09:41 -0500)]
[PowerPC] Implement Vector String Isolate Builtins in Clang/LLVM

This patch implements the vector string isolate (predicate and non-predicate
versions) builtins. The predicate builtins are custom selected within PPCISelDAGToDAG.

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

3 years ago[PowerPC] Implement the 128-bit Vector Divide Extended Builtins in Clang/LLVM
Amy Kwan [Tue, 22 Sep 2020 14:40:45 +0000 (09:40 -0500)]
[PowerPC] Implement the 128-bit Vector Divide Extended Builtins in Clang/LLVM

This patch implements the 128-bit vector divide extended builtins in Clang/LLVM.
These builtins map to the vdivesq and vdiveuq instructions respectively.

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

3 years ago[DAG] Remove DAGTypeLegalizer::GenWidenVectorTruncStores (PR42046)
Simon Pilgrim [Tue, 22 Sep 2020 16:17:20 +0000 (17:17 +0100)]
[DAG] Remove DAGTypeLegalizer::GenWidenVectorTruncStores (PR42046)

Just scalarize trunc stores - GenWidenVectorTruncStores does the same thing but is flawed (PR42046) and unused.

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

3 years agoSilence 'warning: unused variable' when compiling with Clang 10.0
Alexandre Ganea [Tue, 22 Sep 2020 16:05:11 +0000 (12:05 -0400)]
Silence 'warning: unused variable' when compiling with Clang 10.0

3 years ago[sanitizer_common] Add debug print to sysmsg.c
Matt Morehouse [Tue, 22 Sep 2020 16:08:49 +0000 (09:08 -0700)]
[sanitizer_common] Add debug print to sysmsg.c

3 years ago[lld-macho] Make lld::getInteger() tolerate leading "0x"/"0X" when base is 16
Greg McGary [Tue, 22 Sep 2020 02:02:12 +0000 (19:02 -0700)]
[lld-macho] Make lld::getInteger() tolerate leading "0x"/"0X" when base is 16

ld64 is cool with leading `0x` for hex command-line args, and we should be also.

Reviewed By: #lld-macho, int3

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

3 years ago[OpenMPOpt] Refactored "issue" and "wait" declarations for data map runtime call.
Hamilton Tobon Mosquera [Tue, 22 Sep 2020 15:45:43 +0000 (10:45 -0500)]
[OpenMPOpt] Refactored "issue" and "wait" declarations for data map runtime call.

Refactored __tgt_target_data_begin_mapper_<issue|wait> to receive the handle as an input/output argument.
This given the compiler warning of returning the handle as copy.

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

3 years agoSema: introduce `__attribute__((__swift_name__))`
Saleem Abdulrasool [Thu, 10 Sep 2020 21:15:37 +0000 (21:15 +0000)]
Sema: introduce `__attribute__((__swift_name__))`

This introduces the new `swift_name` attribute that allows annotating
APIs with an alternate spelling for Swift.  This is used as part of the
importing mechanism to allow interfaces to be imported with a new name
into Swift.  It takes a parameter which is the Swift function name.
This parameter is validated to check if it matches the possible
transformed signature in Swift.

This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c

Differential Revision: https://reviews.llvm.org/D87534
Reviewed By: Aaron Ballman, Dmitri Gribenko

3 years ago[DI][ASan][NewPM] Fix some DebugInfo ASan tests under NPM
Arthur Eubanks [Tue, 22 Sep 2020 15:27:46 +0000 (08:27 -0700)]
[DI][ASan][NewPM] Fix some DebugInfo ASan tests under NPM

3 years ago[ThinLTO] Re-order modules for optimal multi-threaded processing
Alexandre Ganea [Tue, 22 Sep 2020 15:24:36 +0000 (11:24 -0400)]
[ThinLTO] Re-order modules for optimal multi-threaded processing

Re-use an optimizition from the old LTO API (used by ld64).
This sorts modules in ascending order, based on bitcode size, so that larger modules are processed first. This allows for smaller modules to be process last, and better fill free threads 'slots', and thusly allow for better multi-thread load balancing.

In our case (on dual Intel Xeon Gold 6140, Windows 10 version 2004, two-stage build), this saves 15 sec when linking `clang.exe` with LLD & `-flto=thin`, `/opt:lldltojobs=all`, no ThinLTO cache, -DLLVM_INTEGRATED_CRT_ALLOC=d:\git\rpmalloc.

Before patch: 102 sec
After patch: 85 sec

Inspired by the work done by David Callahan in D60495.

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

3 years ago[scudo][standalone] Remove the pthread key from the shared TSD
Kostya Kortchinsky [Mon, 21 Sep 2020 21:09:37 +0000 (14:09 -0700)]
[scudo][standalone] Remove the pthread key from the shared TSD

https://reviews.llvm.org/D87420 removed the uses of the pthread key,
but the key itself was left in the shared TSD registry. It is created
on registry initialization, and destroyed on registry teardown.

There is really no use for it now, so we can just remove it.

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

3 years ago[GVNSink][NewPM] Add GVNSinkPass to PassRegistry.def
Arthur Eubanks [Tue, 22 Sep 2020 15:20:11 +0000 (08:20 -0700)]
[GVNSink][NewPM] Add GVNSinkPass to PassRegistry.def

3 years ago[libc++] Implement C++20's P0784 (More constexpr containers)
Louis Dionne [Thu, 17 Sep 2020 16:06:13 +0000 (12:06 -0400)]
[libc++] Implement C++20's P0784 (More constexpr containers)

This commit adds std::construct_at, and marks various members of
std::allocator_traits and std::allocator as constexpr. It also adds
tests and turns the existing tests into hybrid constexpr/runtime tests.

Thanks to Richard Smith for initial work on this, and to Michael Park
for D69803, D69132 and D69134, which are superseded by this patch.

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

3 years ago[AIX][compiler-rt] Use the AR/ranlib mode flag for 32-bit and 64-bit mode
David Tenty [Thu, 2 Jan 2020 15:11:59 +0000 (10:11 -0500)]
[AIX][compiler-rt] Use the AR/ranlib mode flag for 32-bit and 64-bit mode

since we will be building both 32-bit and 64-bit compiler-rt builtins
from a single configuration.

Reviewed By: hubert.reinterpretcast

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

3 years ago[lld-macho] minimally handle option -dynamic
Greg McGary [Mon, 21 Sep 2020 20:21:45 +0000 (13:21 -0700)]
[lld-macho] minimally handle option -dynamic

Stifle the warning for unimplemented option `-dyamic`, since it is already the default. Add `Config::staticLink` and skeletal support for altering the flag, but otherwise leave the option `-static` as hidden and its warning in place.

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

3 years ago[VPlan] Add dump() helper to VPValue & VPRecipeBase.
Florian Hahn [Mon, 14 Sep 2020 16:54:17 +0000 (17:54 +0100)]
[VPlan] Add dump() helper to VPValue & VPRecipeBase.

This provides a convenient way to print VPValues and recipes in a
debugger. In particular it saves the user from instantiating
VPSlotTracker to print recipes or values.

3 years ago[PeepholeOptimizer] Enhance the redundant COPY elimination.
Michael Liao [Fri, 18 Sep 2020 19:14:32 +0000 (15:14 -0400)]
[PeepholeOptimizer] Enhance the redundant COPY elimination.

- Eliminate redundant COPYs from the same register & subregister pair.

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

3 years ago[X86] Add missing namespace closure comments. NFCI.
Simon Pilgrim [Tue, 22 Sep 2020 13:49:16 +0000 (14:49 +0100)]
[X86] Add missing namespace closure comments. NFCI.

Fixes some clang-tidy llvm-namespace-comment warnings.

3 years ago[X86] Cleanup/add namespace closure comments. NFCI.
Simon Pilgrim [Tue, 22 Sep 2020 13:47:37 +0000 (14:47 +0100)]
[X86] Cleanup/add namespace closure comments. NFCI.

Fixes some clang-tidy llvm-namespace-comment warnings.

3 years ago[AIX][clang][driver] Make sure crti[_64].o is linked in C++ mode
David Tenty [Tue, 4 Aug 2020 15:51:28 +0000 (11:51 -0400)]
[AIX][clang][driver] Make sure crti[_64].o is linked in C++ mode

since crti is required for functional static initialization.

Reviewed By: hubert.reinterpretcast

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

3 years ago[NFC][mlir] Remove llvm:: prefix from SmallVector in parallel pretty printer.
David Truby [Mon, 21 Sep 2020 15:13:54 +0000 (16:13 +0100)]
[NFC][mlir] Remove llvm:: prefix from SmallVector in parallel pretty printer.

This prefix is unnecessary as SmallVector is re-exported in the mlir namespace.

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

3 years ago[PowerPC] Fix for compiler side issue in PCRelative Local Exec
Stefan Pintilie [Tue, 22 Sep 2020 10:50:48 +0000 (05:50 -0500)]
[PowerPC] Fix for compiler side issue in PCRelative Local Exec

Stop combining loads and stores with PPCISD::ADD_TLS before we can merge the
node with with TLS_LOCAL_EXEC_MAT_ADDR. The issue is that
TLS_LOCAL_EXEC_MAT_ADDR cannot be selected by itself and requires the previous
ADD_TLS node that goes with it. However, we sometimes try to combine ADD_TLS
with loads and stores that come after it. If this happens then the ADD_TLS is
removed and TLS_LOCAL_EXEC_MAT_ADDR cannot be selected.

While this bug fix will address the issue it my not be ideal from a performance
perspective as we may be able to add patterns to combine TLS_LOCAL_EXEC_MAT_ADDR
with ADD_TLS with the load and store that comes after it all in one. However,
this is beyond the scope of this patch.

Reviewed By: NeHuang

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

3 years ago[SLP] reduce code duplication for checking parent block; NFC
Sanjay Patel [Mon, 21 Sep 2020 21:31:57 +0000 (17:31 -0400)]
[SLP] reduce code duplication for checking parent block; NFC

3 years ago[SLP] move misplaced code comments; NFC
Sanjay Patel [Mon, 21 Sep 2020 21:22:58 +0000 (17:22 -0400)]
[SLP] move misplaced code comments; NFC

3 years ago[SLP] clean up code in gather(); NFC
Sanjay Patel [Mon, 21 Sep 2020 20:23:31 +0000 (16:23 -0400)]
[SLP] clean up code in gather(); NFC

1. Use range for-loop to avoid repeatedly accessing end index.
2. Better variable names.

3 years ago[SyntaxTree] Add tests for the assignment of the `canModify` tag.
Eduardo Caldas [Tue, 22 Sep 2020 09:11:58 +0000 (09:11 +0000)]
[SyntaxTree] Add tests for the assignment of the `canModify` tag.

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

3 years ago[MLIR][Standard] Add `atan` to standard dialect
Frederik Gossen [Tue, 22 Sep 2020 13:15:19 +0000 (13:15 +0000)]
[MLIR][Standard] Add `atan` to standard dialect

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

3 years ago[SLP] Merge null and dyn_cast<> checks into dyn_cast_or_null<>. NFCI.
Simon Pilgrim [Tue, 22 Sep 2020 12:44:35 +0000 (13:44 +0100)]
[SLP] Merge null and dyn_cast<> checks into dyn_cast_or_null<>. NFCI.

3 years ago[libc++] NFC: Remove trailing whitespace from the feature test macro table
Louis Dionne [Tue, 22 Sep 2020 12:38:57 +0000 (08:38 -0400)]
[libc++] NFC: Remove trailing whitespace from the feature test macro table

3 years ago[ARM] Trying to fix asan buildbot
Sam Parker [Tue, 22 Sep 2020 12:33:09 +0000 (13:33 +0100)]
[ARM] Trying to fix asan buildbot

3 years ago[LLD][PowerPC][test] Update thunk range error report for PPC64PCRelLongBranchThunk
Victor Huang [Tue, 22 Sep 2020 12:37:54 +0000 (07:37 -0500)]
[LLD][PowerPC][test] Update thunk range error report for PPC64PCRelLongBranchThunk

Update the thunk range error report for PPC64PCRelLongBranchThunk and add a range
error test case for PPC64R12SetupStub.

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

3 years ago[SystemZ][z/OS] Set default wchar_t type for zOS
Abhina Sreeskantharajan [Fri, 18 Sep 2020 16:47:31 +0000 (12:47 -0400)]
[SystemZ][z/OS] Set default wchar_t type for zOS

Set the default wchar_t type on z/OS, and unsigned as the default.

Reviewed By: hubert.reinterpretcast, fanbo-meng

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

3 years ago[SCEV] Handle `less` predicates for FoundPred = NE
Max Kazantsev [Tue, 22 Sep 2020 11:44:18 +0000 (18:44 +0700)]
[SCEV] Handle `less` predicates for FoundPred = NE

Currently these predicates are ignored, yet their handling is
pretty simple. I could not find a single test where it would
actually change something, but it's only because isImpliedCondOperands
is not smart enough to prove it further on. Yet the situation when
we come there with `less` predicate is pretty common.

Differential Revision: https://reviews.llvm.org/D87890
Reviewed By: fhahn

3 years ago[ARM][TTI] Prevents constants in a min(max) or max(min) pattern from being hoisted...
Meera Nakrani [Tue, 22 Sep 2020 11:54:10 +0000 (11:54 +0000)]
[ARM][TTI] Prevents constants in a min(max) or max(min) pattern from being hoisted when in a loop

Changes TTI function getIntImmCostInst to take an additional Instruction parameter,
which enables us to be able to check it is part of a min(max())/max(min()) pattern that will match SSAT.
We can then mark the constant used as free to prevent it being hoisted so SSAT can still be generated.
Required minor changes in some non-ARM backends to allow for the optional parameter to be included.

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

3 years ago[lldb] Ignore certain Clang type sugar when creating the type name
Raphael Isemann [Tue, 22 Sep 2020 09:16:37 +0000 (11:16 +0200)]
[lldb] Ignore certain Clang type sugar when creating the type name

Clang has some type sugar that only serves as a way to preserve the way a user
has typed a certain type in the source code. These types are currently not
unwrapped when we query the type name for a Clang type, which means that this
type sugar actually influences what formatters are picked for a certain type.
Currently if a user decides to reference a type by doing `::GlobalDecl Var = 3;`,
the type formatter for `GlobalDecl` will not be used (as the type sugar
around the type gives it the name `::GlobalDecl`. The same goes for other ways
to spell out a type such as `auto` etc.

With this patch most of this type sugar gets stripped when the full type name is
calculated. Typedefs are not getting desugared as that seems counterproductive.
I also don't desugar atomic types as that's technically not type sugar.

Reviewed By: jarin

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

3 years agoRevert rGf835779160ec303 "[APFloat] multiplySignificand - always pass IEEEFloat as...
Simon Pilgrim [Tue, 22 Sep 2020 11:15:23 +0000 (12:15 +0100)]
Revert rGf835779160ec303 "[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI."

This reverts commit f835779160ec30340676918915526615a07e826e while I investigate some buildbot failures

3 years ago[PowerPC] Add support for R_PPC64_GOT_TPREL_PCREL34 used in TLS Initial Exec
Stefan Pintilie [Fri, 18 Sep 2020 18:08:46 +0000 (13:08 -0500)]
[PowerPC] Add support for R_PPC64_GOT_TPREL_PCREL34 used in TLS Initial Exec

Add Thread Local Storage Initial Exec support to LLD.

This patch adds the computation for the relocations as well as the relaxation from Initial Exec to Local Exec.

Initial Exec:
```
pld r9, x@got@tprel@pcrel
add r9, r9, x@tls@pcrel
```
or
```
pld r9, x@got@tprel@pcrel
lbzx r10, r9, x@tls@pcrel
```
Note that @tls@pcrel is actually encoded as R_PPC64_TLS with a one byte displacement.

For the above examples relaxing Intitial Exec to Local Exec:
```
paddi r9, r9, x@tprel
nop
```
or
```
paddi r9, r13, x@tprel
lbz r10, 0(r9)
```

Reviewed By: nemanjai, MaskRay, #powerpc

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

3 years ago[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.
Simon Pilgrim [Mon, 21 Sep 2020 19:11:36 +0000 (20:11 +0100)]
[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.

We do this in all other cases.

3 years ago[NFC][PowerPC]Add tests for multiply-by-constant.
Esme-Yi [Tue, 22 Sep 2020 10:25:02 +0000 (10:25 +0000)]
[NFC][PowerPC]Add tests for multiply-by-constant.

3 years ago[MLIR][Linalg] Fix assertion in dependency analysis
Frederik Gossen [Tue, 22 Sep 2020 10:03:43 +0000 (10:03 +0000)]
[MLIR][Linalg] Fix assertion in dependency analysis

The assertion falsely expected ranked memrefs only.  Now both, ranked and
unranked memrefs are allowed.

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

3 years ago[SCEV] Support unsigned predicates in isKnownPredicateViaNoOverflow
Max Kazantsev [Tue, 22 Sep 2020 10:03:52 +0000 (17:03 +0700)]
[SCEV] Support unsigned predicates in isKnownPredicateViaNoOverflow

SCEV should be able to prove facts like `x <u x+1<nuw>`.

Differential Revision: https://reviews.llvm.org/D88015
Reviewed By: lebedev.ri

3 years agoRevert "Implement a new kind of Pass: dynamic pass pipeline"
Thomas Joerg [Tue, 22 Sep 2020 10:00:29 +0000 (12:00 +0200)]
Revert "Implement a new kind of Pass: dynamic pass pipeline"

This reverts commit 385c3f43fceba227be2e4dce84a59075733541c1.

Test  mlir/test/Pass:dynamic-pipeline-fail-on-parent.mlir.test fails
when run with ASAN:

ERROR: AddressSanitizer: stack-use-after-scope on address ...

Reviewed By: bkramer, pifon2a

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

3 years ago[AMDGPU] More codegen patterns for v2i16/v2f16 build_vector
Jay Foad [Wed, 16 Sep 2020 15:44:31 +0000 (16:44 +0100)]
[AMDGPU] More codegen patterns for v2i16/v2f16 build_vector

It's simpler to do this at codegen time than to do ad-hoc constant
folding of machine instructions in SIFoldOperands.

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

3 years ago[ARM] Improve VPT predicate tracking
Sam Parker [Tue, 22 Sep 2020 08:22:11 +0000 (09:22 +0100)]
[ARM] Improve VPT predicate tracking

The VPTBlock has been modified to track the 'global' state of the
VPR, as well as the state for each block. Each object now just holds
a list of instructions that makeup the block, while static structures
hold the predicate information. This enables global access for
querying how both a VPT block and individual instructions are
predicated. These changes now allow us, again, to handle more
complicated cases where multiple instructions build a predicate
and/or where the same predicate in used in multiple blocks.

It doesn't, however, get us back to before the tracking was 'fixed'
as some extra logic will be required to properly handle VPT
instructions. Currently a VPT could be effectively predicated because
of it's inputs, but the existing logic will not detect that and so
will refuse to perform the transformation. This can be seen in
remat-vctp.ll test where we still don't perform the transform.

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

3 years agoRevert "Reapply Revert "RegAllocFast: Rewrite and improve""
Muhammad Omair Javaid [Tue, 22 Sep 2020 09:20:10 +0000 (14:20 +0500)]
Revert "Reapply Revert "RegAllocFast: Rewrite and improve""

This reverts commit 55f9f87da2c2ad791b9e62cccb1c035e037444fa.

Breaks following buildbots:
http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4306
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/9154

3 years ago[SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.
Eduardo Caldas [Mon, 21 Sep 2020 17:05:41 +0000 (17:05 +0000)]
[SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.

There can be Macros that are tagged with `modifiable`. Thus verifying
`canModifyAllDescendants` is not sufficient to avoid macros when deep
copying.

We think the `TokenBuffer` could inform us whether a `Token` comes from
a macro. We'll look into that when we can surface this information
easily, for instance in unit tests for `ComputeReplacements`.

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

3 years ago[llvm-readobj/elf] - Stop reporting invalid extended indexes in warnings for unnamed...
Georgii Rymar [Fri, 18 Sep 2020 12:21:54 +0000 (15:21 +0300)]
[llvm-readobj/elf] - Stop reporting invalid extended indexes in warnings for unnamed section symbols.

We have an issue with `getFullSymbolName`: it assumes that the symbol passed is
always in the `.symtab`, what is wrong. We might calculate and report a wrong index currently.
I've added a test case revealing that.

This patch adds the "symbol index" argument to `getFullSymbolName` signature,
what fixes the issue.

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

3 years ago[mlir][Linalg] Uniformize linalg.generic with named ops.
Nicolas Vasilache [Mon, 21 Sep 2020 19:30:42 +0000 (15:30 -0400)]
[mlir][Linalg] Uniformize linalg.generic with named ops.

This revision allows representing a reduction at the level of linalg on tensors for generic ops by uniformizing with the named ops approach.

3 years ago[MLIR] Add subf and rsqrt EDSC intrinsics
Eugene Zhulenev [Mon, 21 Sep 2020 19:28:30 +0000 (15:28 -0400)]
[MLIR] Add subf and rsqrt EDSC intrinsics

[MLIR] Add subf and rsqrt EDSC intrinsics

NOTE: Please merge it when ready.

Reviewed By: nicolasvasilache

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

3 years ago[ARM] Remove MVEDomain from VLDR/STR of P0
Sam Parker [Mon, 21 Sep 2020 10:34:06 +0000 (11:34 +0100)]
[ARM] Remove MVEDomain from VLDR/STR of P0

Remove the domain from the instructions and create a shouldInspect
helper for LowOverheadLoops which queries it or a vpr operand.

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

3 years ago[ARM] VPT validForTailPredication
Sam Parker [Wed, 16 Sep 2020 13:30:47 +0000 (14:30 +0100)]
[ARM] VPT validForTailPredication

Mark all VPT instructions as valid.

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

3 years ago[AArch64] Fix return type of Neon scalar comparison intrinsics
David Spickett [Mon, 21 Sep 2020 08:44:58 +0000 (09:44 +0100)]
[AArch64] Fix return type of Neon scalar comparison intrinsics

The following should have unsigned return types
but were signed:
vceqd_s64 vceqzd_s64 vcged_s64 vcgezd_s64
vcgtd_s64 vcgtzd_s64 vcled_s64 vclezd_s64
vcltd_s64 vcltzd_s64 vtstd_s64

See https://developer.arm.com/documentation/ihi0073/latest

Reviewed By: efriedma

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

3 years agoReapply: [clang-cl] Always interpret the LIB env var as separated with semicolons
Martin Storsjö [Sun, 20 Sep 2020 20:19:12 +0000 (23:19 +0300)]
Reapply: [clang-cl] Always interpret the LIB env var as separated with semicolons

When cross compiling with clang-cl, clang splits the INCLUDE env
variable around semicolons (clang/lib/Driver/ToolChains/MSVC.cpp,
MSVCToolChain::AddClangSystemIncludeArgs) and lld splits the
LIB variable similarly (lld/COFF/Driver.cpp,
LinkerDriver::addLibSearchPaths). Therefore, the consensus for
cross compilation with clang-cl and lld-link seems to be to use
semicolons, despite path lists normally being separated by colons
on unix and EnvPathSeparator being set to that.

Therefore, handle the LIB variable similarly in Clang, when
handling lib file arguments when driving linking via Clang.

This fixes commands like "clang-cl test.c -Fetest.exe kernel32.lib" in
a cross compilation setting. Normally, most users call (lld-)link
directly, but meson happens to use this command syntax for
has_function() tests.

Reapply: Change Program.h to define procid_t as ::pid_t. When included
in lldb/unittests/Host/NativeProcessProtocolTest.cpp, it is included
after an lldb namespace containing an lldb::pid_t typedef, followed
later by a "using namespace lldb;". Previously, Program.h wasn't
included in this translation unit, but now it ends up included
transitively from Process.h.

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

3 years agoRevert "[CMake] Use find_dependency in LLVMConfig.cmake"
Petr Hosek [Tue, 22 Sep 2020 07:24:15 +0000 (00:24 -0700)]
Revert "[CMake] Use find_dependency in LLVMConfig.cmake"

This reverts commit 247c4fc50720ed48db2464bbe59839eedbe16794 as it
broke the runtime build.

3 years ago[gn build] Port af582c9b0f3
LLVM GN Syncbot [Tue, 22 Sep 2020 06:47:54 +0000 (06:47 +0000)]
[gn build] Port af582c9b0f3

3 years ago[SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`
Eduardo Caldas [Wed, 16 Sep 2020 08:03:03 +0000 (08:03 +0000)]
[SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`

* Introduce `TreeTest.cpp` to unit test `Tree.h`
* Add `generateAllTreesWithShape` to generating test cases
* Add tests for `findFirstLeaf` and `findLastLeaf`
* Fix implementations of `findFirstLeaf` and `findLastLeaf` that had
been broken when empty `Tree` were present.

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

3 years ago[SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`
Eduardo Caldas [Mon, 21 Sep 2020 14:45:13 +0000 (14:45 +0000)]
[SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`

I also assured that there are no other functions unnecessarily using std::vector as argument.

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

3 years ago[CMake] Use append for CMAKE_REQUIRED_* variables
Petr Hosek [Tue, 22 Sep 2020 05:31:05 +0000 (22:31 -0700)]
[CMake] Use append for CMAKE_REQUIRED_* variables

This ensures that required includes and libraries such as -lm that
were added earlier aren't overwritten.

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

3 years ago[CMake] Use find_dependency in LLVMConfig.cmake
Petr Hosek [Tue, 22 Sep 2020 05:37:39 +0000 (22:37 -0700)]
[CMake] Use find_dependency in LLVMConfig.cmake

This prefered over find_package as find_dependency forwards the correct
parameters for QUIET and REQUIRED to find_package.

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

3 years ago[clang] Traverse init-captures while indexing
Nathan Ridge [Tue, 8 Sep 2020 00:10:45 +0000 (20:10 -0400)]
[clang] Traverse init-captures while indexing

Fixes https://github.com/clangd/clangd/issues/496

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