Commit Graph

307537 Commits

Author SHA1 Message Date
Joachim Protze 582b183dda [OMPT] Make sure that OMPT is enabled when accessing internals of the runtime
Make sure that OMPT is enabled in runtime entry points that access internals
of the runtime. Else, return an appropiate value indicating an error or that
the data is not available.

Patch provided by @sconvent

Reviewers: jlpeyton, omalyshe, hbae, Hahnfeld, joachim.protze

Reviewed By: joachim.protze

Tags: #openmp, #ompt

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

llvm-svn: 351311
2019-01-16 08:58:17 +00:00
Sam Parker dd8cd6d26b [DAGCombine] Fix ReduceLoadWidth for shifted offsets
ReduceLoadWidth can trigger using a shifted mask is used and this
requires that the function return a shl node to correct for the
offset. However, the way that this was implemented meant that the
returned result could be an existing node, which would be incorrect.
This fixes the method of inserting the new node and replacing uses.

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

llvm-svn: 351310
2019-01-16 08:40:12 +00:00
Hans Wennborg 16df4503d6 Include lldb in Win snapshots again (PR37307)
llvm-svn: 351309
2019-01-16 08:38:28 +00:00
Clement Courbet ae814fcb4c [clang-tidy] bugprone-string-constructor: Catch string from nullptr.
Summary: Context: https://twitter.com/willkirkby/status/1084219580799741953

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 351308
2019-01-16 08:36:23 +00:00
Sam McCall 5a8e6afff2 [clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047
llvm-svn: 351307
2019-01-16 08:29:54 +00:00
Fangrui Song 54762df8f6 [clangd] Fix XPC after rCTE351280
llvm-svn: 351306
2019-01-16 08:13:15 +00:00
Martin Storsjo 58bb0e47dc [llvm-rc] Support '--' for delimiting options from input paths
This allows avoiding conflicts between paths that begin with the same
chars as some llvm-rc options (which can be used with either slashes
or dashes).

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

llvm-svn: 351305
2019-01-16 08:09:22 +00:00
Michal Gorny 851aec455b [test] Disable Python binding tests w/ LLVM_ENABLE_PIC=OFF
Disable Python binding tests when LLVM_ENABLE_PIC is disabled,
as libclang.so is not being built in that case.  Reported by Nico Weber.

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

llvm-svn: 351304
2019-01-16 08:05:13 +00:00
Martin Bohme c4db59c63c [clang-tidy] Treat references to smart pointers correctly in use-after-move.
Summary:
Previously, we weren't recognizing these as smart pointers and thus
weren't allowing non-dereference accesses as we should -- see new test
cases which fail without the fix.

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: JonasToth

Subscribers: xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 351303
2019-01-16 07:53:25 +00:00
Sanjin Sijaric cfa2a2afa6 [SEH] Pass the frame pointer from SEH finally to finally functions
Pass the frame pointer that the first finally block receives onto the nested
finally block, instead of generating it using localaddr.

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

llvm-svn: 351302
2019-01-16 07:39:44 +00:00
Craig Topper 94d6dd4c08 [X86] Correct the type string for __builtin_ia32_gathersiv16sf to make the indices an integer type not an FP type.
The element count and width remain the same. This went unnoticed because default conversion from builtin to intrinsic will generate a bitcast if the types don't match.

llvm-svn: 351301
2019-01-16 07:17:14 +00:00
Dmitry Venikov d3f21d3a08 [llvm-symbolizer] Add -C as a short alias to -demangle
Summary: Provides -C as alias to -demangle. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40069.

Reviewers: jhenderson, ruiu, rnk, fjricci

Reviewed By: jhenderson, ruiu

Subscribers: rupprecht, erik.pilkington, llvm-commits

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

llvm-svn: 351300
2019-01-16 07:05:58 +00:00
Eric Fiselier 973eab8a5d correct script name in generated tests
llvm-svn: 351299
2019-01-16 05:43:02 +00:00
Dan Gohman 788ce374c4 [WebAssembly] COWS has been renamed to WASI.
llvm-svn: 351298
2019-01-16 05:23:57 +00:00
Dan Gohman 9299637d3c [WebAssembly] COWS has been renamed to WASI.
llvm-svn: 351297
2019-01-16 05:23:52 +00:00
Tom Stellard 3d36e5c3e6 Only promote args when function attributes are compatible
Summary:
Check to make sure that the caller and the callee have compatible
function arguments before promoting arguments.  This uses the same
TargetTransformInfo queries that are used to determine if attributes
are compatible for inlining.

The goal here is to avoid breaking ABI when a called function's ABI
depends on a target feature that is not enabled in the caller.

This is a very conservative fix for PR37358.  Ideally we would have a more
sophisticated check for ABI compatiblity rather than checking if the
attributes are compatible for inlining.

Reviewers: echristo, chandlerc, eli.friedman, craig.topper

Reviewed By: echristo, chandlerc

Subscribers: nikic, xbolva00, rkruppe, alexcrichton, llvm-commits

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

llvm-svn: 351296
2019-01-16 05:15:31 +00:00
Serguei Katkov a5b0e5585b [InstCombine]Avoid introduction of unaligned mem access
InstCombine is able to transform mem transfer instrinsic to alone store or store/load pair.
It might result in generation of unaligned atomic load/store which later in backend
will be transformed to libcall. It is not an evident gain and it is better to keep intrinsic as is
and handle it at backend.

Reviewers: reames, anna, apilipenko, mkazantsev
Reviewed By: reames
Subscribers: t.p.northover, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D56582

llvm-svn: 351295
2019-01-16 04:36:26 +00:00
Eric Fiselier 8e92050794 [SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
When -faligned-allocation is specified in C++03 libc++ defines
std::align_val_t as an unscoped enumeration type (because Clang didn't
provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with
the sized deallocation overloads which aren't enabled. This caused Clang
to call the aligned deallocation function as if it were the sized
deallocation overload.

For example: https://godbolt.org/z/xXJELh

This patch fixes the confusion.

llvm-svn: 351294
2019-01-16 02:34:36 +00:00
Peter Collingbourne d88cbd57d3 gn build: Merge r351283.
llvm-svn: 351293
2019-01-16 02:27:12 +00:00
Eric Fiselier efdac65f70 Attempt to make test_macros.h even more minimal
llvm-svn: 351292
2019-01-16 02:16:57 +00:00
Eric Fiselier 05019eb79f Fix feature test macros for atomics/mutexes without threading
llvm-svn: 351291
2019-01-16 02:10:28 +00:00
Eric Fiselier d01a4aa068 Fix PR40230 - std::pair may have padding on FreeBSD.
Summary:
FreeBSD ships a very old and deprecated ABI for std::pair where the copy and move constructors are not allowed to be trivial. D25389 change how this was implemented by introducing a non-trivial base class. This patch, introduced in October 2016, introduced an ABI bug that caused nested `std::pair` instantiations to have padding. For example:

```
using PairT = std::pair< std::pair<char, char>, char >;
static_assert(offsetof(PairT, first) == 0, "First member should exist at offset zero"); // Fails on FreeBSD!
```

The bug occurs because the base class for the first element (the nested pair) cannot be put at offset zero because the top-level pair already has the same base class laid out there.

This patch fixes that ABI bug by templating the dummy base class on the same parameters as the pair.

Technically this fix is an ABI break for users who depend on the "broken" ABI introduced in 2016. I'm putting this up for review so that the FreeBSD maintainers can sign off on fixing the ABI by breaking the ABI.
Another option, since we have to "break" the ABI to fix it, would be to move FreeBSD off the deprecated non-trivial pair ABI instead.

Also see:

* https://llvm.org/PR40230
* https://reviews.llvm.org/D21329



Reviewers: rsmith, dim, emaste

Reviewed By: rsmith

Subscribers: mclow.lists, krytarowski, christof, ldionne, libcxx-commits

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

llvm-svn: 351290
2019-01-16 01:54:34 +00:00
Eric Fiselier d108bf85b0 Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: ldionne, EricWF

Subscribers: jyknight, christof, libcxx-commits

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

llvm-svn: 351289
2019-01-16 01:51:12 +00:00
Julian Lettner ac855d3ea9 [TSan] Use switches when dealing with enums
Summary:
Small refactoring: replace some if-else cascades with switches so that the compiler warns us about missing cases.
Maybe found a small bug?

Reviewers: dcoughlin, kubamracek, dvyukov, delcypher, jfb

Reviewed By: dvyukov

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 351288
2019-01-16 01:45:12 +00:00
Sam Clegg 6320efb4ed [WebAssembly] Store section alignment as a power of 2
This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

llvm-svn: 351287
2019-01-16 01:43:21 +00:00
Eric Fiselier 32784a740a Implement feature test macros using a script.
Summary:
This patch implements all the feature test macros libc++ currently supports, as specified by the standard or cppreference prior to C++2a.

The tests and `<version>` header are generated using a script. The script contains a table of each feature test macro, the headers it should be accessible from, and its values of each dialect of C++.
When a new feature test macro is added or needed, the table should be updated and the script re-run.



Reviewers: mclow.lists, jfb, serge-sans-paille

Reviewed By: mclow.lists

Subscribers: arphaman, jfb, ldionne, libcxx-commits

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

llvm-svn: 351286
2019-01-16 01:37:43 +00:00
Sam Clegg 56c587adfd [WebAssembly] Store section alignment as a power of 2
This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

llvm-svn: 351285
2019-01-16 01:34:48 +00:00
Eli Friedman c4c43b2bad [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
This is the clang counterpart to D56747.

Patch by Mandeep Singh Grang.

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

llvm-svn: 351284
2019-01-16 00:50:44 +00:00
Aditya Nandakumar 500e3ead9f [GISel]: Add support for CSEing continuously during GISel passes.
https://reviews.llvm.org/D52803

This patch adds support to continuously CSE instructions during
each of the GISel passes. It consists of a GISelCSEInfo analysis pass
that can be used by the CSEMIRBuilder.

llvm-svn: 351283
2019-01-16 00:40:37 +00:00
Vlad Tsyrklevich e3226737ce Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database."
This reverts commits r351222 and r351229, they were causing ASan/MSan failures
on the sanitizer bots.

llvm-svn: 351282
2019-01-16 00:37:39 +00:00
Mandeep Singh Grang 436735c3fe [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Summary:
Make recoverfp intrinsic target-independent so that it can be implemented for AArch64, etc.
Refer D53541 for the context. Clang counterpart D56748.

Reviewers: rnk, efriedma

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 351281
2019-01-16 00:37:13 +00:00
Jan Korous dca9c7cf24 [clangd] XPC transport layer
- New transport layer for macOS.
- XPC Framework
- Test client

Framework and client were written by Alex Lorenz.

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

llvm-svn: 351280
2019-01-16 00:24:22 +00:00
Craig Topper 78e7fff56f [LangRef] Fix typo adress->address. NFC
llvm-svn: 351279
2019-01-16 00:21:59 +00:00
Craig Topper 0e420e6a62 [X86] Rename SHRUNKBLEND ISD node to BLENDV.
That's really what it is. If we didn't use intrinsics for BLENDVPS/BLENDVPD/PBLENDVB all the way to isel, this is the node we would use.

llvm-svn: 351278
2019-01-16 00:20:30 +00:00
Peter Collingbourne 32c46f7274 gn build: Add check-hwasan target.
The Android sanitizer tests are currently some of the most difficult
to run correctly, requiring at least 3 build directories which have
to be configured in just the right way and built in the correct order
(see e.g. [1] and the functions that it calls).

This patch adds a check-hwasan target which greatly simplifies running
the hwasan tests for gn users, taking advantage of its support for
multiple toolchains. With this the tests can be run simply by setting
an NDK path and running "ninja check-hwasan" with a compatible Android
device connected. The Linux/x86_64 and Android/aarch64 targets are
tested in parallel.

[1] https://github.com/llvm/llvm-zorg/blob/master/zorg/buildbot/builders/sanitizers/buildbot_android.sh

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

llvm-svn: 351277
2019-01-16 00:15:25 +00:00
Alex Langford f510bc7972 [lldb-mi] Remove use of dialog box
Summary:
This really is only implemented on Windows, and it requires us to pull
in User32. This was only useful when debugging on lldb-mi on Windows, and there
doesn't seem to be a good reason why using a dialog box is better than what
exists for other platforms.

Reviewers: zturner, jingham, compnerd

Subscribers: ki.stfu

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

llvm-svn: 351276
2019-01-16 00:09:50 +00:00
Craig Topper 34ac509ac8 [X86] Add avx512 scatter intrinsics that use a vXi1 mask instead of a scalar integer.
We're trying to have the vXi1 types in IR as much as possible. This prevents the need for bitcasts when the producer of the mask was already a vXi1 value like an icmp. The bitcasts can be subject to code motion and interfere with basic block at a time isel in bad ways.

llvm-svn: 351275
2019-01-15 23:36:25 +00:00
Adrian Prantl ee031dfacb Remove redundant check.
llvm-svn: 351274
2019-01-15 23:33:26 +00:00
Changpeng Fang 20fe3d2f35 AMDGPU: Raise the priority of MAD24 in instruction selection.
Summary:
  We have seen performance regression when v_add3 is generated. The major reason is that the v_mad pattern
is broken when v_add3 is generated. We also see the register pressure increased. While we could not properly
estimate register pressure during instruction selection, we can give mad a higher priority.

In this work, we raise the priority for mad24 in selection and resolve the performance regression.

Reviewers:
  rampitec

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

llvm-svn: 351273
2019-01-15 23:12:36 +00:00
Stephen Kelly a4fd381dc2 Re-order type param children of ObjC nodes
Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351272
2019-01-15 23:07:30 +00:00
Stephen Kelly e80e4cbd20 NFC: Some cleanups that I missed in the previous commit
llvm-svn: 351271
2019-01-15 23:05:11 +00:00
Peter Collingbourne f12c754b02 compiler-rt/test: Bring back -pie on Android.
Looks like the sanitizer-x86_64-linux-android bot started failing
because -pie is still needed when targeting API levels < 16 (which
is the case by default for arm and i686).

llvm-svn: 351270
2019-01-15 22:53:24 +00:00
Stephen Kelly 42d9950073 Re-order overrides in FunctionDecl dump
Output all content which is local to the FunctionDecl before traversing
to child AST nodes.

This is necessary so that all of the part which is local to the
FunctionDecl can be split into a different method.

Reviewers: aaron.ballman

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

llvm-svn: 351269
2019-01-15 22:50:37 +00:00
Stephen Kelly b418937793 NFC: Replace iterator loop with cxx_range_for
llvm-svn: 351268
2019-01-15 22:45:46 +00:00
Jonas Devlieghere 7a16862745 [VFS] Add getter for mapping entries.
When generating a reproducer in LLDB we build up the mapping but don't
immediately copy over the files on the file system.

Rather than keeping a separate data structure with real and virtual
paths, we might as well reuse the entries already stored in the
YAMLVFSWriter to lazily copy over the files when needed.

llvm-svn: 351266
2019-01-15 22:36:56 +00:00
Jonas Devlieghere 1a0ce65ad3 [VFS] Move RedirectingFileSystem interface into header (NFC)
This moves the RedirectingFileSystem into the header so it can be
extended. This is needed in LLDB we need a way to obtain the external
path to deal with FILE* and file descriptor APIs.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-November/127755.html

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

llvm-svn: 351265
2019-01-15 22:36:41 +00:00
Adrian Prantl 222474b9ff Simplify code by using Optional::getValueOr()
llvm-svn: 351264
2019-01-15 22:30:01 +00:00
Alex Langford 76cb3089de [debugserver][CMake] Remove commented out line
This has been commented out since rL300111
(commit d742d081f3a1e7412cc609765139ba32d597ac15). Looks like it was
committed as a commented out line, so I'm removing it.

llvm-svn: 351263
2019-01-15 22:27:59 +00:00
Jonathan Metzman 9e14cccf6f [libFuzzer] Remove unstable edge handling
Summary:
Remove code for handling unstable edges from libFuzzer since
it has not been found useful.

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

llvm-svn: 351262
2019-01-15 22:12:51 +00:00
Paul Hoad b16e288c7d [clang-tidy] add options documentation to readability-identifier-naming checker
Summary:
The documentation for this clang-checker did not explain what the options are. But this checkers only works with at least some options defined.

To discover the options, you have to read the source code. This shouldn't be necessary for users who just have access to the clang-tidy binary.

This revision, explains the options and gives an example.

Patch by MyDeveloperDay.

Reviewers: JonasToth, Eugene.Zelenko

Reviewed By: JonasToth

Subscribers: xazax.hun, Eugene.Zelenko

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

llvm-svn: 351261
2019-01-15 22:06:49 +00:00