platform/upstream/llvm.git
4 years ago[lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead...
Raphael Isemann [Sat, 21 Dec 2019 21:40:52 +0000 (22:40 +0100)]
[lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead nullptr checks

ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a
while that the ASTContext is not a nullptr. This causes that we still have a lot of code
that is doing nullptr checks on the result of getASTContext() which is all unreachable code.

This patch changes the return value to a reference to make it clear this can't be a nullptr
and deletes all the nullptr checks.

4 years ago[Lldb/Lua] Generate Lua Bindings
Jonas Devlieghere [Sun, 8 Dec 2019 23:32:57 +0000 (15:32 -0800)]
[Lldb/Lua] Generate Lua Bindings

This patch uses SWIG to generate the Lua bindings for the SB API. It
covers most of the API, but some methods require a type map similar to
Python.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html

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

4 years ago[analyzer] exploded-graph-rewriter: Fix string encodings in python3.
Artem Dergachev [Sat, 21 Dec 2019 18:57:03 +0000 (10:57 -0800)]
[analyzer] exploded-graph-rewriter: Fix string encodings in python3.

Makes sure that the script works fine both in python2 and python3.

Patch by Pavel Samolysov!

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

4 years ago[NFC] test commit reverted
Stepan Dyatkovskiy [Sat, 21 Dec 2019 18:12:07 +0000 (22:12 +0400)]
[NFC] test commit reverted

4 years ago[NFC] test commit
Stepan Dyatkovskiy [Sat, 21 Dec 2019 18:11:34 +0000 (22:11 +0400)]
[NFC] test commit

4 years ago[lld][RISCV] Use an e_flags of 0 if there are only binary input files.
John Baldwin [Sat, 21 Dec 2019 17:59:37 +0000 (17:59 +0000)]
[lld][RISCV] Use an e_flags of 0 if there are only binary input files.

Summary:
If none of the input files are ELF object files (for example, when
generating an object file from a single binary input file via
"-b binary"), use a fallback value for the ELF header flags instead
of crashing with an assertion failure.

Reviewers: MaskRay, ruiu, espindola

Reviewed By: MaskRay, ruiu

Subscribers: kevans, grimar, emaste, arichardson, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits, jrtc27

Tags: #llvm

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

4 years agoFix "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.
Simon Pilgrim [Sat, 21 Dec 2019 17:45:30 +0000 (17:45 +0000)]
Fix "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.

4 years agoFix Wpedantic 'extra semicolon' warning. NFC.
Simon Pilgrim [Sat, 21 Dec 2019 17:32:00 +0000 (17:32 +0000)]
Fix Wpedantic 'extra semicolon' warning. NFC.

4 years agoFix `-Wunused-variable` warning. NFC.
Michael Liao [Sat, 21 Dec 2019 16:09:30 +0000 (11:09 -0500)]
Fix `-Wunused-variable` warning. NFC.

4 years ago[InstCombine] check alloc size in bitcast of geps fold (PR44321)
Sanjay Patel [Sat, 21 Dec 2019 15:31:21 +0000 (10:31 -0500)]
[InstCombine] check alloc size in bitcast of geps fold (PR44321)

We missed a constraint in D44833
when folding a bitcast into a GEP with vector/array types.
If the alloc sizes specified by the datalayout don't match,
this could miscompile as shown in:
https://bugs.llvm.org/show_bug.cgi?id=44321

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

4 years ago[SimplifyLibCalls] require fast-math-flags for pow(X, -0.5) transforms
Sanjay Patel [Fri, 20 Dec 2019 22:24:53 +0000 (17:24 -0500)]
[SimplifyLibCalls] require fast-math-flags for pow(X, -0.5) transforms

As discussed in PR44330:
https://bugs.llvm.org/show_bug.cgi?id=44330
...the transform from pow(X, -0.5) libcall/intrinsic to
reciprocal square root can result in small deviations from
the expected result due to differences in the pow()
implementation and/or the extra rounding step from the division.

This patch proposes to allow that difference with either the
'approximate functions' or 'reassociate' FMF:
http://llvm.org/docs/LangRef.html#fast-math-flags

In practice, this likely means that the code is compiled with
all of 'fast' (-ffast-math), but I have preserved the existing
specializations for -0.0/-INF that enable generating safe code
if those special values are allowed simultaneously with
allowing approximation/reassociation.

The question about whether a similar restriction is needed for
the non-reciprocal case -- pow(X, 0.5) -- is deferred. That
transform is allowed without FMF currently, and this patch does
not change that behavior.

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

4 years ago[lldb][NFC] Remove all ASTContext getter wrappers from ClangASTContext
Raphael Isemann [Sat, 21 Dec 2019 14:26:24 +0000 (15:26 +0100)]
[lldb][NFC] Remove all ASTContext getter wrappers from ClangASTContext

Their naming is misleading as they only return the
ClangASTContext-owned variables. For ClangASTContext instances constructed
for a given clang::ASTContext they silently generated duplicated instances
(e.g., a second IdentifierTable) that were essentially unusable.

This removes all these getters as they are anyway not very useful in comparison
to just calling the clang::ASTContext getters. The initialization
code has been moved to the CreateASTContext initialization method so that all
code for making our own clang::ASTContext is in one place.

4 years ago[AArch64] Respect reserved registers while renaming in LdSt opt.
Florian Hahn [Sat, 21 Dec 2019 13:47:08 +0000 (14:47 +0100)]
[AArch64] Respect reserved registers while renaming in LdSt opt.

We cannot pick reserved registers as rename registers.

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

4 years ago[Analyzer] Use a reference in a range-based for
Mark de Wever [Sat, 21 Dec 2019 10:20:49 +0000 (11:20 +0100)]
[Analyzer] Use a reference in a range-based for

This avoids unneeded copies when using a range-based for loops.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[Wdocumentation] Implement \anchor
Mark de Wever [Sat, 21 Dec 2019 13:47:52 +0000 (14:47 +0100)]
[Wdocumentation] Implement \anchor

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

4 years ago[lldb] disable thread-step-out-ret-addr-check on windows
Pavel Labath [Sat, 21 Dec 2019 13:19:49 +0000 (14:19 +0100)]
[lldb] disable thread-step-out-ret-addr-check on windows

I'm unable to get this test working there.

4 years ago[lldb] One more attempt to fix thread-step-out-ret-addr-check on windows
Pavel Labath [Sat, 21 Dec 2019 12:33:09 +0000 (13:33 +0100)]
[lldb] One more attempt to fix thread-step-out-ret-addr-check on windows

4 years agoAdd missing `REQUIRES: hexagon-registered-target`
David Zarzycki [Sat, 21 Dec 2019 11:34:36 +0000 (06:34 -0500)]
Add missing `REQUIRES: hexagon-registered-target`

After d567b0ba841d4b6f4b0d906da350a3bb2b2f769f, the test suite no longer
passes if hexagon is disabled.

4 years ago[lldb] Force the preprocessor to run in thread-step-out-ret-addr-check.test
Pavel Labath [Sat, 21 Dec 2019 11:25:02 +0000 (12:25 +0100)]
[lldb] Force the preprocessor to run in thread-step-out-ret-addr-check.test

It does not seem to run automatically on windows.

4 years agoCustomize simplified dumping and matching of LambdaExpr
Stephen Kelly [Wed, 18 Dec 2019 22:35:46 +0000 (22:35 +0000)]
Customize simplified dumping and matching of LambdaExpr

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb] Fix -Wstringop-truncation in PythonReadline.cpp
Pavel Labath [Sat, 21 Dec 2019 10:33:42 +0000 (11:33 +0100)]
[lldb] Fix -Wstringop-truncation in PythonReadline.cpp

The size is known and the truncation is deliberate -- use memcpy instead
of strncpy.

4 years ago[lldb] [testsuite] Fix Linux fail: Unwind/thread-step-out-ret-addr-check.test
Jan Kratochvil [Sat, 21 Dec 2019 10:27:54 +0000 (11:27 +0100)]
[lldb] [testsuite] Fix Linux fail: Unwind/thread-step-out-ret-addr-check.test

D71372 introduced: `Unwind/thread-step-out-ret-addr-check.test` failing on
Fedora 30 Linux x86_64.
  [lldb] Add additional validation on return address in 'thread step-out'
  https://reviews.llvm.org/D71372

One problem is the underscored `_nonstandard_stub` in the `.s` file but not in
the LLDB command:
  (lldb) breakpoint set -n nonstandard_stub
  Breakpoint 1: no locations (pending).
  WARNING:  Unable to resolve breakpoint to any actual locations.
  (lldb) process launch
  Process 21919 exited with status = 0 (0x00000000)
  Process 21919 launched: '/home/jkratoch/redhat/llvm-monorepo-clangassert/tools/lldb/test/Unwind/Output/thread-step-out-ret-addr-check.test.tmp' (x86_64)
  (lldb) thread step-out
  error: invalid thread
  (lldb) _

Another problem is that Fedora Linux has executable stack by default and all
programs indicate non-executable stack by `PT_GNU_STACK`, after fixing the
underscore I was getting:
  (lldb) thread step-out
  Process 22294 exited with status = 0 (0x00000000)
  (lldb) _

A different approach was tried as:
  [lldb] Refactor thread-step-out-ret-addr-check test to use .data instead of stack variable
  https://reviews.llvm.org/D71789

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

4 years ago[lldb] Fix ARM32 inferior calls
Jan Kratochvil [Sat, 21 Dec 2019 10:12:17 +0000 (11:12 +0100)]
[lldb] Fix ARM32 inferior calls

  echo -e '#include <unistd.h>\nint main(void){\nsync();return 0;}'|./bin/clang -g -x c -;./bin/lldb -o 'file ./a.out' -o 'b main' -o r -o 'p (void)sync()'

Actual:

  error: Expression can't be run, because there is no JIT compiled function

Expected:

  <nothing, sync() has been executed>

This patch has been checked by:
  D71707: clang-tidy: new bugprone-pointer-cast-widening
  https://reviews.llvm.org/D71707

Casting from 32-bit `void *` to `uint64_t` requires an intermediate `uintptr_t` cast otherwise the pointer gets sign-extended:

  echo -e '#include <stdio.h>\n#include <stdint.h>\nint main(void){void *p=(void *)0x80000000;unsigned long long ull=(unsigned long long)p;unsigned long long ull2=(unsigned long
long)(uintptr_t)p;printf("p=%p ull=0x%llx ull2=0x%llx\\n",p,ull,ull2);return 0;}'|gcc -Wall -m32 -x c -;./a.out
  <stdin>: In function ‘main’:
  <stdin>:3:66: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  p=0x80000000 ull=0xffffffff80000000 ull2=0x80000000

