platform/upstream/llvm.git
4 years ago[tsan, go] fix Go windows build
Vitaly Buka [Mon, 7 Oct 2019 23:11:07 +0000 (23:11 +0000)]
[tsan, go] fix Go windows build

Summary:
Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references.

Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.)

Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined.

Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be.

Patch by Keith Randall.

Reviewers: dvyukov, vitalybuka

Reviewed By: vitalybuka

Subscribers: jfb, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373984

4 years ago[tsan, go] break commands into multiple lines
Vitaly Buka [Mon, 7 Oct 2019 23:04:16 +0000 (23:04 +0000)]
[tsan, go] break commands into multiple lines

Summary: Patch by Keith Randall.

Reviewers: dvyukov, vitalybuka

Subscribers: delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373983

4 years ago[X86] Shrink zero extends of gather indices from type less than i32 to types larger...
Craig Topper [Mon, 7 Oct 2019 23:03:12 +0000 (23:03 +0000)]
[X86] Shrink zero extends of gather indices from type less than i32 to types larger than i32.

Gather instructions can use i32 or i64 elements for indices. If
the index is zero extended from a type smaller than i32 to i64, we
can shrink the extend to just extend to i32.

llvm-svn: 373982

4 years ago[X86] Add test cases for zero extending a gather index from less than i32 to i64.
Craig Topper [Mon, 7 Oct 2019 23:02:03 +0000 (23:02 +0000)]
[X86] Add test cases for zero extending a gather index from less than i32 to i64.

We should be able to use a smaller zero extend.

llvm-svn: 373981

4 years agoFix the spelling of my name.
Joerg Sonnenberger [Mon, 7 Oct 2019 22:55:42 +0000 (22:55 +0000)]
Fix the spelling of my name.

llvm-svn: 373980

4 years ago[sanitizer] Print SIGTRAP for corresponding signal
Vitaly Buka [Mon, 7 Oct 2019 22:43:19 +0000 (22:43 +0000)]
[sanitizer] Print SIGTRAP for corresponding signal

Reviewers: eugenis, jfb

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373979

4 years ago[tsan] Don't delay SIGTRAP handler
Vitaly Buka [Mon, 7 Oct 2019 22:43:17 +0000 (22:43 +0000)]
[tsan] Don't delay SIGTRAP handler

Reviewers: eugenis, jfb

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373978

4 years agoAdd VFS support for sanitizers' blacklist
Jan Korous [Mon, 7 Oct 2019 22:36:19 +0000 (22:36 +0000)]
Add VFS support for sanitizers' blacklist

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

llvm-svn: 373977

4 years ago[X86] Add new calling convention that guarantees tail call optimization
Reid Kleckner [Mon, 7 Oct 2019 22:28:58 +0000 (22:28 +0000)]
[X86] Add new calling convention that guarantees tail call optimization

When the target option GuaranteedTailCallOpt is specified, calls with
the fastcc calling convention will be transformed into tail calls if
they are in tail position. This diff adds a new calling convention,
tailcc, currently supported only on X86, which behaves the same way as
fastcc, except that the GuaranteedTailCallOpt flag does not need to
enabled in order to enable tail call optimization.

Patch by Dwight Guth <dwight.guth@runtimeverification.com>!

Reviewed By: lebedev.ri, paquette, rnk

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

llvm-svn: 373976

4 years ago[WebAssembly] Fix unwind mismatch stat computation
Heejin Ahn [Mon, 7 Oct 2019 22:19:40 +0000 (22:19 +0000)]
[WebAssembly] Fix unwind mismatch stat computation

Summary:
There was a bug when computing the number of unwind destination
mismatches in CFGStackify. When there are many mismatched calls that
share the same (original) destination BB, they have to be counted
separately.

This also fixes a typo and runs `fixUnwindMismatches` only when the wasm
exception handling is enabled. This is to prevent unnecessary
computations and does not change behavior.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 373975

4 years ago[llvm-lipo] Add TextAPI to LINK_COMPONENTS
Heejin Ahn [Mon, 7 Oct 2019 22:11:30 +0000 (22:11 +0000)]
[llvm-lipo] Add TextAPI to LINK_COMPONENTS

Summary:
D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
with `-DBUILD_SHARED_LIBS=ON` fail.

Reviewers: alexshap

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 373974

4 years ago[Diagnostics] Emit better -Wbool-operation's warning message if we known that the...
David Bolvansky [Mon, 7 Oct 2019 21:57:03 +0000 (21:57 +0000)]
[Diagnostics] Emit better -Wbool-operation's warning message if we known that the result is always true

llvm-svn: 373973

4 years ago[Attributor][FIX] Remove assertion wrong for on invalid IRPositions
Johannes Doerfert [Mon, 7 Oct 2019 21:48:08 +0000 (21:48 +0000)]
[Attributor][FIX] Remove assertion wrong for on invalid IRPositions

llvm-svn: 373972

4 years ago [libc++] Remove C++03 variadics in shared_ptr (v2)
Zoe Carver [Mon, 7 Oct 2019 21:41:15 +0000 (21:41 +0000)]
[libc++] Remove C++03 variadics in shared_ptr (v2)

    Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

llvm-svn: 373971

