LLVM/llvm 354284libcxxabi/trunk/cmake/Modules HandleOutOfTreeLLVM.cmake

[libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include

This include doesn't seem to be needed for the standalone build (it's
not being used by libc++ build either), but introduces unnecessary
dependency because HandleOutOfTreeLLVM performs checks that require
a working C++ library. We shouldn't require a working C++ library to
build libc++abi or libc++ (it's what we're building after all).

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

LLVM/llvm 354283lldb/trunk/include/lldb/Symbol ClangASTImporter.h, lldb/trunk/lit/Reproducer TestClangFileRepro.test

[Reproducers] Make clang use lldb's VFS.

In r353906 we hooked up clang and lldb's reproducer infrastructure to
capture files used by clang. This patch adds the necessary logic to have
clang reuse the files from lldb's reproducer during replay.

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

LLVM/llvm 354282compiler-rt/trunk/lib/sanitizer_common sanitizer_stacktrace.cc, compiler-rt/trunk/lib/tsan/rtl tsan_rtl_report.cc

[Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frame

In compiler-rt we have the notion of a `fast` and a `slow` stack
unwinder. Darwin currently only supports the fast unwinder.

From reading the code, my understanding is that
`BufferedStackTrace::Unwind` can be called with `bp=0, stack_top=0,
stack_bottom=0, request_fast_unwind=false`. If
`request_fast_unwind=true`, then we alos need to supply bp, stack_top,
and stack_bottom.

However, `BufferedStackTrace::Unwind` uses
`StackTrace::WillUseFastUnwind` which will adapt `request_fast_unwind`
if the requested unwinder is not supported. On Darwin, the result is
that we don't pass actual values for bp, stack_top, and stack_bottom,
but end up using the fast unwinder. The tests then fail because we only
print the topmost stack frame.

This patch adds a check to `WillUseFastUnwind` at the point of usage to
avoid the mismatch between `request_fast_unwind` and what `Unwind`
actually does. I am also interested in cleaning up the
`request_fast_unwind` machinery so this patch just the simplest thing
possible so I can enable the tests.

Reviewers: vitalybuka, vsk

    [2 lines not shown]

LLVM/llvm 354281llvm/branches/release_80/docs ReleaseNotes.rst

[ReleaseNotes] Add note about removal of Nios2 backend. Add some notes on X86 changes.

LLVM/llvm 354280llvm/trunk/lib/CodeGen/GlobalISel LegalizerHelper.cpp, llvm/trunk/unittests/CodeGen/GlobalISel LegalizerHelperTest.cpp

GlobalISel: Fix double count of offset for irregular vector breakdowns

Fixes cases with odd vectors that break into multiple requested size

LLVM/llvm 354279llvm/trunk/test/CodeGen/X86 vector-trunc-math-widen.ll vector-trunc-math.ll

[x86] split more v8f32/v8i32 shuffles in lowering

Similar to D57867 - this is a small patch with lots of test diffs.
With half-vector-width narrowing potential, using an extract + 128-bit vshufps
is a win because it replaces a 256-bit shuffle with a 128-bit shufle.

This seems like it should be a win even for targets with 'fast-variable-shuffle',
but we are intentionally deferring that to an independent change to make sure
that is true.

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

LLVM/llvm 354278lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core TestLinuxCore.py

Un-XFAIL TestLinuxCore for windows

It turns out all that was needed to get this test passing was to fix the
python3 incompatibility.

LLVM/llvm 354277llvm/trunk/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/trunk/test/Transforms/InstCombine saturating-add-sub.ll

Revert "[InstCombine] reduce even more unsigned saturated add with 'not' op"

This reverts commit 079b610c29b4a428b3ae7b64dbac0378facf6632.
Bots are failing after this change on a stage 2 compile of clang.

LLVM/llvm 354276llvm/trunk/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/trunk/test/Transforms/InstCombine saturating-add-sub.ll

[InstCombine] reduce even more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:

  Name: uaddsat, -1 fval
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %notx, %y
  %r = select i1 %c, i32 %a, i32 -1
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

  Name: uaddsat, -1 fval + ult
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %y, %notx
  %r = select i1 %c, i32 %a, i32 -1
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a

    [3 lines not shown]

LLVM/llvm 354275www/trunk/devmtg/2019-04 index.html talks.html

[EuroLLVM'19] spelling and html fixes.

LLVM/llvm 354274www/trunk/devmtg/2019-04 talks.html index.html

[EuroLLVM'19] Speaker update.

LLVM/llvm 354273lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core TestLinuxCore.py

Fix TestLinuxCore for python3

- dictionaries don't have iteritems()
- division returns floats

LLVM/llvm 354272clang-tools-extra/trunk/unittests/clangd XRefsTests.cpp

[clangd] Add tests for template specializations

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

Tags: #clang

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

LLVM/llvm 354271llvm/trunk/lib/MCA/HardwareUnits RegisterFile.cpp, llvm/trunk/test/tools/llvm-mca/X86/BtVer2 reg-move-elimination-6.s

[MCA] Correctly update register definitions in the PRF after move elimination.

This patch fixes a bug where register writes performed by optimizable register
moves were sometimes wrongly treated like partial register updates.  Before this
patch, llvm-mca wrongly predicted a 1.50 IPC for test reg-move-elimination-6.s
(added by this patch).  With this patch, llvm-mca correctly updates the register
defintions in the PRF, and the IPC for that test is now correctly reported as 2.

LLVM/llvm 354270llvm/trunk/tools/llvm-readobj ELFDumper.cpp

[llvm-readobj] - Simplify .gnu.version_d dumping.

This is similar to D58048.

Instead of scanning the dynamic table to read the
DT_VERDEFNUM, we could take it from the sh_info field.

The patch does this.

LLVM/llvm 354269www-releases/trunk download.html index.html

Change SVN to Git in text about the current version

LLVM/llvm 354268clang-tools-extra/trunk/clangd IncludeFixer.cpp IncludeFixer.h, clang-tools-extra/trunk/unittests/clangd DiagnosticsTests.cpp

[clangd] Cache include fixes for diagnostics caused by the same unresolved name or 
incomplete type.

Multiple diagnostics can be caused by the same unresolved name or incomplete type,
especially if the code is copy-pasted without #includes. The cache can avoid making
repetitive index requests, and thus reduce latency and allow more diagnostics to be
fixed (we limit the number of index requests for each parse).

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

LLVM/llvm 354267cfe/trunk/lib/AST ASTImporter.cpp, cfe/trunk/unittests/AST ASTImporterTest.cpp

[ASTImporter] Find previous friend function template

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

LLVM/llvm 354266clang-tools-extra/trunk/docs/clang-tidy index.rst

[clang-tidy] Fix links in docs.

LLVM/llvm 354265cfe/trunk/include/clang/Basic LangOptions.def, cfe/trunk/include/clang/Driver Options.td

[ARM] Add pre-defined macros for ROPI and RWPI

This adds ACLE-defined macros to test for code being compiled in the ROPI and
RWPI position-independence modes.

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

LLVM/llvm 354264llvm/trunk/include/llvm/ADT Optional.h, llvm/trunk/unittests/ADT OptionalTest.cpp

[NFC] Make Optional<T> trivially copyable when T is trivially copyable

This is a follow-up to r354246 and a reimplementation of 
that should not trigger any UB thanks to the use of an union.

This may still be subject to the problem solved by std::launder, but I'm unsure how it 
interacts whith union.
/me plans to revert if this triggers any relevant bot failure. At least this validates in 
Release mode with
clang 6.0.1 and gcc 4.8.5.

LLVM/llvm 354263lldb/trunk/include/lldb/Core Module.h, lldb/trunk/lit/Minidump breakpad-symbols.test

minidump: Add ability to attach (breakpad) symbol files to placeholder modules

This re-commits r353677, which was reverted due to test failures on the
windows bot. The issue there was that ObjectFilePECOFF vended its base
address through the incorrect interface. SymbolFilePDB depended on that,
which lead to assertion failures when SymbolFilePDB was attempting to
use the placeholder object files as a base. This has been fixed in

It also fixes one small problem in the original patch. The issue was that the
Module class would attempt to overwrite the object file we created in
CreateModuleFromObjectFile if the file corresponding to the placeholder object
file happened to exist (but we have already disqualified it due to UUID
mismatch. The fix is simple -- we set the m_did_load_objfile flag to properly
record the fact that we have already created an object file for the module.

The original commit message was:

The reason this wasn't working was that ProcessMinidump was creating odd
object-file-less modules, and SymbolFileBreakpad required the module to
have an associated object file because it needed to get its base

This fixes that by introducing a PlaceholderObjectFile to serve as a
dummy object file. The general idea for this is taken from D55142, but

    [15 lines not shown]

LLVM/llvm 354262cfe/trunk/lib/Index IndexTypeSourceInfo.cpp, cfe/trunk/test/Index index-refs.cpp

[clang][Index] Fix usage of IndexImplicitInstantiation

Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.

Subscribers: arphaman, jdoerfert, cfe-commits

Tags: #clang

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

LLVM/llvm 354261llvm/trunk/include/llvm/MCA Instruction.h, llvm/trunk/lib/MCA Instruction.cpp

[MCA] Slightly refactor method writeStartEvent in WriteState and ReadState. NFCI

This is another change in preparation for PR37494.
No functional change intended.

LLVM/llvm 354260llvm/branches release_80, llvm/branches/release_80/lib/Target/X86 X86ISelLowering.cpp

Merging r354034 and r354117:

r354034 | rksimon | 2019-02-14 15:45:32 +0100 (Thu, 14 Feb 2019) | 1 line

[X86][AVX] Add PR40730 test case

r354117 | rksimon | 2019-02-15 12:39:21 +0100 (Fri, 15 Feb 2019) | 9 lines

[X86][AVX] lowerShuffleAsLanePermuteAndPermute - fully populate the lane shuffle mask 

As detailed on PR40730, we are not correctly filling in the lane shuffle mask 
(D53148/rL344446) - we fill in for the correct src lane but don't add it to the correct 
mask element, so any reference to the correct element is likely to see an UNDEF mask 

This allows constant folding to propagate UNDEFs prior to the lane mask being (correctly) 
lowered to vperm2f128.

This patch fixes the issue by fully populating the lane shuffle mask - this is more than 
is necessary (if we only filled in the required mask elements we might be able to match 
other shuffle instructions - broadcasts etc.), but its the most cautious approach as this 

    [4 lines not shown]

LLVM/llvm 354259cfe/trunk/unittests/AST ASTImporterTest.cpp

[ASTImporter] Unify redecl chain tests as type parameterized tests

This patch unifies all those tests which check the correctness of the
redecl chains. Previously we had several structurally very similar test
cases for each language construct (class, function, variable, function
template, ...).

We still use value-parameterized tests for the different AST
compatibility switches (-fdelayed-template-parsing, -fms-compatibility).
Gtest makes it possible to have either value-parameterized or
type-parameterized fixtures. However, we cannot have both value- and
type-parameterized test fixtures. So we use a value-parameterized test
fixture in the gtest sense. We intend to mimic gtest's type-parameters
via the type template parameter. We manually instantiate the different
tests with the each types.

After this patch I am planning to put the "generic redecl chain" related
tests into their own separate test file (in another patch).

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

LLVM/llvm 354258lldb/trunk/lit/Modules/PECOFF basic-info.yaml, lldb/trunk/source/Plugins/ObjectFile/PECOFF ObjectFilePECOFF.cpp ObjectFilePECOFF.h

PECOFF: Implement GetBaseAddress

COFF files are modelled in lldb as having one big container section
spanning the entire module image, with the actual sections being
subsections of that. In this model, the base address is simply the
address of the first byte of that section.

This also removes the hack where ObjectFilePECOFF was using the
m_file_offset field to communicate this information. Using file offset
for this purpose is completely wrong, as that is supposed to indicate
where is this ObjectFile located in the file on disk. This field is only
meaningful for fat binaries, and should normally be 0.

Both PDB plugins have been updated to use GetBaseAddress instead of

LLVM/llvm 354257llvm/branches release_80, llvm/branches/release_80/lib/MC ELFObjectWriter.cpp

Merging r353907:
r353907 | rnk | 2019-02-13 02:39:32 +0100 (Wed, 13 Feb 2019) | 6 lines

[MC] Make symbol version errors non-fatal

We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.

Fixes PR40712

LLVM/llvm 354256lldb/trunk/source/Plugins/Process/gdb-remote GDBRemoteCommunication.cpp

Return better error message from GDBRemoteCommunication::ConnectLocally

LLVM/llvm 354255lldb/branches release_80, lldb/branches/release_80/source/Host/common MainLoop.cpp

Merging r354122:
r354122 | mgorny | 2019-02-15 13:13:02 +0100 (Fri, 15 Feb 2019) | 10 lines

[lldb] [MainLoop] Add kevent() EINTR handling

Add missing EINTR handling for kevent() calls.  If the call is
interrupted, return from Poll() as if zero events were returned and let
the polling resume on next iteration.  This fixes test flakiness
on NetBSD.

Includes a test case suggested by Pavel Labath on D42206.

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

LLVM/llvm 354254lldb/branches release_80, lldb/branches/release_80/source/Host/common MainLoop.cpp

Merging r354029:
r354029 | mgorny | 2019-02-14 14:52:31 +0100 (Thu, 14 Feb 2019) | 7 lines

[lldb] [MainLoop] Report errno for failed kevent()

Modify the kevent() error reporting to use errno rather than returning
the return value.  At least on FreeBSD and NetBSD, kevent() always
returns -1 in case of error, and the actual error is returned via errno.

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

LLVM/llvm 354253lldb/branches release_80, lldb/branches/release_80/source/Host/openbsd Host.cpp

Merging r353642:
r353642 | teemperor | 2019-02-10 16:23:58 +0100 (Sun, 10 Feb 2019) | 13 lines

lldb: Fix compilation on OpenBSD

Summary: Update the OpenBSD Host.cpp for the new SetFile() function signature. Fixes 
compiling lldb on OpenBSD.

Reviewers: krytarowski

Reviewed By: krytarowski

Subscribers: lldb-commits

Tags: #lldb

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

LLVM/llvm 354252llvm/branches release_80, llvm/branches/release_80/lib/Transforms/InstCombine InstructionCombining.cpp

Merging r354144:
r354144 | spatel | 2019-02-15 17:31:55 +0100 (Fri, 15 Feb 2019) | 3 lines

[InstCombine] fix crash while trying to narrow a binop of shuffles (PR40734)


LLVM/llvm 354251lldb/trunk CMakeLists.txt

Set cmake policy CMP0075 to NEW

The policy is about cmake_include_files ignoring
CMAKE_REQUIRED_LIBRARIES in the OLD behavior. Llvm already sets this
policy to NEW, but that is overridden by our cmake_minimum_required

This makes our cmake policy setup consistent with the llvm build files
and avoids a warning when using newer versions of cmake.

Reviewers: sgraenitz, xiaobai

Subscribers: mgorny, lldb-commits

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

LLVM/llvm 354250llvm/trunk/docs/CommandGuide llvm-exegesis.rst

[llvm-exegesis] [NFC] Fixing typo.

Reviewers: courbet, gchatelet

Reviewed By: courbet, gchatelet

Subscribers: tschuett, llvm-commits

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

LLVM/llvm 354249llvm/branches release_80, llvm/branches/release_80/lib/Transforms/Scalar MergeICmps.cpp

Merging r354128 and r354131:

r354128 | courbet | 2019-02-15 13:58:06 +0100 (Fri, 15 Feb 2019) | 1 line

[MergeICmps][NFC] Improve doc.

r354131 | courbet | 2019-02-15 15:17:17 +0100 (Fri, 15 Feb 2019) | 15 lines

[MergeICmps] Make base ordering really deterministic.

The idea is that we now manipulate bases through a `unsigned BaseID` based on
order of appearance in the comparison chain rather than through the `Value*`.

Fixes 40714.

Reviewers: gchatelet

Subscribers: mgrang, jfb, jdoerfert, llvm-commits, hans

Tags: #llvm

    [2 lines not shown]

LLVM/llvm 354248cfe/branches release_80, cfe/branches/release_80/lib/CodeGen CGDecl.cpp

Merging r354147:
r354147 | jfb | 2019-02-15 18:26:29 +0100 (Fri, 15 Feb 2019) | 27 lines

Variable auto-init of blocks capturing self after init bugfix

Blocks that capture themselves (and escape) after initialization currently codegen wrong 
because this:

  bool capturedByInit =
      Init && emission.IsEscapingByRef && isCapturedBy(D, Init);

  Address Loc =
      capturedByInit ? emission.Addr : emission.getObjectAddress(*this);

Already adjusts Loc from thr alloca to a GEP. This code:

    if (emission.IsEscapingByRef)
      Loc = emitBlockByrefAddress(Loc, &D, /*follow=*/false);

Was trying to do the same adjustment, and a GEP on a GEP (returning an int) triggers an 


    [9 lines not shown]

LLVM/llvm 354247cfe/branches release_80, cfe/branches/release_80/include/clang/AST Expr.h

Merging r354035:
r354035 | brunoricci | 2019-02-14 16:43:17 +0100 (Thu, 14 Feb 2019) | 23 lines

[Sema] Fix a regression introduced in "[AST][Sema] Remove CallExpr::setNumArgs"

D54902 removed CallExpr::setNumArgs in preparation of tail-allocating the
arguments of CallExpr. It did this by allocating storage for
max(number of arguments, number of parameters in the prototype). The
temporarily nulled arguments however causes issues in BuildResolvedCallExpr
when typo correction is done just after the creation of the call expression.

This was unfortunately missed by the tests /:

To fix this, delay setting the number of arguments to
max(number of arguments, number of parameters in the prototype) until we are
ready for it. It would be nice to have this encapsulated in CallExpr but this
is the best I can come up with under the constraint that we cannot add
anything the CallExpr.

Fixes PR40286.

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

Reviewed By: aaron.ballman

    [3 lines not shown]

LLVM/llvm 354246llvm/trunk/include/llvm/ADT Optional.h

Recommit [NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

LLVM/llvm 354245llvm/trunk/include/llvm/CodeGen SelectionDAGNodes.h, llvm/trunk/lib/CodeGen/SelectionDAG DAGCombiner.cpp SelectionDAGAddressAnalysis.cpp

Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."

Breaks some bots.

LLVM/llvm 354244llvm/trunk/include/llvm/CodeGen SelectionDAGNodes.h, llvm/trunk/lib/CodeGen/SelectionDAG DAGCombiner.cpp SelectionDAGAddressAnalysis.cpp

[DAGCombiner] Eliminate dead stores to stack.

A store to an object whose lifetime is about to end can be removed.

See PR40550 for motivation.

Reviewers: niravd

Subscribers: llvm-commits

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

LLVM/llvm 354243llvm/trunk/include/llvm/MC SubtargetFeature.h, llvm/trunk/lib/MC SubtargetFeature.cpp

[MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to hold 
the value.

This class is used for two difference tablegen generated tables. For one of the tables the 
Value FeatureBitset only has one bit set. For the other usage the Implies field was 

This patch changes the Value field to just be an unsigned. For the usage that put a real 
vector in bitset, we now use the previously unused Implies field and leave the Value field 
unused instead.

This is good for a 16K reduction in the size of llc on my local build with all targets 

LLVM/llvm 354242llvm/trunk/utils/gn/secondary/compiler-rt/lib/hwasan BUILD.gn, llvm/trunk/utils/gn/secondary/compiler-rt/lib/sanitizer_common BUILD.gn

gn build: Merge r354156

LLVM/llvm 354241lld/trunk/docs ReleaseNotes.rst

lld-link: Mention comdat selection work in the 9.0.0 wip release notes

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

LLVM/llvm 354240llvm/trunk/include/llvm/ADT Optional.h

Revert [NFC] Better encapsulation of llvm::Optional Storage

LLVM/llvm 354239llvm/trunk/include/llvm/ADT Optional.h

[NFC] Better encapsulation of llvm::Optional Storage, part II

Fix for better Windows support.

LLVM/llvm 354238llvm/trunk/include/llvm/ADT Optional.h

[NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

LLVM/llvm 354237llvm/trunk/include/llvm-c DebugInfo.h, llvm/trunk/lib/IR DebugInfo.cpp

[LLVM-C] Add bindings to create enumerators

Summary: The C API don't have the bindings to create enumerators, needed to create an 

Reviewers: whitequark, CodaFi, harlanhaskins, deadalnix

Reviewed By: whitequark, CodaFi, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

LLVM/llvm 354236llvm/trunk/test/Transforms/InstCombine saturating-add-sub.ll

[InstCombine] add even more tests for unsigned saturated add; NFC

The pattern-matching from rL354221 / rL354224 doesn't cover
these, so we're up to 8 different commuted possibilities.

There may still be 1 more variant of this pattern.

LLVM/llvm 354235cfe/trunk/include/clang/StaticAnalyzer/Checkers Checkers.td, cfe/trunk/test/Analysis valist-uninitialized.c

[analyzer] Make valist.Uninitialized depend on ValistBase

Accidentally left this dependency out, resulting in an assert failure if
only valist.Uninitialized is enabled from the valist package.