With debug output:
Actual:

  IRMemoryMap::WriteMemory (0xb6ff8640, 0xffffffffb6f82158, 0x112) went to [0xb6ff8640..0xb6ff86b3)
  Code can be run in the target.
  Found function, has local address 0xffffffffb6f84000 and remote address 0xffffffffffffffff
  Couldn't disassemble function : Couldn't find code range for function _Z12$__lldb_exprPv
  Sections:
  [0xb6f84000+0x3c]->0xb6ff9020 (alignment 4, section ID 0, name .text)
  ...
  HandleCommand, command did not succeed
  error: Expression can't be run, because there is no JIT compiled function

Expected:

  IRMemoryMap::WriteMemory (0xb6ff8640, 0xb6faa15c, 0x128) went to [0xb6ff8640..0xb6ff86c3)
  IRExecutionUnit::GetRemoteAddressForLocal() found 0xb6fac000 in [0xb6fac000..0xb6fac040], and returned 0xb6ff9020 from [0xb6ff9020..0xb6ff9060].
  Code can be run in the target.
  Found function, has local address 0xb6fac000 and remote address 0xb6ff9020
  Function's code range is [0xb6ff9020+0x40]
  ...
  Function data has contents:
  0xb6ff9020: 10 4c 2d e9 08 b0 8d e2 08 d0 4d e2 00 40 a0 e1
  ...
  Function disassembly:
  0xb6ff9020: 0xe92d4c10   push   {r4, r10, r11, lr}

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

4 years agoAMDGPU: Fix repeated word in comment
Matt Arsenault [Fri, 20 Dec 2019 15:35:51 +0000 (21:05 +0530)]
AMDGPU: Fix repeated word in comment