4 years ago[CMake] We only want to copy the headers for macOS.
Davide Italiano [Mon, 7 Oct 2019 21:38:30 +0000 (21:38 +0000)]
[CMake] We only want to copy the headers for macOS.

<rdar://problem/55916729>

llvm-svn: 373970

4 years ago[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro
Cameron McInally [Mon, 7 Oct 2019 21:33:39 +0000 (21:33 +0000)]
[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro

Note that we are not sure where the tests for these functions lives. This was discussed in the Phab Diff.

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

llvm-svn: 373969

4 years agoMark constructor as default and remove implementation (NFC)
Adrian Prantl [Mon, 7 Oct 2019 21:23:19 +0000 (21:23 +0000)]
Mark constructor as default and remove implementation (NFC)

llvm-svn: 373968

4 years ago[WebAssembly] Add memory intrinsics handling to mayThrow()
Heejin Ahn [Mon, 7 Oct 2019 21:14:45 +0000 (21:14 +0000)]
[WebAssembly] Add memory intrinsics handling to mayThrow()

Summary:
Previously, `WebAssembly::mayThrow()` assumed all inputs are global
addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
are lowered to external symbols in instruction selection and later
emitted as library calls. And these functions don't throw.

This patch adds handling to those memory intrinsics to `mayThrow`
function. But while most of libcalls don't throw, we can't guarantee all
of them don't throw, so currently we conservatively return true for all
other external symbols.

I think a better way to solve this problem is to embed 'nounwind' info
in `TargetLowering::CallLoweringInfo`, so that we can access the info
from the backend. This will also enable transferring 'nounwind'
properties of LLVM IR instructions. Currently we don't transfer that
info and we can only access properties of callee functions, if the
callees are within the module. Other targets don't need this info in the
backend because they do all the processing before isel, but it will help
us because that info will reduce code size increase in fixing unwind
destination mismatches in CFGStackify.

But for now we return false for these memory intrinsics and true for all
other libcalls conservatively.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 373967

4 years ago[llvm-lipo] Relax the check of the specified input file architecture
Alexander Shaposhnikov [Mon, 7 Oct 2019 21:14:22 +0000 (21:14 +0000)]
[llvm-lipo] Relax the check of the specified input file architecture

cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly.

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

Test plan: make check-all

llvm-svn: 373966

4 years ago[Attributor] Deduce memory behavior of functions and arguments
Johannes Doerfert [Mon, 7 Oct 2019 21:07:57 +0000 (21:07 +0000)]
[Attributor] Deduce memory behavior of functions and arguments

Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 373965

4 years ago[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract...
Roman Lebedev [Mon, 7 Oct 2019 20:53:27 +0000 (20:53 +0000)]
[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)

This can come up in Bit Stream abstractions.

The pattern looks big/scary, but it can't be simplified any further.
It only is so simple because a number of my preparatory folds had
happened already (shift amount reassociation / shift amount
reassociation in bit test, sign bit test detection).

Highlights:
* There are two main flavors: https://rise4fun.com/Alive/zWi
  The difference is add vs. sub, and left-shift of -1 vs. 1
* Since we only change the shift opcode,
  we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
* There can be truncation after high-bit-extraction:
  https://rise4fun.com/Alive/slHc1   (the main pattern i'm after!)
  Which means that we need to ignore zext of shift amounts and of NBits.
* The sign-extending magic can be extended itself (in add pattern
  via sext, in sub pattern via zext. not the other way around!)
  https://rise4fun.com/Alive/NhG
  (or those sext/zext can be sinked into `select`!)
  Which again means we should pay attention when matching NBits.
* We can have both truncation of extraction and widening of magic:
  https://rise4fun.com/Alive/XTw
  In other words, i don't believe we need to have any checks on
  bitwidths of any of these constructs.

This is worsened in general by the fact that we may have `sext` instead
of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
although we should. I have not done anything about that here.

Also, we really should have something to weed out `sub` like these,
by folding them into `add` variant.

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

llvm-svn: 373964

4 years ago[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern...
Roman Lebedev [Mon, 7 Oct 2019 20:53:16 +0000 (20:53 +0000)]
[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)

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

llvm-svn: 373963

4 years ago[InstCombine] Move isSignBitCheck(), handle rest of the predicates
Roman Lebedev [Mon, 7 Oct 2019 20:53:08 +0000 (20:53 +0000)]
[InstCombine] Move isSignBitCheck(), handle rest of the predicates

True, no test coverage is being added here. But those non-canonical
predicates that are already handled here already have no test coverage
as far as i can tell. I tried to add tests for them, but all the patterns
already get handled elsewhere.

llvm-svn: 373962

4 years ago[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with...
Roman Lebedev [Mon, 7 Oct 2019 20:53:00 +0000 (20:53 +0000)]
[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask

Summary:
Currently, we pre-check whether we need to produce a mask or not.
This involves some rather magical constants.
I'd like to extend this fold to also handle the situation
when there's also a `trunc` before outer shift.
That will require another set of magical constants.
It's ugly.

Instead, we can just compute the mask, and check
whether mask is a pass-through (all-ones) or not.
This way we don't need to have any magical numbers.

This change is NFC other than the fact that we now compute
the mask and then check if we need (and can!) apply it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373961

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts
Roman Lebedev [Mon, 7 Oct 2019 20:52:52 +0000 (20:52 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts

Summary:
When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
which means that for patterns a/b we'd assume that we must not produce
any bits for that channel, while in reality we simply didn't care
about that channel - i.e. we don't need to mask it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373960

4 years ago[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG
Cameron McInally [Mon, 7 Oct 2019 20:41:25 +0000 (20:41 +0000)]
[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG

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

llvm-svn: 373958

4 years ago[debugserver] Include the correct header.
Davide Italiano [Mon, 7 Oct 2019 20:35:22 +0000 (20:35 +0000)]
[debugserver] Include the correct header.

<rdar://problem/55916729>

llvm-svn: 373957

4 years ago[AccelTable] Remove stale comment (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:33:20 +0000 (20:33 +0000)]
[AccelTable] Remove stale comment (NFC)

rdar://55857228

llvm-svn: 373956

4 years ago[test] Rename `Modules` to `ObjectFile` (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:28 +0000 (20:31 +0000)]
[test] Rename `Modules` to `ObjectFile` (NFC)

llvm-svn: 373955

4 years ago[MachO] Shuffle some things around in ParseSymtab (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:22 +0000 (20:31 +0000)]
[MachO] Shuffle some things around in ParseSymtab (NFC)

llvm-svn: 373954

4 years ago[gdb-remote] process properly effective uid
Walter Erquinigo [Mon, 7 Oct 2019 20:26:49 +0000 (20:26 +0000)]
[gdb-remote] process properly effective uid

Summary:
Someone wrote SetEffectiveSetEffectiveGroupID instead of SetEffectiveUserID.

After this fix, the android process list can show user names, e.g.

```
PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
529    1      root       0          root       0                                         /sbin/ueventd
```
Reviewers: labath,clayborg,aadsm,xiaobai

Subscribers:

llvm-svn: 373953

4 years ago[OPENMP]Fix caonical->canonical, NFC.
Alexey Bataev [Mon, 7 Oct 2019 19:57:40 +0000 (19:57 +0000)]
[OPENMP]Fix caonical->canonical, NFC.

Fixed typo.

llvm-svn: 373952

4 years agoAttempt to fix a few clang-tidy tests on Windows, see PR43593.
Nico Weber [Mon, 7 Oct 2019 19:54:19 +0000 (19:54 +0000)]
Attempt to fix a few clang-tidy tests on Windows, see PR43593.

llvm-svn: 373951

4 years agoFix for expanding __pragmas in macro arguments
Amy Huang [Mon, 7 Oct 2019 19:41:53 +0000 (19:41 +0000)]
Fix for expanding __pragmas in macro arguments

Summary:
Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded.
This is what clang currently does when parsing _Pragmas.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed
when trying to get the length of an annotation token.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373950

4 years ago[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option
Louis Dionne [Mon, 7 Oct 2019 19:22:04 +0000 (19:22 +0000)]
[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option

That option controls the 'VERSION' attribute of the libc++abi shared
library, which in turn controls the name of the actual dylib being
produced.

llvm-svn: 373949

4 years agogn build: try to make system-libs.windows.test pass
Nico Weber [Mon, 7 Oct 2019 19:17:02 +0000 (19:17 +0000)]
gn build: try to make system-libs.windows.test pass

llvm-svn: 373948

4 years agoAMDGPU/GlobalISel: Handle more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 19:16:26 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Handle more G_INSERT cases

Start manually writing a table to get the subreg index. TableGen
should probably generate this, but I'm not sure what it looks like in
the arbitrary case where subregisters are allowed to not fully cover
the super-registers.

llvm-svn: 373947

4 years agoGlobalISel: Partially implement lower for G_INSERT
Matt Arsenault [Mon, 7 Oct 2019 19:13:27 +0000 (19:13 +0000)]
GlobalISel: Partially implement lower for G_INSERT

llvm-svn: 373946

4 years agoAMDGPU/GlobalISel: Fix selection of 16-bit shifts
Matt Arsenault [Mon, 7 Oct 2019 19:10:44 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Fix selection of 16-bit shifts

llvm-svn: 373945

4 years agoAMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32
Matt Arsenault [Mon, 7 Oct 2019 19:10:43 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32

llvm-svn: 373944

4 years agoAMDGPU/GlobalISel: Use S_MOV_B64 for inline constants
Matt Arsenault [Mon, 7 Oct 2019 19:07:19 +0000 (19:07 +0000)]
AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants

This hides some defects in SIFoldOperands when the immediates are
split.

llvm-svn: 373943

4 years agoAMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources
Matt Arsenault [Mon, 7 Oct 2019 19:05:58 +0000 (19:05 +0000)]
AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources

Continue making a mess of merge/unmerge legality.

llvm-svn: 373942

4 years ago[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi
Louis Dionne [Mon, 7 Oct 2019 18:55:15 +0000 (18:55 +0000)]
[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi

CMake sets adds that definition automatically, but we don't need
or use it.

llvm-svn: 373940

4 years ago[OPENMP50]Treat range-based for as canonical loop.
Alexey Bataev [Mon, 7 Oct 2019 18:54:57 +0000 (18:54 +0000)]
[OPENMP50]Treat range-based for as canonical loop.

According to OpenMP 5.0, range-based for is also considered as a
canonical form of loops.

llvm-svn: 373939

4 years agoAMDGPU/GlobalISel: Select more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 18:43:31 +0000 (18:43 +0000)]
AMDGPU/GlobalISel: Select more G_INSERT cases

At minimum handle the s64 insert type, which are emitted in real cases
during legalization.

We really need TableGen to emit something to emit something like the
inverse of composeSubRegIndices do determine the subreg index to use.

llvm-svn: 373938

4 years agoGlobalISel: Add target pre-isel instructions
Matt Arsenault [Mon, 7 Oct 2019 18:43:29 +0000 (18:43 +0000)]
GlobalISel: Add target pre-isel instructions

Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.

Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.

llvm-svn: 373937

4 years ago[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build
Michal Gorny [Mon, 7 Oct 2019 18:14:56 +0000 (18:14 +0000)]
[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build

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

llvm-svn: 373936

4 years agoSecond attempt to add iterator_range::empty()
Jordan Rose [Mon, 7 Oct 2019 18:14:24 +0000 (18:14 +0000)]
Second attempt to add iterator_range::empty()

Doing this makes MSVC complain that `empty(someRange)` could refer to
either C++17's std::empty or LLVM's llvm::empty, which previously we
avoided via SFINAE because std::empty is defined in terms of an empty
member rather than begin and end. So, switch callers over to the new
method as it is added.

https://reviews.llvm.org/D68439

llvm-svn: 373935

4 years ago[libc++abi] Remove redundant link flags on Apple platforms
Louis Dionne [Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)]
[libc++abi] Remove redundant link flags on Apple platforms

These flags are already set when we create the cxxabi_shared target
using the SOVERSION and VERSION target properties, and the install_name
was already being overriden to '@rpath/libc++abi.1.dylib' by CMake
because no 'CMAKE_INSTALL_NAME_DIR' option was specified. So this is
effectively a removal of dead code with no intended functionality change.

The only think we're losing here is that we used to link against
libSystem.B.dylib instead of libSystem.dylib when building libc++abi
for macOS 10.6 -- however, I strongly suspect nobody's building
libc++abi from source for that target anymore.

llvm-svn: 373934

4 years agoTry to get clangd tests passing on Windows.
Nico Weber [Mon, 7 Oct 2019 17:55:05 +0000 (17:55 +0000)]
Try to get clangd tests passing on Windows.

Part of PR43592. See also r328645.

llvm-svn: 373932

4 years ago[platform process list] add a flag for showing the processes of all users
Walter Erquinigo [Mon, 7 Oct 2019 17:49:32 +0000 (17:49 +0000)]
[platform process list] add a flag for showing the processes of all users

Summary:
For context: https://reviews.llvm.org/D68293

We need a way to show all the processes on android regardless of the user id.
When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.

Before:
```
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
3234   1                 aarch64-unknown-linux-android adbd
8034   3234              aarch64-unknown-linux-android sh
9096   3234              aarch64-unknown-linux-android sh
9098   9096              aarch64-unknown-linux-android lldb-server
(lldb) ^D
```

Now:
```
(lldb) platform process list -x
205 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
1      0                                          init
524    1                                          init
525    1                                          init
531    1                                          ueventd
568    1                                          logd
569    1                 aarch64-unknown-linux-android servicemanager
570    1                 aarch64-unknown-linux-android hwservicemanager
571    1                 aarch64-unknown-linux-android vndservicemanager
577    1                 aarch64-unknown-linux-android qseecomd
580    577               aarch64-unknown-linux-android qseecomd
...
23816  979                                        com.android.providers.calendar
24600  979                                        com.verizon.mips.services
27888  979                                        com.hualai
28043  2378                                       com.android.chrome:sandboxed_process0
31449  979                                        com.att.shm
31779  979                                        com.samsung.android.authfw
31846  979                                        com.samsung.android.server.iris
32014  979                                        com.samsung.android.MtpApplication
32045  979                                        com.samsung.InputEventApp
```

Reviewers: labath,xiaobai,aadsm,clayborg

Subscribers:

llvm-svn: 373931

4 years ago[scudo][standalone] Correct releaseToOS behavior
Kostya Kortchinsky [Mon, 7 Oct 2019 17:37:39 +0000 (17:37 +0000)]
[scudo][standalone] Correct releaseToOS behavior

Summary:
There was an issue in `releaseToOSMaybe`: one of the criteria to
decide if we should proceed with the release was wrong. Namely:

```
const uptr N = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
if (N * BlockSize < PageSize)
  return; // No chance to release anything.
```

I meant to check if the amount of bytes in the free list was lower
than a page, but this actually checks if the amount of **in use** bytes
was lower than a page.

The correct code is:

```
const uptr BytesInFreeList =
  Region->AllocatedUser -
  (Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
if (BytesInFreeList < PageSize)
  return 0; // No chance to release anything.
```

Consequences of the bug:
- if a class size has less than a page worth of in-use bytes (allocated
  or in a cache), reclaiming would not occur, whatever the amount of
  blocks in the free list; in real world scenarios this is unlikely to
  happen and be impactful;
- if a class size had less than a page worth of free bytes (and enough
  in-use bytes, etc), then reclaiming would be attempted, with likely
  no result. This means the reclaiming was overzealous at times.

I didn't have a good way to test for this, so I changed the prototype
of the function to return the number of bytes released, allowing to
get the information needed. The test added fails with the initial
criteria.

Another issue is that `ReleaseToOsInterval` can actually be 0, meaning
we always try to release (side note: it's terrible for performances).
so change a `> 0` check to `>= 0`.

Additionally, decrease the `CanRelease` threshold to `PageSize / 32`.
I still have to make that configurable but I will do it at another time.

Finally, rename some variables in `printStats`: I feel like "available"
was too ambiguous, so change it to "total".

Reviewers: morehouse, hctim, eugenis, vitalybuka, cferris

Reviewed By: morehouse

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373930

4 years agoFix Calling Convention through aliases
Erich Keane [Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)]
Fix Calling Convention through aliases

r369697 changed the behavior of stripPointerCasts to no longer include
aliases.  However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.

The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.

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

llvm-svn: 373929

4 years ago[libTooling][NFC] Fix build break in r373916.
Yitzhak Mandelbaum [Mon, 7 Oct 2019 17:24:23 +0000 (17:24 +0000)]
[libTooling][NFC] Fix build break in r373916.

r373916 used raw strings inside macro calls, which breaks some builds.

llvm-svn: 373928

4 years ago[DWARFASTParserClang] Factor out structure-like type parsing, NFC
Vedant Kumar [Mon, 7 Oct 2019 17:22:53 +0000 (17:22 +0000)]
[DWARFASTParserClang] Factor out structure-like type parsing, NFC

Split out the logic to parse structure-like types into a separate
function, in an attempt to reduce the complexity of ParseTypeFromDWARF.

Inspired by discussion in https://reviews.llvm.org/D68130.

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

llvm-svn: 373927

4 years ago[DWARFASTParserClang] Delete commented-out typedef, NFC
Vedant Kumar [Mon, 7 Oct 2019 17:22:50 +0000 (17:22 +0000)]
[DWARFASTParserClang] Delete commented-out typedef, NFC

(& group together all the protected members & typedefs)

llvm-svn: 373926

4 years agoProcessInstanceInfoMatch: Don't match processes with no name if a name match was...
Pavel Labath [Mon, 7 Oct 2019 17:17:53 +0000 (17:17 +0000)]
ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested

Since D68289, a couple of tests on linux started being extremely flaky.
All of them were doing name-based attaching and were failing because
they couldn't find an unambiguous process to attach to.

The patch above changed the process finding logic, so that failure to
find a process name does not constitute an error. This meant that a lot
more transient processes showed up in the process list during the test
suite run. Previously, these processes would not appear as they would be
gone by the time we went to read their executable name, arguments, etc.

Now, this alone should not cause an issue were it not for the fact that
we were considering a process with no name as if it matched by default
(even if we were explicitly searching for a process with a specified
name). This meant that any of the "transient" processes with no name
would make the name match ambiguous. That clearly seems like a bug to me
so I fix that.

llvm-svn: 373925

4 years ago[clangd] Fix raciness in code completion tests
Kadir Cetinkaya [Mon, 7 Oct 2019 17:12:18 +0000 (17:12 +0000)]
[clangd] Fix raciness in code completion tests

Reviewers: sammccall, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 373924

4 years ago[Remarks] Pass StringBlockValue as StringRef.
Florian Hahn [Mon, 7 Oct 2019 17:05:09 +0000 (17:05 +0000)]
[Remarks] Pass StringBlockValue as StringRef.

After changing the remark serialization, we now pass StringRefs to the
serializer. We should use StringRef for StringBlockVal, to avoid
creating temporary objects, which then cause StringBlockVal.Value to
point to invalid memory.

Reviewers: thegameg, anemet

Reviewed By: thegameg

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

llvm-svn: 373923

4 years ago[clang-format] [PR27004] omits leading space for noexcept when formatting operator...
Paul Hoad [Mon, 7 Oct 2019 17:03:44 +0000 (17:03 +0000)]
[clang-format] [PR27004] omits leading space for noexcept when formatting operator delete()

Summary:
clang-format is incorrectly thinking the parameter parens are part of a cast operation, this is resulting in there sometimes being not space between the paren and the noexcept (and other keywords like volatile etc..)

```
void operator++(int) noexcept;
void operator++(int &) noexcept;
void operator delete(void *, std::size_t, const std::nothrow_t &)noexcept;
```

Reviewers: klimek, owenpan, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 373922

4 years ago[clang-format] [NFC] Ensure clang-format is itself clang-formatted.
Paul Hoad [Mon, 7 Oct 2019 16:53:35 +0000 (16:53 +0000)]
[clang-format] [NFC] Ensure clang-format is itself clang-formatted.

Summary:
Before making a proposed change, ensure ClangFormat.cpp is fully clang-formatted,

no functional change just clang-formatting using the in tree .clang-format.

Reviewers: mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: Eugene.Zelenko, cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 373921

4 years agoFix build errors caused by rL373914.
Wei Mi [Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)]
Fix build errors caused by rL373914.

llvm-svn: 373919

4 years agoCodegen - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 16:42:25 +0000 (16:42 +0000)]
Codegen - silence static analyzer getAs<> null dereference warnings. NFCI.

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

llvm-svn: 373918

4 years ago[llvm-profdata] Minor format fix
Wenlei He [Mon, 7 Oct 2019 16:30:31 +0000 (16:30 +0000)]
[llvm-profdata] Minor format fix

Summary: Minor format fix for output of "llvm-profdata -show"

Reviewers: wmi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373917

4 years ago[libTooling] Add `toString` method to the Stencil class
Yitzhak Mandelbaum [Mon, 7 Oct 2019 16:20:22 +0000 (16:20 +0000)]
[libTooling] Add `toString` method to the Stencil class

Summary:
`toString` generates a string representation of the stencil.

Patch by Harshal T. Lehri.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373916

4 years ago[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 16:15:20 +0000 (16:15 +0000)]
[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.

Stop all the callers from having to check the value type before calling getTargetShuffleInputs.

llvm-svn: 373915

4 years ago[SampleFDO] Add compression support for any section in ExtBinary profile format
Wei Mi [Mon, 7 Oct 2019 16:12:37 +0000 (16:12 +0000)]
[SampleFDO] Add compression support for any section in ExtBinary profile format

Previously ExtBinary profile format only supports compression using zlib for
profile symbol list. In this patch, we extend the compression support to any
section. User can select some or all of the sections to compress. In an
experiment, for a 45M profile in ExtBinary format, compressing name table
reduced its size to 24M, and compressing all the sections reduced its size
to 11M.

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

llvm-svn: 373914

4 years ago[LoopVectorize] add test that asserted after cost model change (PR43582); NFC
Sanjay Patel [Mon, 7 Oct 2019 14:48:27 +0000 (14:48 +0000)]
[LoopVectorize] add test that asserted after cost model change (PR43582); NFC

llvm-svn: 373913

4 years agoAllow update_test_checks.py to not scrub names.
David Greene [Mon, 7 Oct 2019 14:37:20 +0000 (14:37 +0000)]
Allow update_test_checks.py to not scrub names.

Add a --preserve-names option to tell the script not to replace IR names.
Sometimes tests want those names.  For example if a test is looking for a
modification to an existing instruction we'll want to make the names.

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

llvm-svn: 373912

4 years agoSema - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 14:25:46 +0000 (14:25 +0000)]
Sema - silence static analyzer getAs<> null dereference warnings. NFCI.

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

llvm-svn: 373911

4 years ago[clang] Add test for FindNextToken in Lexer.
Utkarsh Saxena [Mon, 7 Oct 2019 14:20:46 +0000 (14:20 +0000)]
[clang] Add test for FindNextToken in Lexer.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373910

4 years agoFix another sphinx warning.
Kevin P. Neal [Mon, 7 Oct 2019 14:14:46 +0000 (14:14 +0000)]
Fix another sphinx warning.

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

llvm-svn: 373909

4 years agoRegenerate ptr-rotate.ll . NFC
Amaury Sechet [Mon, 7 Oct 2019 14:10:21 +0000 (14:10 +0000)]
Regenerate ptr-rotate.ll . NFC

llvm-svn: 373908

4 years ago[Mips] Always save RA when disabling frame pointer elimination
Simon Atanasyan [Mon, 7 Oct 2019 14:01:37 +0000 (14:01 +0000)]
[Mips] Always save RA when disabling frame pointer elimination

This ensures that frame-based unwinding will continue to work when
calling a noreturn function; there is not much use having the caller's
frame pointer saved if you don't also have the caller's program counter.

Patch by James Clarke.

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

llvm-svn: 373907

4 years ago[Mips] Fix evaluating J-format branch targets
Simon Atanasyan [Mon, 7 Oct 2019 14:01:22 +0000 (14:01 +0000)]
[Mips] Fix evaluating J-format branch targets

J/JAL/JALX/JALS are absolute branches, but stay within the current
256 MB-aligned region, so we must include the high bits of the
instruction address when calculating the branch target.

Patch by James Clarke.

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

llvm-svn: 373906

4 years agoRewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 13:58:15 +0000 (13:58 +0000)]
RewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

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

llvm-svn: 373905

4 years agoAST - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 13:58:05 +0000 (13:58 +0000)]
AST - silence static analyzer getAs<> null dereference warnings. NFCI.

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

llvm-svn: 373904

4 years ago[LLVM-C] Add bindings to create macro debug info
whitequark [Mon, 7 Oct 2019 13:57:13 +0000 (13:57 +0000)]
[LLVM-C] Add bindings to create macro debug info

Summary: The C API doesn't have the bindings to create macro debug information.

Reviewers: whitequark, CodaFi, deadalnix

Reviewed By: whitequark

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373903

4 years agoFix sphinx warnings.
Kevin P. Neal [Mon, 7 Oct 2019 13:39:56 +0000 (13:39 +0000)]
Fix sphinx warnings.

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

llvm-svn: 373902

4 years agoTest commit
Mirko Brkusanin [Mon, 7 Oct 2019 13:23:12 +0000 (13:23 +0000)]
Test commit

Fix comment.

llvm-svn: 373901

4 years ago[FPEnv] Add constrained intrinsics for lrint and lround
Kevin P. Neal [Mon, 7 Oct 2019 13:20:00 +0000 (13:20 +0000)]
[FPEnv] Add constrained intrinsics for lrint and lround

Earlier in the year intrinsics for lrint, llrint, lround and llround were
added to llvm. The constrained versions are now implemented here.

Reviewed by: andrew.w.kaylor, craig.topper, cameron.mcinally
Approved by: craig.topper
Differential Revision: https://reviews.llvm.org/D64746

llvm-svn: 373900

4 years agogn build: use better triple on windows
Nico Weber [Mon, 7 Oct 2019 13:13:31 +0000 (13:13 +0000)]
gn build: use better triple on windows

The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is
important because e.g. clang/test/lit.cfg.py matches against the
suffix "windows-msvc" to compute the presence of the "ms-sdk" and
the absence of the "LP64" feature.

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

llvm-svn: 373899

4 years agoRevert r373888 "[IA] Recognize hexadecimal escape sequences"
Nico Weber [Mon, 7 Oct 2019 11:46:26 +0000 (11:46 +0000)]
Revert r373888 "[IA] Recognize hexadecimal escape sequences"

It broke MC/AsmParser/directive_ascii.s on all bots:

    Assertion failed: (Index < Length && "Invalid index!"), function operator[],
        file ../../llvm/include/llvm/ADT/StringRef.h, line 243.

llvm-svn: 373898

4 years ago[clangd] Catch an unchecked "Expected<T>" in HeaderSourceSwitch.
Haojian Wu [Mon, 7 Oct 2019 11:37:25 +0000 (11:37 +0000)]
[clangd] Catch an unchecked "Expected<T>" in HeaderSourceSwitch.

Summary: Also fixes a potential user-after-scope issue of "Path".

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 373897

4 years ago[ASTImporter][NFC] Enable disabled but passing test
Gabor Marton [Mon, 7 Oct 2019 11:34:54 +0000 (11:34 +0000)]
[ASTImporter][NFC] Enable disabled but passing test

RedeclChainShouldBeCorrectAmongstNamespaces

llvm-svn: 373896

4 years ago[ASTImporter][NFC] Update ASTImporter internals docs
Gabor Marton [Mon, 7 Oct 2019 11:15:18 +0000 (11:15 +0000)]
[ASTImporter][NFC] Update ASTImporter internals docs

llvm-svn: 373895

4 years ago[ASTImporter][NFC] Fix typo in user docs
Gabor Marton [Mon, 7 Oct 2019 11:14:53 +0000 (11:14 +0000)]
[ASTImporter][NFC] Fix typo in user docs

llvm-svn: 373894

4 years ago[AMDGPU] Fix test checks
Jay Foad [Mon, 7 Oct 2019 10:57:41 +0000 (10:57 +0000)]
[AMDGPU] Fix test checks

The GFX10-DENORM-STRICT checks were only passing by accident. Fix them
to make the test more robust in the face of scheduling or register
allocation changes.

llvm-svn: 373893

4 years ago[clangd] If an undocumented definition exists, don't accept documentation from other...
Sam McCall [Mon, 7 Oct 2019 10:53:56 +0000 (10:53 +0000)]
[clangd] If an undocumented definition exists, don't accept documentation from other forward decls.

Summary:
This fixes cases like:
  foo.h
    class Undocumented{}
  bar.h
    // break an include cycle. we should refactor this!
    class Undocumented;
Where the comment doesn't describe the class.

Note that a forward decl that is *visible to the definition* will still have
its doc comment used, by SymbolCollector: Merge isn't involved here.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 373892

4 years ago[lldb][ELF] Read symbols from .gnu_debugdata sect.
Konrad Kleine [Mon, 7 Oct 2019 10:32:16 +0000 (10:32 +0000)]
[lldb][ELF] Read symbols from .gnu_debugdata sect.

Summary:
If the .symtab section is stripped from the binary it might be that
there's a .gnu_debugdata section which contains a smaller .symtab in
order to provide enough information to create a backtrace with function
names or to set and hit a breakpoint on a function name.

This change looks for a .gnu_debugdata section in the ELF object file.
The .gnu_debugdata section contains a xz-compressed ELF file with a
.symtab section inside. Symbols from that compressed .symtab section
are merged with the main object file's .dynsym symbols (if any).
In addition we always load the .dynsym even if there's a .symtab
section.

For example, the Fedora and RHEL operating systems strip their binaries
but keep a .gnu_debugdata section. While gdb already can read this
section, LLDB until this patch couldn't. To test this patch on a
Fedora or RHEL operating system, try to set a breakpoint on the "help"
symbol in the "zip" binary. Before this patch, only GDB can set this
breakpoint; now LLDB also can do so without installing extra debug
symbols:

    lldb /usr/bin/zip -b -o "b help" -o "r" -o "bt" -- -h

The above line runs LLDB in batch mode and on the "/usr/bin/zip -h"
target:

    (lldb) target create "/usr/bin/zip"
    Current executable set to '/usr/bin/zip' (x86_64).
    (lldb) settings set -- target.run-args  "-h"

Before the program starts, we set a breakpoint on the "help" symbol:

    (lldb) b help
    Breakpoint 1: where = zip`help, address = 0x00000000004093b0

Once the program is run and has hit the breakpoint we ask for a
backtrace:

    (lldb) r
    Process 10073 stopped
    * thread #1, name = 'zip', stop reason = breakpoint 1.1
        frame #0: 0x00000000004093b0 zip`help
    zip`help:
    ->  0x4093b0 <+0>:  pushq  %r12
        0x4093b2 <+2>:  movq   0x2af5f(%rip), %rsi       ;  + 4056
        0x4093b9 <+9>:  movl   $0x1, %edi
        0x4093be <+14>: xorl   %eax, %eax

    Process 10073 launched: '/usr/bin/zip' (x86_64)
    (lldb) bt
    * thread #1, name = 'zip', stop reason = breakpoint 1.1
      * frame #0: 0x00000000004093b0 zip`help
        frame #1: 0x0000000000403970 zip`main + 3248
        frame #2: 0x00007ffff7d8bf33 libc.so.6`__libc_start_main + 243
        frame #3: 0x0000000000408cee zip`_start + 46

In order to support the .gnu_debugdata section, one has to have LZMA
development headers installed. The CMake section, that controls this
part looks for the LZMA headers and enables .gnu_debugdata support by
default if they are found; otherwise or if explicitly requested, the
minidebuginfo support is disabled.

GDB supports the "mini debuginfo" section .gnu_debugdata since v7.6
(2013).

Reviewers: espindola, labath, jankratochvil, alexshap

Reviewed By: labath

Subscribers: rnkovacs, wuzish, shafik, emaste, mgorny, arichardson, hiraditya, MaskRay, lldb-commits

Tags: #lldb, #llvm

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

llvm-svn: 373891

4 years ago[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG...
George Rimar [Mon, 7 Oct 2019 10:29:38 +0000 (10:29 +0000)]
[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.

This patch:

* Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do not have any)
* Enables dumping of SHT_LLVM_ADDRSIG with --all.
* Changes the logic to report a warning instead of an error when something goes wrong during dumping
  (allows to continue dumping SHT_LLVM_ADDRSIG and other sections on error).
* Refactors a piece of logic to a new toULEB128Array helper which might be used for GNU-style
  dumping implementation.

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

llvm-svn: 373890

4 years ago[clangd] Collect missing macro references.
Haojian Wu [Mon, 7 Oct 2019 10:10:31 +0000 (10:10 +0000)]
[clangd] Collect missing macro references.

Summary: Semantic highlghting is missing a few macro references.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 373889

4 years ago[IA] Recognize hexadecimal escape sequences
Bill Wendling [Mon, 7 Oct 2019 09:54:53 +0000 (09:54 +0000)]
[IA] Recognize hexadecimal escape sequences

Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.

Reviewers: nickdesaulniers

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373888

4 years agoclang-cl: Ignore the new /ZH options
Hans Wennborg [Mon, 7 Oct 2019 09:30:15 +0000 (09:30 +0000)]
clang-cl: Ignore the new /ZH options

These were added to the MS docs in
https://github.com/MicrosoftDocs/cpp-docs/commit/85b9b6967e58e485251450f7451673f6fc873e88
and are supposedly available in VS 2019 16.4 (though my 2019 Preview,
version 16.4.0-pre.1.0 don't seem to have them.)

llvm-svn: 373887

4 years ago[ELF][MIPS] De-template writeValue. NFC
Fangrui Song [Mon, 7 Oct 2019 08:52:07 +0000 (08:52 +0000)]
[ELF][MIPS] De-template writeValue. NFC

Depends on D68561.

llvm-svn: 373886

4 years ago[ELF] Wrap things in `namespace lld { namespace elf {`, NFC
Fangrui Song [Mon, 7 Oct 2019 08:31:18 +0000 (08:31 +0000)]
[ELF] Wrap things in `namespace lld { namespace elf {`, NFC

This makes it clear `ELF/**/*.cpp` files define things in the `lld::elf`
namespace and simplifies `elf::foo` to `foo`.

Reviewed By: atanasyan, grimar, ruiu

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

llvm-svn: 373885

4 years ago[ELF][MIPS] Use lld::elf::{read,write}* instead of llvm::support::endian::{read,write}*
Fangrui Song [Mon, 7 Oct 2019 08:30:46 +0000 (08:30 +0000)]
[ELF][MIPS] Use lld::elf::{read,write}* instead of llvm::support::endian::{read,write}*

This allows us to delete `using namespace llvm::support::endian` and
simplify D68323. This change adds runtime config->endianness check but
the overhead should be negligible.

Reviewed By: ruiu

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

llvm-svn: 373884

4 years ago[TableGen] Pacify gcc-5.4 more
James Molloy [Mon, 7 Oct 2019 08:23:20 +0000 (08:23 +0000)]
[TableGen] Pacify gcc-5.4 more

Followup to a previous pacification, this performs the same workaround
to the TableGen generated code for tuple automata.

llvm-svn: 373883

4 years agoRevert "[SLP] avoid reduction transform on patterns that the backend can load-combine"
Martin Storsjo [Mon, 7 Oct 2019 08:21:37 +0000 (08:21 +0000)]
Revert "[SLP] avoid reduction transform on patterns that the backend can load-combine"

This reverts SVN r373833, as it caused a failed assert "Non-zero loop
cost expected" on building numerous projects, see PR43582 for details
and reproduction samples.

llvm-svn: 373882

4 years ago[llvm-locstats] Fix a typo in the documentation; NFC
Djordje Todorovic [Mon, 7 Oct 2019 07:31:49 +0000 (07:31 +0000)]
[llvm-locstats] Fix a typo in the documentation; NFC

llvm-svn: 373880