4 years agoMips: Make test resistant to future changes
Matt Arsenault [Thu, 12 Dec 2019 09:03:10 +0000 (14:33 +0530)]
Mips: Make test resistant to future changes

This seems to have been relying on extra spills being inserted in
these blocks to increase the code size to trigger branch
relaxation. This broke when these spills were avoided. Add some asm to
pad the size of the blocks to make it not matter.

4 years agoAMDGPU/GlobalISel: Fix misuse of div_scale intrinsics
Matt Arsenault [Fri, 20 Dec 2019 16:09:19 +0000 (21:39 +0530)]
AMDGPU/GlobalISel: Fix misuse of div_scale intrinsics

Confusingly, the intrinsic operands do not match the
instruction/custom node. The order is shuffled, and the 3rd operand is
an immediate to select operands.

I'm not 100% sure I did this right, but fdiv still doesn't select end
to end and it will be easier to tell when it does. This at least
avoids an assertion in RegBankSelect and allows hitting the fallback
on selection.

4 years agoAMDGPU/GlobalISel: Fix missing scc imp-def on scalar and/or/xor
Matt Arsenault [Fri, 20 Dec 2019 11:08:36 +0000 (16:38 +0530)]
AMDGPU/GlobalISel: Fix missing scc imp-def on scalar and/or/xor

4 years agoAMDGPU/GlobalISel: Simplify code
Matt Arsenault [Fri, 20 Dec 2019 13:25:41 +0000 (18:55 +0530)]
AMDGPU/GlobalISel: Simplify code

This can directly access the register bank, and doesn't need to get it
through the ID.

4 years agofeatures.html: Remove some old info
Sylvestre Ledru [Sat, 21 Dec 2019 09:49:15 +0000 (10:49 +0100)]
features.html: Remove some old info

4 years agoclang is now under the apache2 license
Sylvestre Ledru [Sat, 21 Dec 2019 09:48:16 +0000 (10:48 +0100)]
clang is now under the apache2 license

4 years agoRemove a gcc 4.9 comparison as it doesn't make sense
Sylvestre Ledru [Sat, 21 Dec 2019 09:46:45 +0000 (10:46 +0100)]
Remove a gcc 4.9 comparison as it doesn't make sense

4 years ago[libc++] Fix typo in std::midpoint
Ruslan Baratov [Sat, 21 Dec 2019 09:22:12 +0000 (01:22 -0800)]
[libc++] Fix typo in std::midpoint

Reviewed By: mclow.lists

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

4 years agoRevert "[msan] Check qsort input." and "[msan] Intercept qsort, qsort_r."
Jonas Devlieghere [Sat, 21 Dec 2019 05:30:35 +0000 (21:30 -0800)]
Revert "[msan] Check qsort input." and "[msan] Intercept qsort, qsort_r."

Temporarily revert the qsort changes because they fail to build on bots
that build with modules:

> error: thread-local storage is not supported for the current
> target (iossim)

http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/1820/console
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/4983/console

This reverts commit ddf897fc80499ece298bc33201db6b697d2af50e.
This reverts commit 07861e955d0095f25639d84c5726c73b528567cb.

4 years ago[lldb/test] Update !DIModule for isysroot rename
Jonas Devlieghere [Sat, 21 Dec 2019 05:10:20 +0000 (21:10 -0800)]
[lldb/test] Update !DIModule for isysroot rename

The isysroot field in DIModule was renamed to sysroot but the test in
LLDB wasn't updated. This fixes that.

4 years ago[ORC] De-register eh-frames in the RTDyldObjectLinkingLayer destructor.
Lang Hames [Sat, 21 Dec 2019 05:08:35 +0000 (21:08 -0800)]
[ORC] De-register eh-frames in the RTDyldObjectLinkingLayer destructor.

This matches the behavior of the legacy layer, which automatically deregistered
frames.

4 years ago[lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off.
Jonas Devlieghere [Sat, 21 Dec 2019 05:01:23 +0000 (21:01 -0800)]
[lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off.

Add a new decorator that checks if LLDB was build with editline support
and mark the relevant tests as skipped when that's not the case.

4 years ago[lldb] Expose more optional dependencies through GetBuildConfiguration()
Jonas Devlieghere [Sat, 21 Dec 2019 05:01:08 +0000 (21:01 -0800)]
[lldb] Expose more optional dependencies through GetBuildConfiguration()

Expose all the externally-observable optional dependencies through
SBDebugger::GetBuildConfiguration().

4 years ago[lldb/CMake] Don't use return() from macro()
Jonas Devlieghere [Sat, 21 Dec 2019 04:53:33 +0000 (20:53 -0800)]
[lldb/CMake] Don't use return() from macro()

> A macro is executed as if the macro body were pasted in place of the
> calling statement. This has the consequence that a return() in a macro
> body does not just terminate execution of the macro

After converting from a function() to a macro(), the return() became
invalid. This modifies the control flow to elude the return.

4 years agoRe-land "[lldb/CMake] Change how we deal with optional dependencies"
Jonas Devlieghere [Fri, 20 Dec 2019 23:38:46 +0000 (15:38 -0800)]
Re-land "[lldb/CMake] Change how we deal with optional dependencies"

Recently there has been some discussion about how we deal with optional
dependencies in LLDB. The approach in LLVM is to make things work out of
the box. If the dependency isn't there, we move on silently.

That's not true for LLDB. Unless you explicitly disable the dependency
with LLDB_ENABLE_*, you'll get a configuration-time error. The
historical reason for this is that LLDB's dependencies have a much
broader impact, think about Python for example which is required to run
the test suite.

The current approach can be frustrating from a user experience
perspective. Sometimes you just want to ensure LLDB builds with a change
in clang.

This patch changes the optional dependencies (with the exception of
Python) to a new scheme. The LLDB_ENABLE_* now takes three values: On,
Off or Auto, with the latter being the default. On and Off behave the
same as today, forcing the dependency to be enabled or disabled. If the
dependency is set to On but is not found, it results in a configuration
time warning. For Auto we detect if the dependency is there and either
enable or disable it depending on whether it's found.

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

PS: The reason Python isn't included yet is because it's so pervasive
that I plan on doing that in a separate patch.

4 years agohopefully last doc typo fix to cycle bots
Nico Weber [Sat, 21 Dec 2019 03:28:21 +0000 (22:28 -0500)]
hopefully last doc typo fix to cycle bots

4 years agofix yet another doc typo to cycle bots
Nico Weber [Sat, 21 Dec 2019 03:25:14 +0000 (22:25 -0500)]
fix yet another doc typo to cycle bots

4 years agofix another doc typo to cycle bots
Nico Weber [Sat, 21 Dec 2019 02:59:51 +0000 (21:59 -0500)]
fix another doc typo to cycle bots

4 years agofix a doc typo to cycle bots
Nico Weber [Sat, 21 Dec 2019 02:39:01 +0000 (21:39 -0500)]
fix a doc typo to cycle bots

4 years agoConstrain the macho-stabs test added in f72d001e099 to run on systems configured...
Michael Trent [Sat, 21 Dec 2019 01:36:38 +0000 (17:36 -0800)]
Constrain the macho-stabs test added in f72d001e099 to run on systems configured with an x86 backend.

Summary: This fixes a failure on the Builder clang-cmake-armv7-quick bot.

Reviewers: lhames, jhenderson

Reviewed By: lhames

Subscribers: kristof.beyls, rupprecht, seiya, llvm-commits

Tags: #llvm

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

4 years agoAdd a set of tests with basic coverage of the recently added boundary align feature.
Philip Reames [Sat, 21 Dec 2019 01:07:37 +0000 (17:07 -0800)]
Add a set of tests with basic coverage of the recently added boundary align feature.

There are tests in the included patch, but the duplication is non obvious, so I'm starting with basic coverage beore cleaning up a few of them

4 years agogn build: Silence mismatched-new-delete warning in scudo C++ wrapper tests.
Peter Collingbourne [Fri, 20 Dec 2019 21:17:45 +0000 (13:17 -0800)]
gn build: Silence mismatched-new-delete warning in scudo C++ wrapper tests.

These tests are deliberately mismatching new and delete, so the warnings
are just noise.

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

4 years ago[NFC][MachineOutliner] Rewrite setSuffixIndices to be iterative
Jessica Paquette [Fri, 20 Dec 2019 23:57:39 +0000 (15:57 -0800)]
[NFC][MachineOutliner] Rewrite setSuffixIndices to be iterative

Having this function be recursive could use up way too much stack space.

Rewrite it as an iterative traversal in the tree instead to prevent this.

Fixes PR44344.

4 years ago[X86] Add test cases for missing propagation of fpexcept flag on strict fp operations...
Craig Topper [Thu, 19 Dec 2019 00:09:38 +0000 (16:09 -0800)]
[X86] Add test cases for missing propagation of fpexcept flag on strict fp operations. NFC

The flag is being lost during type legalization or lowering. This
covers some of the cases. I'm sure there are many missing.

4 years ago[llvm-symbolizer] Prefix invocations in test with env
Petr Hosek [Fri, 20 Dec 2019 23:52:14 +0000 (15:52 -0800)]
[llvm-symbolizer] Prefix invocations in test with env

This addresses an issue introduced in dedad08 and is needed to make
sure this test works properly on Windows.

4 years agoRevert "[lldb/CMake] Change how we deal with optional dependencies"
Jonas Devlieghere [Fri, 20 Dec 2019 23:34:51 +0000 (15:34 -0800)]
Revert "[lldb/CMake] Change how we deal with optional dependencies"

This is failing on both the Windows and Debian bot.

4 years ago[DWARF] Defer creating declaration DIEs until we prepare call site info
Vedant Kumar [Fri, 20 Dec 2019 23:12:18 +0000 (15:12 -0800)]
[DWARF] Defer creating declaration DIEs until we prepare call site info

It isn't necessary to create DIEs for all of the declaration subprograms
in a CU's retainedTypes list. We can defer creating these subprograms
until we need to prepare a call site tag that refers to one.

This cleanup was mentioned in passing in D70350.

4 years agoReland: [DWARF] Allow cross-CU references of subprogram definitions
Vedant Kumar [Fri, 15 Nov 2019 23:37:29 +0000 (15:37 -0800)]
Reland: [DWARF] Allow cross-CU references of subprogram definitions

This allows a call site tag in CU A to reference a callee DIE in CU B
without resorting to creating an incomplete duplicate DIE for the callee
inside of CU A.

We already allow cross-CU references of subprogram declarations, so it
doesn't seem like definitions ought to be special.

This improves entry value evaluation and tail call frame synthesis in
the LTO setting. During LTO, it's common for cross-module inlining to
produce a call in some CU A where the callee resides in a different CU,
and there is no declaration subprogram for the callee anywhere. In this
case llvm would (unnecessarily, I think) emit an empty DW_TAG_subprogram
in order to fill in the call site tag. That empty 'definition' defeats
entry value evaluation etc., because the debugger can't figure out what
it means.

As a follow-up, maybe we could add a DWARF verifier check that a
DW_TAG_subprogram at least has a DW_AT_name attribute.

Update:

Reland with a fix to create a declaration DIE when the declaration is
missing from the CU's retainedTypes list. The declaration is left out
of the retainedTypes list in two cases:

1) Re-compiling pre-r266445 bitcode (in which declarations weren't added
   to the retainedTypes list), and
2) Doing LTO function importing (which doesn't update the retainedTypes
   list).

It's possible to handle (1) and (2) by modifying the retainedTypes list
(in AutoUpgrade, or in the LTO importing logic resp.), but I don't see
an advantage to doing it this way, as it would cause more DWARF to be
emitted compared to creating the declaration DIEs lazily.

Tested with a stage2 ThinLTO+RelWithDebInfo build of clang, and with a
ReleaseLTO-g build of the test suite.

rdar://46577651, rdar://57855316, rdar://57840415

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

4 years agollvm-objdump should ignore Mach-O stab symbols for disassembly.
Michael Trent [Thu, 12 Dec 2019 06:43:46 +0000 (22:43 -0800)]
llvm-objdump should ignore Mach-O stab symbols for disassembly.

Summary:
llvm-objdump will commonly error out when disassembling a Mach-O binary with
stab symbols, or when printing a Mach-O symbol table that includesstab symbols.
That is because the Mach-O N_OSO symbol has been modified to include the
bottom 8-bit value of the Mach-O's cpusubtype value in the section field. In
general, one cannot blindly assume a stab symbol's section field is valid
unless one has actually consulted the specification for the specific stab.

Since objdump mostly just walks the symbol table to get mnemonics for code
disassembly it's best for objdump to just ignore stab symbols. llvm-nm will
do a more complete and correct job of displaying Mach-O symbol table contents.

Reviewers: pete, lhames, ab, thegameg, jhenderson, MaskRay

Reviewed By: thegameg, MaskRay

Subscribers: MaskRay, rupprecht, seiya, llvm-commits

Tags: #llvm

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

4 years ago[WebAssembly] Use TargetIndex operands in DbgValue to track WebAssembly operands...
Yury Delendik [Fri, 20 Dec 2019 22:31:56 +0000 (14:31 -0800)]
[WebAssembly] Use TargetIndex operands in DbgValue to track WebAssembly operands locations

Extends DWARF expression language to express locals/globals locations. (via
target-index operands atm) (possible variants are: non-virtual registers
or address spaces)

The WebAssemblyExplicitLocals can replace virtual registers to targertindex
operand type at the time when WebAssembly backend introduces
{get,set,tee}_local instead of corresponding virtual registers.

Reviewed By: aprantl, dschuff

Tags: #debug-info, #llvm

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

4 years agoFix name of InitLibcalls() function in comment
Sam Clegg [Fri, 20 Dec 2019 21:01:03 +0000 (13:01 -0800)]
Fix name of InitLibcalls() function in comment

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

4 years agoTemporarily restrict the test for D71372 to darwin till we fix it on other systems.
Jim Ingham [Fri, 20 Dec 2019 22:30:36 +0000 (14:30 -0800)]
Temporarily restrict the test for D71372 to darwin till we fix it on other systems.

4 years ago[lldb/CMake] Change how we deal with optional dependencies
Jonas Devlieghere [Wed, 18 Dec 2019 19:19:06 +0000 (11:19 -0800)]
[lldb/CMake] Change how we deal with optional dependencies

Recently there has been some discussion about how we deal with optional
dependencies in LLDB. The approach in LLVM is to make things work out of
the box. If the dependency isn't there, we move on silently.

That's not true for LLDB. Unless you explicitly disable the dependency
with LLDB_ENABLE_*, you'll get a configuration-time error. The
historical reason for this is that LLDB's dependencies have a much
broader impact, think about Python for example which is required to run
the test suite.

The current approach can be frustrating from a user experience
perspective. Sometimes you just want to ensure LLDB builds with a change
in clang.

This patch changes the optional dependencies (with the exception of
Python) to a new scheme. The LLDB_ENABLE_* now takes three values: On,
Off or Auto, with the latter being the default. On and Off behave the
same as today, forcing the dependency to be enabled or disabled. If the
dependency is set to On but is not found, it results in a configuration
time warning. For Auto we detect if the dependency is there and either
enable or disable it depending on whether it's found.

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

PS: The reason Python isn't included yet is because it's so pervasive
that I plan on doing that in a separate patch.

4 years ago[iOS sim] Ensure simulator device is booted in iossim_prepare.py
Julian Lettner [Mon, 16 Dec 2019 17:33:11 +0000 (09:33 -0800)]
[iOS sim] Ensure simulator device is booted in iossim_prepare.py

Recent versions of the iOS simulator require that a "simulator device"
is booted before we can use `simctl spawn` (see iossim_run.py) to start
processes.

We can use `simctl bootstatus` to ensure that the simulator device
is booted before we run any tests via lit.  The `-b` option starts the
device if necessary.

Reviewed By: delcypher

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

4 years agoRevert "Customize simplified dumping and matching of LambdaExpr"
Stephen Kelly [Fri, 20 Dec 2019 21:32:43 +0000 (21:32 +0000)]
Revert "Customize simplified dumping and matching of LambdaExpr"

This reverts commit 494b1318ca77927e919bbf9a61749a58553d738c.

4 years ago[InstCombine] Improve infinite loop detection
Jakub Kuderski [Fri, 20 Dec 2019 21:08:52 +0000 (16:08 -0500)]
[InstCombine] Improve infinite loop detection

Summary:
This patch limits the default number of iterations performed by InstCombine. It also exposes a new option that allows to specify how many iterations is considered getting stuck in an infinite loop.

Based on experiments performed on real-world C++ programs, InstCombine seems to perform at most ~8-20 iterations, so treating 1000 iterations as an infinite loop seems like a safe choice. See D71145 for details.

The two limits can be specified via command line options.

Reviewers: spatel, lebedev.ri, nikic, xbolva00, grosser

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoCustomize simplified dumping and matching of LambdaExpr
Stephen Kelly [Wed, 18 Dec 2019 22:35:46 +0000 (22:35 +0000)]
Customize simplified dumping and matching of LambdaExpr

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years agoRename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot
Adrian Prantl [Thu, 19 Dec 2019 19:56:56 +0000 (11:56 -0800)]
Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot

This is a purely cosmetic change that is NFC in terms of the binary
output. I bugs me that I called the attribute DW_AT_LLVM_isysroot
since the "i" is an artifact of GCC command line option syntax
(-isysroot is in the category of -i options) and doesn't carry any
useful information otherwise.

This attribute only appears in Clang module debug info.

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

4 years ago[compiler-rt] [test] Disable MPROTECT for XRay tests on NetBSD
Michał Górny [Fri, 20 Dec 2019 21:08:01 +0000 (22:08 +0100)]
[compiler-rt] [test] Disable MPROTECT for XRay tests on NetBSD

4 years ago[scudo][standalone] Support __BIONIC__
Kostya Kortchinsky [Fri, 20 Dec 2019 16:23:57 +0000 (08:23 -0800)]
[scudo][standalone] Support __BIONIC__

Summary:
Some Android builds that we are interested in define `__BIONIC__`
but not `__ANDROID__`, so expand `SCUDO_ANDROID` to encompass those.

Reviewers: cferris, hctim, pcc, eugenis, morehouse

Subscribers: krytarowski, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoAdd parentheses to silence warning
Bill Wendling [Fri, 20 Dec 2019 20:47:38 +0000 (12:47 -0800)]
Add parentheses to silence warning

4 years ago[llvm-symbolizer] Support reading options from environment
Petr Hosek [Wed, 18 Dec 2019 18:19:47 +0000 (10:19 -0800)]
[llvm-symbolizer] Support reading options from environment

llvm-symbolizer is used by sanitizers to symbolize errors discovered by
sanitizer, but there's no way to pass options to llvm-symbolizer since
the tool is invoked directly by the sanitizer runtime. Therefore, we
don't have a way to pass options needed to find debug symbols such as
-dsym-hint or -debug-file-directory. This change enables reading options
from the LLVM_SYMBOLIZER_OPTS in addition to command line which can be
used to pass those additional options to llvm-symbolizer invocations
made by sanitizer runtime.

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

4 years ago[msan] Check qsort input.
Evgenii Stepanov [Fri, 20 Dec 2019 20:07:04 +0000 (12:07 -0800)]
[msan] Check qsort input.

Summary:
Qsort interceptor suppresses all checks by unpoisoning the data in the
wrapper of a comparator function, and then unpoisoning the output array
as well.

This change adds an explicit run of the comparator on all elements of
the input array to catch any sanitizer bugs.

Reviewers: vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[analyzer] Add path notes to FuchsiaHandleCheck.
Gabor Horvath [Tue, 26 Nov 2019 17:17:30 +0000 (09:17 -0800)]
[analyzer] Add path notes to FuchsiaHandleCheck.

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

4 years ago[gn build] Port 82923c71efa
LLVM GN Syncbot [Fri, 20 Dec 2019 20:35:49 +0000 (20:35 +0000)]
[gn build] Port 82923c71efa

4 years ago[analyzer] Add Fuchsia Handle checker
Gabor Horvath [Sat, 16 Nov 2019 00:00:46 +0000 (16:00 -0800)]
[analyzer] Add Fuchsia Handle checker

The checker can diagnose handle use after releases, double releases, and
handle leaks.

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

4 years ago[msan] Intercept qsort, qsort_r.
Evgenii Stepanov [Thu, 19 Dec 2019 21:38:59 +0000 (13:38 -0800)]
[msan] Intercept qsort, qsort_r.

Summary:
This fixes qsort-related false positives with glibc-2.27.
I'm not entirely sure why they did not show up with the earlier
versions; the code seems similar enough.

Reviewers: vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoMore style cleanups following rG14fc20ca6282 [NFC]
Philip Reames [Fri, 20 Dec 2019 20:17:30 +0000 (12:17 -0800)]
More style cleanups following rG14fc20ca6282 [NFC]

Demote member functions to static functions where possible
Use early continue/early return to reduce nesting
Clarify comments slightly.
Reuse previously define expression in one case.

4 years agoAvoid unsupported LLD options
Sid Manning [Mon, 2 Dec 2019 20:10:03 +0000 (14:10 -0600)]
Avoid unsupported LLD options

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

4 years agoFix a memory leak introduced w/the instruction padding support in rG14fc20ca6282
Philip Reames [Fri, 20 Dec 2019 20:01:06 +0000 (12:01 -0800)]
Fix a memory leak introduced w/the instruction padding support in rG14fc20ca6282

Should have caught this in review, but only noticed when addressing post commit style items.  We were creating a new instance of the X86MCInstrInfo class, and then never reclaiming the memory.  This wasn't even conditional on the new off by default flags, so it was an unconditional leak.

4 years agoComment and adjust style in the newly introduced MCBoundaryAlignFragment infrastructu...
Philip Reames [Fri, 20 Dec 2019 19:48:30 +0000 (11:48 -0800)]
Comment and adjust style in the newly introduced MCBoundaryAlignFragment infrastructure.  More to follow.

4 years ago[attributes][analyzer] Add annotations for handles.
Gabor Horvath [Thu, 5 Dec 2019 00:12:50 +0000 (16:12 -0800)]
[attributes][analyzer] Add annotations for handles.

These annotations will be used in an upcomming static analyzer check
that finds handle leaks, use after releases, and double releases.

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

4 years agoApply the alignment specifier attribute to anonymous unions and structs.
Kamlesh Kumar [Fri, 20 Dec 2019 19:41:46 +0000 (14:41 -0500)]
Apply the alignment specifier attribute to anonymous unions and structs.

4 years agoAlign branches within 32-Byte boundary (NOP padding)
Philip Reames [Fri, 20 Dec 2019 18:51:05 +0000 (10:51 -0800)]
Align branches within 32-Byte boundary (NOP padding)

WARNING: If you're looking at this patch because you're looking for a full
performace mitigation of the Intel JCC Erratum, this is not it!

This is a preliminary patch on the patch towards mitigating the performance
regressions caused by Intel's microcode update for Jump Conditional Code
Erratum.  For context, see:
https://www.intel.com/content/www/us/en/support/articles/000055650.html

The patch adds the required assembler infrastructure and command line options
needed to exercise the logic for INTERNAL TESTING.  These are NOT public flags,
and should not be used for anything other than LLVM's own testing/debugging
purposes.  They are likely to change both in spelling and meaning.

WARNING: This patch is knowingly incorrect in some cornercases.  We need, and
do not yet provide, a mechanism to selective enable/disable the padding.
Conversation on this will continue in parellel with work on extending this
infrastructure to support prefix padding.

The goal here is to have the assembler align specific instructions such that
they neither cross or end at a 32 byte boundary.  The impacted instructions are:
a. Conditional jump.
b. Fused conditional jump.
c. Unconditional jump.
d. Indirect jump.
e. Ret.
f. Call.

The new options for llvm-mc are:
    -x86-align-branch-boundary=NUM aligns branches within NUM byte boundary.
    -x86-align-branch=TYPE[+TYPE...] specifies types of branches to align.

A new MCFragment type, MCBoundaryAlignFragment, is added, which may emit
NOP to align the fused/unfused branch.

alignBranchesBegin inserts MCBoundaryAlignFragment before instructions,
alignBranchesEnd marks the end of the branch to be aligned,
relaxBoundaryAlign grows or shrinks sizes of NOP to align the target branch.

Nop padding is disabled when the instruction may be rewritten by the linker,
such as TLS Call.

Process Note: I am landing a patch by skan as it has been LGTMed, and
continuing to iterate on the review is simply slowing us down at this point.
We can and will continue to iterate in tree.

Patch By: skan
Differential Revision: https://reviews.llvm.org/D70157

4 years ago[NFC][Driver] Add dummy compiler-rt sanitizer dylibs for Darwin.
Dan Liew [Fri, 20 Dec 2019 19:11:15 +0000 (11:11 -0800)]
[NFC][Driver] Add dummy compiler-rt sanitizer dylibs for Darwin.

This adds dummy files to the test resource directory used by the Clang
driver tests.

rdar://problem/58118584

4 years ago[PPC32] Emit R_PPC_PLTREL24 for calls to dso_local ifunc
Fangrui Song [Wed, 18 Dec 2019 05:35:02 +0000 (21:35 -0800)]
[PPC32] Emit R_PPC_PLTREL24 for calls to dso_local ifunc

  static void *ifunc(void) __attribute__((ifunc("resolver")));
  void foo() { ifunc(); }

The relocation produced by the ifunc() call:

1. gcc -msecure-plt -fPIC => R_PPC_PLTREL24 r_addend=0x8000
2. gcc -msecure-plt -PIE => R_PPC_PLTREL24 r_addend=0x8000
3. clang -msecure-plt -fPIC => R_PPC_PLTREL24 r_addend=0x8000
4. clang -msecure-plt -fPIE => R_PPC_REL24

4 is incorrect. The R_PPC_REL24 needs a call stub due to ifunc. If this
relocation is mixed with other R_PPC_PLTREL24(r_addend=0x8000) in a
function, both GNU ld and lld (after D71621 fix) may produce a wrong
result.

This patch fixes 4 to use R_PPC_PLTREL24, which matches GCC.
Both GNU ld and lld (after D71621) will be happy.

Reviewed By: sfertile

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

4 years ago[X86] Fix a KNL miscompile caused by combineSetCC swapping LHS/RHS variables before...
Craig Topper [Fri, 20 Dec 2019 18:52:44 +0000 (10:52 -0800)]
[X86] Fix a KNL miscompile caused by combineSetCC swapping LHS/RHS variables before a later use.

The setcc operands are copied into LHS and RHS variables at the top of the function. We also capture the condition code.

A later piece of code swaps the operands and changing the CC variable as part of a canonicalization to make some other checks simpler. But we might not make the transform we canonicalized for. So we continue on through the function where we can use the swapped LHS/RHS variables and access the original condition code operand instead of the modified CC variable. This leads to a setcc being created with the original condition code, but with swapped operands.

To mitigate this, this patch does a couple things. The LHS/RHS/CC variables are made const to keep them from being modified like this again. The transform that needs the swap now uses temporary copies of the variables. And the transform that used the original condition code operand has been altered to use the CC variable we cached originally. Either of these changes are enough to fix the issue, but doing both to make this code very safe.

I also considered rewriting the swap code in some way to check both permutations without explicitly swapping or needing temporary variables, but held off on that.

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

4 years ago[lldb/Lua] Implement a Simple Lua Script Interpreter Prototype
Jonas Devlieghere [Sun, 8 Dec 2019 01:35:31 +0000 (17:35 -0800)]
[lldb/Lua] Implement a Simple Lua Script Interpreter Prototype

This implements a very elementary Lua script interpreter. It supports
running a single command as well as running interactively. It uses
editline if available. It's still missing a bunch of stuff though. Some
things that I intentionally ingored for now are that I/O isn't properly
hooked up (so every print goes to stdout) and the non-editline support
which is not handling a bunch of corner cases. The latter is a matter of
reusing existing code in the Python interpreter.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html

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

4 years agoIn 'thread step-out' command, only insert a breakpoint in executable memory.
Jim Ingham [Fri, 20 Dec 2019 19:00:11 +0000 (11:00 -0800)]
In 'thread step-out' command, only insert a breakpoint in executable memory.

Previously, if the current function had a nonstandard stack layout/ABI, and had a valid
data pointer in the location where the return address is usually located, data corruption
would occur when the breakpoint was written. This could lead to an incorrectly reported
crash or silent corruption of the program's state. Now, if the above check fails, the command safely aborts.

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

4 years ago[objc_direct] Tigthen checks for direct methods
Pierre Habouzit [Thu, 19 Dec 2019 09:25:03 +0000 (01:25 -0800)]
[objc_direct] Tigthen checks for direct methods

Because the name of a direct method must be agreed upon by the caller
and the implementation, certain bad practices that one can get away with
when using dynamism are fatal with direct methods.

To avoid really weird and unscruttable linker error, tighten the
front-end error reporting.

Rule 1:
  Direct methods can only have at most one declaration in an @interface
  container. Any redeclaration is strictly forbidden.

  Today some amount of redeclaration is tolerated between the main
  interface and categories for dynamic methods, but we can't have that.

Rule 2:
  Direct method implementations can only be declared in a matching
  @interface container: when implemented in the primary @implementation
  then the declaration must be in the primary @interface or an
  extension, and when implemented in a category, the declaration must be
  in the @interface for the same category.

Also fix another issue with ObjCMethod::getCanonicalDecl(): when an
implementation lives in the primary @interface, then its canonical
declaration can be in any extension, even when it's not an accessor.

Add Sema tests to cover the new errors, and CG tests to beef up testing
around function names for categories and extensions.

Radar-Id: <rdar://problem/58054563>

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

4 years ago ThreadPlanTracer::TracingStarted can't call virtual methods on Thread.
Jim Ingham [Fri, 20 Dec 2019 18:56:39 +0000 (10:56 -0800)]
ThreadPlanTracer::TracingStarted can't call virtual methods on Thread.

    TracingStarted gets called in the Thread constructor, which means you can't
    call a virtual method of the class.  So delay setting up the m_register_values
    till you need them.  NFC as lldb just crashes if you don't do this.

    The thread tracing is an only occasionally useful feature, and it only sort
    of works.  I'm not adding tests etc. at this point, I'm just poking at it a
    bit.  If I get it working better I'll write tests and so forth.

4 years ago[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant
Danilo Carvalho Grael [Tue, 17 Dec 2019 15:42:52 +0000 (10:42 -0500)]
[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant

Summary: Replace the integer immediate intrisics with splat vector variants so they can be applied as optimizations for the C/C++ intrinsics.

Reviewers: sdesmalen, huntergr, rengolin, efriedma, c-rhodes, mgudim, kmclaughlin

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, amehsan

Tags: #llvm

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

4 years ago[SystemZ] Add a mapping from "select register" to "load on condition" (2-addr).
Jonas Paulsson [Tue, 17 Dec 2019 18:17:59 +0000 (10:17 -0800)]
[SystemZ]  Add a mapping from "select register" to "load on condition" (2-addr).

The SELR(Mux) instructions can be converted to two-address form as LOCR(Mux)
instructions whenever one of the sources are the same reg as dest. By adding
this mapping in getTwoOperandOpcode(), we get:

- Two-address hints in getRegAllocationHints() for select register
  instructions.

- No need anymore for special handling in SystemZShortenInst.cpp -
  shortenSelect() removed.

The two-address hints are now added before the GRX32 hints, which should be
preferred.

Review: Ulrich Weigand
https://reviews.llvm.org/D68870

4 years ago[lldb][NFC] Remove utility methods in TestClangASTImporter
Raphael Isemann [Fri, 20 Dec 2019 18:38:02 +0000 (19:38 +0100)]
[lldb][NFC] Remove utility methods in TestClangASTImporter

We have a central header for all these methods so we can
just use those for creating ClangASTContexts.

4 years agollvm-symbolizer: support DW_FORM_loclistx locations.
Evgenii Stepanov [Wed, 27 Nov 2019 01:34:04 +0000 (17:34 -0800)]
llvm-symbolizer: support DW_FORM_loclistx locations.

Summary:
With -gdwarf-5 local variable locations are emitted as DW_FORM_loclistx
form instead of the regular DW_FORM_sec_offset. Teach
DWARFDie::getLocations to understand the new format and use it in
llvm-symbolizer "FRAME" command.

Reviewers: pcc, jdoerfert

Subscribers: srhines, aprantl, hiraditya, rupprecht, llvm-commits

Tags: #llvm

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

4 years agoTemporarily revert "Reapply [LVI] Normalize pointer behavior" and "[LVI] Restructure...
Jordan Rupprecht [Fri, 20 Dec 2019 18:25:57 +0000 (10:25 -0800)]
Temporarily revert "Reapply [LVI] Normalize pointer behavior" and "[LVI] Restructure caching"

This reverts commits 7e18aeba5062cd4324a9efb7bc25c9dbc4a34c2c (D70376) 21fbd5587cdfa11dabb3aeb0ead2d3d5fd0b490d (D69914) due to increased memory usage.

4 years ago[SystemZ] Bugfix and improve the handling of CC values.
Jonas Paulsson [Tue, 17 Dec 2019 18:14:34 +0000 (10:14 -0800)]
[SystemZ]  Bugfix and improve the handling of CC values.

It was recently discovered that the handling of CC values was actually broken
since overflow was not properly handled ('nsw' flag not checked for).

Add and sub instructions now have a new target specific instruction flag
named SystemZII::CCIfNoSignedWrap. It means that the CC result can be used
instead of a compare with 0, but only if the instruction has the 'nsw' flag
set.

This patch also adds the improvements of conversion to logical instructions
and the analyzing of add with immediates, to be able to eliminate more
compares.

Review: Ulrich Weigand
https://reviews.llvm.org/D66868

4 years agoRevert "[ARM] Improve codegen of volatile load/store of i64"
Victor Campos [Fri, 20 Dec 2019 18:08:24 +0000 (18:08 +0000)]
Revert "[ARM] Improve codegen of volatile load/store of i64"

This reverts commit bbcf1c3496ce2bd1ed87e8fb15ad896e279633ce.

4 years ago[lldb][NFC] Remove redundant ASTContext args to CopyDecl/DeportDecl
Raphael Isemann [Fri, 20 Dec 2019 17:44:39 +0000 (18:44 +0100)]
[lldb][NFC] Remove redundant ASTContext args to CopyDecl/DeportDecl

We already pass a Decl here and the additional ASTContext needs to
match the Decl. We might as well just pass the Decl and then extract
the ASTContext from that.

4 years ago[clang-format] C# formatting a class with inheritance followed by an attribute specif...
mydeveloperday [Fri, 20 Dec 2019 17:04:49 +0000 (17:04 +0000)]
[clang-format] C# formatting a class with inheritance followed by an attribute specifier assume its a braces initializer

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

The rule that prevents `... {} [[....]]`  being treated as a braced initializer for C++ causes problems for C# with attributes, causing it to be incorrectly classified and then messing up the subsequent formatting. (see bug for details of formatting)

Reviewers: mitchell-stellar, klimek, sammccall

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

4 years ago[compiler-rt] [test] Disable MPROTECT on two builtin tests
Michał Górny [Sat, 14 Dec 2019 16:03:48 +0000 (17:03 +0100)]
[compiler-rt] [test] Disable MPROTECT on two builtin tests

Introduce a new %run_nomprotect substitution to run tests that do not
work with MPROTECT enabled.  This uses paxctl via a wrapper on NetBSD,
and evaluates to plain %run on other systems.

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

4 years ago[libc++] Update feature list for NetBSD
Michał Górny [Sat, 14 Dec 2019 13:17:19 +0000 (14:17 +0100)]
[libc++] Update feature list for NetBSD

Add NetBSD to the same feature list as Fuchsia since it matches
in available features, effectively enabling aligned_alloc(),
timespec_get() and C11 features.  Remove now-duplicate declaration
of quick_exit() support.

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

4 years ago[OPENMP]Remove unused OPENMP_MATCH_KIND, NFC.
Alexey Bataev [Fri, 20 Dec 2019 16:17:55 +0000 (11:17 -0500)]
[OPENMP]Remove unused OPENMP_MATCH_KIND, NFC.

4 years ago[lldb/cmake] Delete LLDB_LINKER_SUPPORTS_GROUPS
Pavel Labath [Fri, 20 Dec 2019 15:57:24 +0000 (16:57 +0100)]
[lldb/cmake] Delete LLDB_LINKER_SUPPORTS_GROUPS

The variable is unused.

4 years ago[InstCombine] add tests for cast+gep; NFC
Sanjay Patel [Fri, 20 Dec 2019 15:14:25 +0000 (10:14 -0500)]
[InstCombine] add tests for cast+gep; NFC

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

4 years ago[lldb] Fix an unused variable warning
Pavel Labath [Fri, 20 Dec 2019 15:51:25 +0000 (16:51 +0100)]
[lldb] Fix an unused variable warning