platform/upstream/llvm.git
6 years ago[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.
Alexey Bataev [Fri, 29 Jun 2018 14:23:28 +0000 (14:23 +0000)]
[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.

Summary:
.debug_loc section is not supported for NVPTX target. If there is an
object whose location can change during its lifetime, we do not generate
debug location info for this variable.

Reviewers: echristo

Subscribers: jholewinski, JDevlieghere, llvm-commits

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

llvm-svn: 335976

6 years ago[Hexagon] Remove unused instruction itineraties, NFC
Krzysztof Parzyszek [Fri, 29 Jun 2018 13:55:28 +0000 (13:55 +0000)]
[Hexagon] Remove unused instruction itineraties, NFC

llvm-svn: 335975

6 years ago[InstCombine] enhance shuffle-of-binops to allow different variable ops (PR37806)
Sanjay Patel [Fri, 29 Jun 2018 13:44:06 +0000 (13:44 +0000)]
[InstCombine] enhance shuffle-of-binops to allow different variable ops (PR37806)

This was discussed in D48401 as another improvement for:
https://bugs.llvm.org/show_bug.cgi?id=37806

If we have 2 different variable values, then we shuffle (select) those lanes,
shuffle (select) the constants, and then perform the binop. This eliminates a binop.

The new shuffle uses the same shuffle mask as the existing shuffle, so there's no
danger of creating a difficult shuffle.

All of the earlier constraints still apply, but we also check for extra uses to
avoid creating more instructions than we'll remove.

Additionally, we're disallowing the fold for div/rem because that could expose a
UB hole.

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

llvm-svn: 335974

6 years ago[ELF] - Eliminate dead code from shouldKeepInSymtab. NFC.
George Rimar [Fri, 29 Jun 2018 13:34:05 +0000 (13:34 +0000)]
[ELF] - Eliminate dead code from shouldKeepInSymtab. NFC.

shouldKeepInSymtab is called from copyLocalSymbols:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L574

The pre-condition is that symbol should be Defined:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L572

And its section is Live:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L548

InputSection::Discarded section can never be Live. And hence I believe
check I removed in this patch is excessive.

llvm-svn: 335973

6 years ago[clangd] Improve output of --help and --version. NFC.
Sam McCall [Fri, 29 Jun 2018 13:24:20 +0000 (13:24 +0000)]
[clangd] Improve output of --help and --version. NFC.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 335972

6 years agoUse range for in normalizeValInst [NFCI]
Tobias Grosser [Fri, 29 Jun 2018 13:06:44 +0000 (13:06 +0000)]
Use range for in normalizeValInst [NFCI]

llvm-svn: 335971

6 years agoTranslate a couple of foreach callbacks into range-based iterator loops
Tobias Grosser [Fri, 29 Jun 2018 12:23:48 +0000 (12:23 +0000)]
Translate a couple of foreach callbacks into range-based iterator loops

Thanks to Philip Pfaffe for providing iterator support in the previous
commit.

llvm-svn: 335970

6 years ago[ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.
George Rimar [Fri, 29 Jun 2018 12:19:35 +0000 (12:19 +0000)]
[ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.

CIEs augmentation string can have 'P' character,
what means the next byte is the personality encoding, a DW_EH_PE_xxx value.
This is followed by a pointer to the personality function.

We had the support of the different encodings earlier, but had no test cases.

This change adds coverage of DW_EH_PE_absptr/DW_EH_PE_signed/DW_EH_PE_udata2/DW_EH_PE_sdata2 and
DW_EH_PE_udata8/DW_EH_PE_sdata8 cases for place below:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L123

llvm-svn: 335969

6 years ago[ASTImporter] Added import of CXXStdInitializerListExpr
Gabor Marton [Fri, 29 Jun 2018 12:17:34 +0000 (12:17 +0000)]
[ASTImporter] Added import of CXXStdInitializerListExpr

Reviewers: a.sidorin

Reviewed By: a.sidorin

Subscribers: martong, cfe-commits

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

Patch by Balazs Keri!

llvm-svn: 335968

6 years agoAdd a test for reading lld-generated build-ids
Pavel Labath [Fri, 29 Jun 2018 12:15:54 +0000 (12:15 +0000)]
Add a test for reading lld-generated build-ids

Summary:
This test makes sure we are able to read the shorter build-ids which are
generated by lld.

To make this work, I've extended lldb-test to print the UUID of the
loaded object file. I've renamed the lldb-test subcommand from
"module-sections" to "object-file" to reflect the fact it prints more
than just the sections.

I've also added the module Architecture to the output, so we could avoid
printing the entire symbol file information just to get the ArchSpec
details in the lc_version_min test (which was also the only test in it's
folder not using the module-sections command).

Reviewers: aprantl, zturner

Subscribers: lldb-commits

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

llvm-svn: 335967

6 years agoAdd missing namespace specifier
Tobias Grosser [Fri, 29 Jun 2018 11:49:34 +0000 (11:49 +0000)]
Add missing namespace specifier

llvm-svn: 335966

6 years agoFix overconfident assert in ScalarEvolution::isImpliedViaMerge
Roman Shirokiy [Fri, 29 Jun 2018 11:46:30 +0000 (11:46 +0000)]
Fix overconfident assert in ScalarEvolution::isImpliedViaMerge
We can have AddRec with loops having many predecessors.
This changes an assert to an early return.

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

llvm-svn: 335965

6 years ago[analyzer][UninitializedObjectChecker] Added a NotesAsWarnings flag
Kristof Umann [Fri, 29 Jun 2018 11:25:24 +0000 (11:25 +0000)]
[analyzer][UninitializedObjectChecker] Added a NotesAsWarnings flag

In order to better support consumers of the plist output that don't
parse note entries just yet, a 'NotesAsWarnings' flag was added.
If it's set to true, all notes will be converted to warnings.

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

llvm-svn: 335964

6 years agoUUID: Add support for arbitrary-sized module IDs
Pavel Labath [Fri, 29 Jun 2018 11:20:29 +0000 (11:20 +0000)]
UUID: Add support for arbitrary-sized module IDs

Summary:
The data structure is optimized for the case where the UUID size is <=
20 bytes (standard length emitted by the GNU linkers), but larger sizes
are also possible.

I've modified the string conversion function to support the new sizes as
well. For standard UUIDs it maintains the traditional formatting
(4-2-2-2-6). If a UUID is shorter, we just cut this sequence short, and
for longer UUIDs it will just repeat the last 6-byte block as long as
necessary.

I've also modified ObjectFileELF to take advantage of the new UUIDs and
avoid manually padding the UUID to 16 bytes. While there, I also made
sure the computed UUID does not depend on host endianness.

Reviewers: clayborg, lemo, sas, davide, espindola

Subscribers: emaste, arichardson, lldb-commits

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

llvm-svn: 335963

6 years ago[AArch64] Armv8.4-A: Virtualization system registers
Sjoerd Meijer [Fri, 29 Jun 2018 11:03:15 +0000 (11:03 +0000)]
[AArch64] Armv8.4-A: Virtualization system registers

This adds the Secure EL2 extension.

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

llvm-svn: 335962

6 years ago[cmake] Change WIN32 test to CMAKE_HOST_WIN32
Filipe Cabecinhas [Fri, 29 Jun 2018 10:34:37 +0000 (10:34 +0000)]
[cmake] Change WIN32 test to CMAKE_HOST_WIN32

The test is about what can be run on the host, not the cmake target.
When cross-compiling (compiler-rt at least) on Windows, we end up with
lit being unable to run llvm-lit because it can't find the llvm-lit
module.

llvm-svn: 335961

6 years agoFix use-after-free in CommandCompletions.cpp
Pavel Labath [Fri, 29 Jun 2018 10:27:18 +0000 (10:27 +0000)]
Fix use-after-free in CommandCompletions.cpp

The code was creating a StringRef to a temporary std::string. The
solution is to just drop the .str() from the original StringRef.

This manifested it self as the new TestCompletions test failing in some
configurations.

llvm-svn: 335960

6 years ago[ASTImporter] Eliminated some unittest warnings.
Gabor Marton [Fri, 29 Jun 2018 10:25:19 +0000 (10:25 +0000)]
[ASTImporter] Eliminated some unittest warnings.

Summary:
When running the ASTTests test, warnings produced by the compiler can be
distracting when looking for test errors. A part of the warnings is removed
by setting extra compiler options.

Reviewers: a.sidorin

Reviewed By: a.sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

Patch by Balazs Keri!

llvm-svn: 335959

6 years ago[ELF] - Remove dead code.
George Rimar [Fri, 29 Jun 2018 09:54:51 +0000 (09:54 +0000)]
[ELF] - Remove dead code.

I do not think this code was ever alive,
because the following code says we can have OutputSection and
SymbolAssignment cases only. We already handle both of them.

https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L502

FWIW, it is dead in the LLD code coverage reports I am running either.

llvm-svn: 335958

6 years ago[X86][SSE] Support v16i8/v32i8 vector rotations
Simon Pilgrim [Fri, 29 Jun 2018 09:36:39 +0000 (09:36 +0000)]
[X86][SSE] Support v16i8/v32i8 vector rotations

This uses the same technique as for shifts - split the rotation into 4/2/1-bit partial rotations and select those partials based on the amount bit, making use of PBLENDVB if available. This halves the use of PBLENDVB compared to expanding to shifts, which can be a slow op.

Unfortunately I haven't found a decent way to share much of this code with the shift equivalent.

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

llvm-svn: 335957

6 years agoFix TestLoadUsingPaths on linux
Pavel Labath [Fri, 29 Jun 2018 09:22:07 +0000 (09:22 +0000)]
Fix TestLoadUsingPaths on linux

we need to explicitly link the test program with -ldl for the dlopen
function to be available.

llvm-svn: 335956

6 years agoModernize completion tests
Pavel Labath [Fri, 29 Jun 2018 09:06:42 +0000 (09:06 +0000)]
Modernize completion tests

Now that we have gmock, we can use its matchers to better express the
test assertions. The main advantage of this is that when things fail,
the test will now print the expected and actual lists of completed
strings instead of just a not-very-helpful "false is not true" message.

llvm-svn: 335955

6 years ago[ELF] - Add test case to test 32 bits output.
George Rimar [Fri, 29 Jun 2018 08:54:34 +0000 (08:54 +0000)]
[ELF] - Add test case to test 32 bits output.

We had no tests that checked how we print -Map output for
32 bit targets. Though there are at least 2 places where we have the difference.
(between 64 and 32 bits):

https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L52
https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L162

Patch adds just a trivial test to check we do right things in general.

llvm-svn: 335954

6 years ago[ARM][AArch64] Armv8.4-A Enablement
Sjoerd Meijer [Fri, 29 Jun 2018 08:43:19 +0000 (08:43 +0000)]
[ARM][AArch64] Armv8.4-A Enablement

Initial patch adding assembly support for Armv8.4-A.

Besides adding v8.4 as a supported architecture to the usual places, this also
adds target features for the different crypto algorithms. Armv8.4-A introduced
new crypto algorithms, made them optional, and allows different combinations:

- none of the v8.4 crypto functions are supported, which is independent of the
  implementation of the Armv8.0 SHA1 and SHA2 instructions.
- the v8.4 SHA512 and SHA3 support is implemented, in this case the Armv8.0
  SHA1 and SHA2 instructions must also be implemented.
- the v8.4 SM3 and SM4 support is implemented, which is independent of the
  implementation of the Armv8.0 SHA1 and SHA2 instructions.
- all of the v8.4 crypto functions are supported, in this case the Armv8.0 SHA1
  and SHA2 instructions must also be implemented.

The v8.4 crypto instructions are added to AArch64 only, and not AArch32,
and are made optional extensions to Armv8.2-A.

The user-facing Clang options will map on these new target features, their
naming will be compatible with GCC and added in follow-up patches.

The Armv8.4-A instruction sets can be downloaded here:
https://developer.arm.com/products/architecture/a-profile/exploration-tools

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

llvm-svn: 335953

6 years ago[NFC] Fix formatting to appease builders
Philip Pfaffe [Fri, 29 Jun 2018 08:29:17 +0000 (08:29 +0000)]
[NFC] Fix formatting to appease builders

llvm-svn: 335952

6 years agoImplement an iterator for isl maps, basic_maps, sets, basic_sets
Philip Pfaffe [Fri, 29 Jun 2018 08:17:03 +0000 (08:17 +0000)]
Implement an iterator for isl maps, basic_maps, sets, basic_sets

Summary:
Provide an iterator to simplify iteration over some isl collections.
Since these types do not natively support iteration, they have to be converted
to an list first by the caller, but can then be used in a ranged for loop:
```
isl::set S;
for (auto SubSet : S.get_basic_set_list ()) {
  // ...
}
```

Reviewers: bollu, Meinersbur, grosser, dexonsmith

Reviewed By: bollu

Subscribers: hfinkel, mgorny, Meinersbur, mehdi_amini, bollu, steven_wu, llvm-commits

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

llvm-svn: 335951

6 years agoSCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction
Roman Lebedev [Fri, 29 Jun 2018 07:44:20 +0000 (07:44 +0000)]
SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction

Summary:
An alternative to D48597.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=37936 | PR37936 ]].

The problem is as follows:
1. `indvars` marks `%dec` as `NUW`.
2. `loop-instsimplify` runs `instsimplify`, which constant-folds `%dec` to -1 (D47908)
3. `loop-reduce` tries to do some further modification, but crashes
    with an type assertion in cast, because `%dec` is no longer an `Instruction`,

If the runline is split into two, i.e. you first run `-indvars -loop-instsimplify`,
store that into a file, and then run `-loop-reduce`, there is no crash.

So it looks like the problem is due to `-loop-instsimplify` not discarding SCEV.
But in this case we can just not crash if it's not an `Instruction`.
This is just a local fix, unlike D48597, so there may very well be other problems.

Reviewers: mkazantsev, uabelho, sanjoy, silviu.baranga, wmi

Reviewed By: mkazantsev

Subscribers: evstupac, javed.absar, spatel, llvm-commits

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

llvm-svn: 335950

6 years ago[ScopHelper] Provide support for recognising collective invariant loads
Philip Pfaffe [Fri, 29 Jun 2018 07:29:45 +0000 (07:29 +0000)]
[ScopHelper] Provide support for recognising collective invariant loads

Summary: This patch aims to provide support for detecting load patterns which are collectively invariant but right now `isHoistableLoad()` is checking each load instruction individually which cannot detect the load pattern as a whole.

Patch by: Sahil Girish Yerawar

Reviewers: bollu, philip.pfaffe, Meinersbur

Reviewed By: philip.pfaffe, Meinersbur

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

llvm-svn: 335949

6 years agoMake email options of find_interesting_reviews more flexible.
Kristof Beyls [Fri, 29 Jun 2018 07:16:27 +0000 (07:16 +0000)]
Make email options of find_interesting_reviews more flexible.

This enables a few requested improvements on the original review of this
script at https://reviews.llvm.org/D46192.

This introduces 2 new command line options:

* --email-report: This option enables specifying who to email the generated
  report to. This also enables not sending any email and only printing out
  the report on stdout by not specifying this option on the command line.
* --sender: this allows specifying the email address that will be used in
  the "From" email header.

I believe that with these options the script starts having the basic
features needed to run it well on a regular basis for a group of
developers.

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

llvm-svn: 335948

6 years ago[MinGW] Implement the GNU ld options -S/--strip-debug
Martin Storsjo [Fri, 29 Jun 2018 06:08:31 +0000 (06:08 +0000)]
[MinGW] Implement the GNU ld options -S/--strip-debug

In this mode, we retain the symbol table, but skip the actual debug
information.

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

llvm-svn: 335947

6 years ago[COFF] Add an LLD specific option -debug:symbtab
Martin Storsjo [Fri, 29 Jun 2018 06:08:25 +0000 (06:08 +0000)]
[COFF] Add an LLD specific option -debug:symbtab

With this set, we retain the symbol table, but skip the actual debug
information.

This is meant to be used by the MinGW frontend.

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

llvm-svn: 335946

6 years ago[X86] Remove masking from the avx512 packed sqrt builtins. Use select builtins instead.
Craig Topper [Fri, 29 Jun 2018 05:43:33 +0000 (05:43 +0000)]
[X86] Remove masking from the avx512 packed sqrt builtins. Use select builtins instead.

llvm-svn: 335945

6 years ago[X86] Remove masking from the avx512 packed sqrt intrinsics. Use select in IR instead.
Craig Topper [Fri, 29 Jun 2018 05:43:26 +0000 (05:43 +0000)]
[X86] Remove masking from the avx512 packed sqrt intrinsics. Use select in IR instead.

While there improve the coverage of the intrinsic testing and add fast-isel tests.

llvm-svn: 335944

6 years ago[cfi] Reset i-cache after copying code in test.
Evgeniy Stepanov [Fri, 29 Jun 2018 00:38:26 +0000 (00:38 +0000)]
[cfi] Reset i-cache after copying code in test.

Fixes intermittent crashes on Android.
Also add PROT_READ to the code mapping for no real reason.

llvm-svn: 335943

6 years agoAMDGPU: Separate R600 and GCN TableGen files
Tom Stellard [Thu, 28 Jun 2018 23:47:12 +0000 (23:47 +0000)]
AMDGPU: Separate R600 and GCN TableGen files

Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc.  This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself.  This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.

Reviewers: arsenm, nhaehnle, jvesely

Reviewed By: arsenm

Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits

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

llvm-svn: 335942

6 years ago[asan] Change 3 tests from XFAIL to UNSUPPORTED.
Evgeniy Stepanov [Thu, 28 Jun 2018 23:27:55 +0000 (23:27 +0000)]
[asan] Change 3 tests from XFAIL to UNSUPPORTED.

The failure in https://github.com/google/sanitizers/issues/981 is flaky.

llvm-svn: 335941

6 years ago[frontend] Don't include the C++ stdlib for -x assembler-with-cpp
Alex Lorenz [Thu, 28 Jun 2018 23:23:45 +0000 (23:23 +0000)]
[frontend] Don't include the C++ stdlib for -x assembler-with-cpp

The new C++ stdlib warning added in r335081 gets
triggered when compiling an assembly file with -x assembler-with-cpp.
This commit ensures that the C++ stdlib is not included when compiling assembly.
In general, it's not really useful to include the C++ stdlib search path when
compiling assembly source.

rdar://41359632

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

llvm-svn: 335940

6 years agoRequire x86 for this test.
Sterling Augustine [Thu, 28 Jun 2018 23:22:14 +0000 (23:22 +0000)]
Require x86 for this test.

llvm-svn: 335939

6 years agoDebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command...
David Blaikie [Thu, 28 Jun 2018 22:58:04 +0000 (22:58 +0000)]
DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command line

llvm-svn: 335938

6 years ago[asan] Disable 3 tests on Android O+.
Evgeniy Stepanov [Thu, 28 Jun 2018 22:54:55 +0000 (22:54 +0000)]
[asan] Disable 3 tests on Android O+.

https://github.com/google/sanitizers/issues/981

llvm-svn: 335937

6 years ago[asan] Fix one more test on Android.
Evgeniy Stepanov [Thu, 28 Jun 2018 22:54:42 +0000 (22:54 +0000)]
[asan] Fix one more test on Android.

This change makes it pass both on libstdc++ and libc++-based toolchains.

The error was:
error: function-like macro '__GLIBC_PREREQ' is not defined
                               ^

llvm-svn: 335936

6 years ago[asan] un-XFAIL one test
Evgeniy Stepanov [Thu, 28 Jun 2018 22:54:30 +0000 (22:54 +0000)]
[asan] un-XFAIL one test

NDK r16 provides glob.h, which makes this test pass.
Supporting different test outcomes depending on the version of NDK
add unnecessary complexity to the test harness. IMHO, it's OK to require
the latest stable release.

llvm-svn: 335935

6 years agoFix path completion test case added in rL335905 on Windows
Raphael Isemann [Thu, 28 Jun 2018 22:40:10 +0000 (22:40 +0000)]
Fix path completion test case added in rL335905 on Windows

Summary:
The test fails because we don't rewrite the slash behind `foo` to the OS specific
separator (as the completion API doesn't support this kind of rewriting). However,
we assume that this part of the string is rewritten in the test case, which broke
on Windows.

Reviewers: stella.stamenova

Reviewed By: stella.stamenova

Subscribers: lldb-commits

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

llvm-svn: 335934

6 years ago[fuzzer] Don't run tests on Android.
Evgeniy Stepanov [Thu, 28 Jun 2018 22:16:59 +0000 (22:16 +0000)]
[fuzzer] Don't run tests on Android.

Need better build system support.

llvm-svn: 335933

6 years ago[analyzer] fix test case expected warning
Mikhail R. Gadelha [Thu, 28 Jun 2018 22:08:44 +0000 (22:08 +0000)]
[analyzer] fix test case expected warning

After r335814, the constraint manager is no longer generating a false bug report
about the division by zero in the test case.

This patch removes the expected false bug report.

llvm-svn: 335932

6 years ago[ARM] Assert that ARMDAGToDAGISel creates valid UBFX/SBFX nodes.
Eli Friedman [Thu, 28 Jun 2018 21:49:41 +0000 (21:49 +0000)]
[ARM] Assert that ARMDAGToDAGISel creates valid UBFX/SBFX nodes.

We don't ever check these again (unless you're using
-fno-integrated-as), so make sure the extracted bits are well-defined.

I don't think it's possible to trigger any of the assertions on trunk,
but it's difficult to prove.  (The first one depends on DAGCombine to
minimize the number of set bits in AND masks; I think the others are
mathematically impossible to hit.)

llvm-svn: 335931

6 years ago[MachineOutliner] Never add the outliner in -O0
Jessica Paquette [Thu, 28 Jun 2018 21:49:24 +0000 (21:49 +0000)]
[MachineOutliner] Never add the outliner in -O0

This is a recommit of r335879.

We shouldn't add the outliner when compiling at -O0 even if
-enable-machine-outliner is passed in. This makes sure that we
don't add it in this case.

This also removes -O0 from the outliner DWARF test.

llvm-svn: 335930

6 years ago[analyzer] Move test to the correct directory
Mikhail R. Gadelha [Thu, 28 Jun 2018 21:39:41 +0000 (21:39 +0000)]
[analyzer] Move test to the correct directory

It was accidentaly pushed in r335926

llvm-svn: 335929

6 years ago[TSan] More detailed error message on failed sahdow memory madvise
Alex Shlyapnikov [Thu, 28 Jun 2018 21:38:34 +0000 (21:38 +0000)]
[TSan] More detailed error message on failed sahdow memory madvise

Summary:
Report errno value on failed shadow memory madvise attempt and add a
hint message with the possible workaround.

Reviewers: eugenis

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

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

llvm-svn: 335928

6 years ago[Parse] Make -Wgcc-compat complain about for loop inits in C89
George Burgess IV [Thu, 28 Jun 2018 21:36:00 +0000 (21:36 +0000)]
[Parse] Make -Wgcc-compat complain about for loop inits in C89

While clang allows declarations in for loop init statements in c89 and
gnu89, gcc does not. So, we should probably warn if users care about gcc
compatibility.

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

llvm-svn: 335927

6 years ago[analyzer] Fix wrong comparison generation of the ranges generated by the refutation...
Mikhail R. Gadelha [Thu, 28 Jun 2018 21:26:52 +0000 (21:26 +0000)]
[analyzer] Fix wrong comparison generation of the ranges generated by the refutation manager

The refutation manager is removing a true bug from the test in this patch.

The problem is that the following constraint:
```
(conj_$1{struct o *}) - (reg_$3<int * r>): [-9223372036854775808, 0]
```
is encoded as:
```
(and (bvuge (bvsub $1 $3) #x8000000000000000)
     (bvule (bvsub $1 $3) #x0000000000000000))
```
The issue is that unsigned comparisons (bvuge and bvule) are being generated instead of signed comparisons (bvsge and bvsle).

When generating the expressions:
```
(conj_$1{p *}) - (reg_$3<int * r>) >= -9223372036854775808
```
and
```
(conj_$1{p *}) - (reg_$3<int * r>) <= 0
```
both -9223372036854775808 and 0 are casted to pointer type and `LTy->isSignedIntegerOrEnumerationType()` in `Z3ConstraintManager::getZ3BinExpr` only checks if the type is signed, not if it's a pointer.

Reviewers: NoQ, george.karpenkov, ddcc

Subscribers: rnkovacs, NoQ, george.karpenkov, ddcc, xazax.hun, szepet, a.sidorin

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

llvm-svn: 335926

6 years agoPR37979: integral promotions in C++ treat enum bit-fields like enums,
Richard Smith [Thu, 28 Jun 2018 21:17:55 +0000 (21:17 +0000)]
PR37979: integral promotions in C++ treat enum bit-fields like enums,
not like bit-fields.

We used to get this right "by accident", because conversions for the
selected built-in overloaded operator would convert the enum bit-field
to its corresponding underlying type early. But after DR1687 that no
longer happens.

Technically this change should also apply to C, where bit-fields only
have special promotion rules if the bit-field's declared type is
_Bool, int, signed int, or unsigned int, but for GCC compatibility we
only look at the bit-width and not the underlying type when performing
bit-field integral promotions in C.

llvm-svn: 335925

6 years ago[InstCombine] adjust shuffle tests; NFC
Sanjay Patel [Thu, 28 Jun 2018 21:14:02 +0000 (21:14 +0000)]
[InstCombine] adjust shuffle tests; NFC

Use xor for the extra uses test because div/rem have other problems.

llvm-svn: 335924

6 years ago[UBsan] minimal unit tests removing OpenBSD spacial case
David Carlier [Thu, 28 Jun 2018 21:10:52 +0000 (21:10 +0000)]
[UBsan] minimal unit tests removing OpenBSD spacial case

The OpenBSD driver now handles sanitisers with ld.lld automatically.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 335923

6 years ago[llvm-readobj] Add experimental support for SHT_RELR sections
Jake Ehrlich [Thu, 28 Jun 2018 21:07:34 +0000 (21:07 +0000)]
[llvm-readobj] Add experimental support for SHT_RELR sections

This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!

Author: rahulchaudhry

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

llvm-svn: 335922

6 years ago[SupportTests] Silence -Wsign-compare warnings
Benjamin Kramer [Thu, 28 Jun 2018 21:03:24 +0000 (21:03 +0000)]
[SupportTests] Silence -Wsign-compare warnings

llvm-svn: 335921

6 years ago[InstCombine] fix opcode check in shuffle fold
Sanjay Patel [Thu, 28 Jun 2018 20:52:43 +0000 (20:52 +0000)]
[InstCombine] fix opcode check in shuffle fold

There's no way to expose this difference currently,
but we should use the updated variable because the
original opcodes can go stale if we transform into
something new.

llvm-svn: 335920

6 years ago[CMake] Don't build Linux targets on Darwin in Fuchsia toolchain
Petr Hosek [Thu, 28 Jun 2018 20:33:18 +0000 (20:33 +0000)]
[CMake] Don't build Linux targets on Darwin in Fuchsia toolchain

This is currently breaking because Linux target sysroots rely on
case sensitive filesystem which is not by default enabled on macOS.

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

llvm-svn: 335919

6 years ago[COFF] Fix constant sharing regression for MinGW
Martin Storsjo [Thu, 28 Jun 2018 20:28:29 +0000 (20:28 +0000)]
[COFF] Fix constant sharing regression for MinGW

This fixes a regression since SVN r334523, where the object files
built targeting MinGW were rejected by GNU binutils tools. Prior to
that commit, we only put constants in comdat for MSVC configurations.

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

llvm-svn: 335918

6 years ago[CMake] Build static runtimes for host in Fuchsia first stage
Petr Hosek [Thu, 28 Jun 2018 20:19:11 +0000 (20:19 +0000)]
[CMake] Build static runtimes for host in Fuchsia first stage

First stage build is only a minimal build where we don't need
a complete multiarch support, but we need enough to build the
second stage.

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

llvm-svn: 335917

6 years agoConfigure ELAST for MinGW
Pirama Arumuga Nainar [Thu, 28 Jun 2018 20:16:45 +0000 (20:16 +0000)]
Configure ELAST for MinGW

Summary:
Use _LIBCPP_MSVCRT_LIKE while configuring ELAST, so MinGW gets the same
configuration as MSVC.

Reviewers: compnerd, srhines, danalbert, mstorsjo

Subscribers: christof, ldionne, cfe-commits

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

llvm-svn: 335916

6 years agoFix padding with custom character in formatv.
Zachary Turner [Thu, 28 Jun 2018 20:09:37 +0000 (20:09 +0000)]
Fix padding with custom character in formatv.

The format string for formatv allows to specify a custom padding
character instead of the default space.  This custom character was
parsed correctly, but not passed on to the formatter.

Patch by Marcel Köppe
Differential Revision: https://reviews.llvm.org/D48140

llvm-svn: 335915

6 years ago[ThinLTO] Port InlinerFunctionImportStats handling to new PM
Teresa Johnson [Thu, 28 Jun 2018 20:07:47 +0000 (20:07 +0000)]
[ThinLTO] Port InlinerFunctionImportStats handling to new PM

Summary:
The InlinerFunctionImportStats will collect and dump stats regarding how
many function inlined into the module were imported by ThinLTO.

Reviewers: wmi, dexonsmith

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 335914

6 years ago[NVPTX] Delete dead code
Benjamin Kramer [Thu, 28 Jun 2018 20:05:35 +0000 (20:05 +0000)]
[NVPTX] Delete dead code

No functionality change.

llvm-svn: 335913

6 years agoAdd a way to load an image using a library name and list of paths.
Jim Ingham [Thu, 28 Jun 2018 20:02:11 +0000 (20:02 +0000)]
Add a way to load an image using a library name and list of paths.

This provides an efficient (at least on Posix platforms) way to offload to the
target process the search & loading of a library when all we have are the
library name and a set of potential candidate locations.

<rdar://problem/40905971>

llvm-svn: 335912

6 years ago[OPENMP] Fix incomplete type check for array reductions
Joel E. Denny [Thu, 28 Jun 2018 19:54:49 +0000 (19:54 +0000)]
[OPENMP] Fix incomplete type check for array reductions

A reduction for an incomplete array type used to produce an assert
fail during codegen.  Now it produces a diagnostic.

Reviewed By: ABataev

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

llvm-svn: 335911

6 years agoRevert r335907: [OPENMP] Fix incomplete type check for array reductions
Joel E. Denny [Thu, 28 Jun 2018 19:54:27 +0000 (19:54 +0000)]
Revert r335907: [OPENMP] Fix incomplete type check for array reductions

Sorry, forgot to add commit log attributes again.

llvm-svn: 335910

6 years ago[ARM] Add missing Thumb2 assembler diagnostics.
Eli Friedman [Thu, 28 Jun 2018 19:53:12 +0000 (19:53 +0000)]
[ARM] Add missing Thumb2 assembler diagnostics.

Mostly just adding checks for Thumb2 instructions which correspond to
ARM instructions which already had diagnostics. While I'm here, also fix
ARM-mode strd to check the input registers correctly.

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

llvm-svn: 335909

6 years agoSome targets don't have lld built, so just use a binary copy
Sterling Augustine [Thu, 28 Jun 2018 19:47:23 +0000 (19:47 +0000)]
Some targets don't have lld built, so just use a binary copy
of the input file.

llvm-svn: 335908

6 years ago[OPENMP] Fix incomplete type check for array reductions
Joel E. Denny [Thu, 28 Jun 2018 19:46:10 +0000 (19:46 +0000)]
[OPENMP] Fix incomplete type check for array reductions

A reduction for an incomplete array type used to produce an assert
fail during codegen.  Now it produces a diagnostic.

llvm-svn: 335907

6 years ago[lldbsuite] Fix TestBreakpointHitCount on Windows
Stella Stamenova [Thu, 28 Jun 2018 19:42:30 +0000 (19:42 +0000)]
[lldbsuite] Fix TestBreakpointHitCount on Windows

Summary: On Windows, the newer DIA SDKs end up producing function names that contain the return type as well. This means that the function name returned in the test will contain the return type (int) in addition to the name of the function and the type of the input (a(int)). To account for the possibility of both, the test should pass if the function name matches either pattern.

Reviewers: zturner, asmith

Subscribers: llvm-commits

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

llvm-svn: 335906

6 years ago Added test case for: r334978 - Fixed file completion for paths that start with '~'
Raphael Isemann [Thu, 28 Jun 2018 19:34:49 +0000 (19:34 +0000)]
 Added test case for: r334978 - Fixed file completion for paths that start with '~'

Reviewers: labath

Reviewed By: labath

Subscribers: lldb-commits

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

llvm-svn: 335905

6 years ago[SROA] Preserve DebugLoc when rewriting alloca partitions
Anastasis Grammenos [Thu, 28 Jun 2018 18:58:30 +0000 (18:58 +0000)]
[SROA] Preserve DebugLoc when rewriting alloca partitions

When rewriting an alloca partition copy the DL from the
old alloca over the the new one.

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

llvm-svn: 335904

6 years agoHandle absolute symbols as branch targets in disassembly.
Sterling Augustine [Thu, 28 Jun 2018 18:57:13 +0000 (18:57 +0000)]
Handle absolute symbols as branch targets in disassembly.

https://reviews.llvm.org/D48554

llvm-svn: 335903

6 years agoAdd a flag to FileOutputBuffer that allows modification.
Zachary Turner [Thu, 28 Jun 2018 18:49:09 +0000 (18:49 +0000)]
Add a flag to FileOutputBuffer that allows modification.

FileOutputBuffer creates a temp file and on commit atomically
renames the temp file to the destination file.  Sometimes we
want to modify an existing file in place, but still have the
atomicity guarantee.  To do this we can initialize the contents
of the temp file from the destination file (if it exists), that
way the resulting FileOutputBuffer can have only selective
bytes modified.  Committing will then atomically replace the
destination file as desired.

llvm-svn: 335902

6 years agoRemove unnecessary semicolon. NFCI.
Simon Pilgrim [Thu, 28 Jun 2018 18:37:16 +0000 (18:37 +0000)]
Remove unnecessary semicolon. NFCI.

Fixes -Wpedantic warning.

llvm-svn: 335901

6 years ago[CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platforms
Justin Bogner [Thu, 28 Jun 2018 18:36:52 +0000 (18:36 +0000)]
[CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platforms

This allows overriding the strip and dsymutil tools, and updates
iOS.cmake to do so. I've also added libtool to iOS.cmake, but it was
already respecting CMAKE_LIBTOOL if set.

llvm-svn: 335900

6 years ago[CMake] Rename cxx_headers back to cxx-headers.
Ahmed Bougacha [Thu, 28 Jun 2018 18:35:35 +0000 (18:35 +0000)]
[CMake] Rename cxx_headers back to cxx-headers.

r334477 renamed the cxx-headers target to cxx_headers, but various
pieces sort-of expect the target names to match the component (e.g.,
LLVM_DISTRIBUTION_COMPONENTS in the various bootstrap caches, which, via
some magic foreign to me, seems to expect cxx-headers,
install-cxx-headers, and install-cxx-headers-stripped to exist.)

Revert back to cxx-headers.

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

llvm-svn: 335899

6 years ago[CMake] Make bootstrap and compiler-rt depend on cxx-headers.
Ahmed Bougacha [Thu, 28 Jun 2018 18:35:25 +0000 (18:35 +0000)]
[CMake] Make bootstrap and compiler-rt depend on cxx-headers.

Since r334468, we no longer always copy the libcxx headers by virtue of
their presence when cmake runs.

This makes some of the later stages (compiler-rt, and the bootstrapped
stages) depend on them being copied, via the cxx-headers target.

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

llvm-svn: 335898

6 years ago[Debugify] Do not report line 0 locations as errors
Vedant Kumar [Thu, 28 Jun 2018 18:21:11 +0000 (18:21 +0000)]
[Debugify] Do not report line 0 locations as errors

The checking logic should not treat artificial locations as being
somehow problematic. Producing these locations can be the desired
behavior of some passes.

See llvm.org/PR37961.

llvm-svn: 335897

6 years agoSet the line ending of clang.natvis to CRLF.
Aaron Ballman [Thu, 28 Jun 2018 18:03:00 +0000 (18:03 +0000)]
Set the line ending of clang.natvis to CRLF.

This corresponds to r335889, which does the same thing for llvm.natvis.

llvm-svn: 335896

6 years ago[X86] Suppress load folding into and/or/xor if it will prevent matching btr/bts/btc.
Craig Topper [Thu, 28 Jun 2018 17:58:01 +0000 (17:58 +0000)]
[X86] Suppress load folding into and/or/xor if it will prevent matching btr/bts/btc.

This is a follow up to r335753. At the time I forgot about isProfitableToFold which makes this pretty easy.

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

llvm-svn: 335895

6 years agoRevert "Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code...
Jonas Devlieghere [Thu, 28 Jun 2018 17:56:43 +0000 (17:56 +0000)]
Revert "Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models""

Reverting because this is causing failures in the LLDB test suite on
GreenDragon.

  LLVM ERROR: unsupported relocation with subtraction expression, symbol
  '__GLOBAL_OFFSET_TABLE_' can not be undefined in a subtraction
  expression

llvm-svn: 335894

6 years agoRevert "[OrcMCJIT] Fix test after r335508 causing it to fail on green dragon"
Jonas Devlieghere [Thu, 28 Jun 2018 17:56:27 +0000 (17:56 +0000)]
Revert "[OrcMCJIT] Fix test after r335508 causing it to fail on green dragon"

This reverts commit a6b904daa1d55e31187c85e5b54ef2ddc37fa713.

llvm-svn: 335893

6 years ago2 VS natvis improvements.
Zachary Turner [Thu, 28 Jun 2018 17:55:54 +0000 (17:55 +0000)]
2 VS natvis improvements.

Optional<T> was broken due to a change in the class's internals.
That is fixed, and additionally a visualizer is added for
Expected<T>.

llvm-svn: 335892

6 years ago[Darwin] Add an integration test for PGO + symbol exports
Vedant Kumar [Thu, 28 Jun 2018 17:53:43 +0000 (17:53 +0000)]
[Darwin] Add an integration test for PGO + symbol exports

rdar://41470205

llvm-svn: 335891

6 years ago[Darwin] Remove _VPMergeHook from the auto-export list
Vedant Kumar [Thu, 28 Jun 2018 17:53:35 +0000 (17:53 +0000)]
[Darwin] Remove _VPMergeHook from the auto-export list

Remove _VPMergeHook from Darwin's automatically-exported symbol list for
PGO. As of r328987 this symbol is no longer weak.

An integration test in compiler-rt will follow.

rdar://41470205

llvm-svn: 335890

6 years agoSet line ending style of llvm.natvis to CRLF.
Zachary Turner [Thu, 28 Jun 2018 17:52:06 +0000 (17:52 +0000)]
Set line ending style of llvm.natvis to CRLF.

This file is used by MSVC which is obviously a Windows-only tool and prefers windows line endings.

llvm-svn: 335889

6 years ago[InstCombine] allow shl+mul combos with shuffle (select) fold (PR37806)
Sanjay Patel [Thu, 28 Jun 2018 17:48:04 +0000 (17:48 +0000)]
[InstCombine] allow shl+mul combos with shuffle (select) fold (PR37806)

This is an enhancement to D48401 that was discussed in:
https://bugs.llvm.org/show_bug.cgi?id=37806

We can convert a shift-left-by-constant into a multiply (we canonicalize IR in the other
direction because that's generally better of course). This allows us to remove the shuffle
as we do in the regular opcodes-are-the-same cases.

This requires a small hack to make sure we don't introduce any extra poison:
https://rise4fun.com/Alive/ZGv

Other examples of opcodes where this would work are add+sub and fadd+fsub, but we already
canonicalize those subs into adds, so there's nothing to do for those cases AFAICT. There
are planned enhancements for opcode transforms such or -> add.

Note that there's a different fold needed if we've already managed to simplify away a binop
as seen in the test based on PR37806, but we manage to get that one case here because this
fold is positioned above the demanded elements fold currently.

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

llvm-svn: 335888

6 years ago[MachineOutliner] Define MachineOutliner support in TargetOptions
Jessica Paquette [Thu, 28 Jun 2018 17:45:43 +0000 (17:45 +0000)]
[MachineOutliner] Define MachineOutliner support in TargetOptions

Targets should be able to define whether or not they support the outliner
without the outliner being added to the pass pipeline. Before this, the
outliner pass would be added, and ask the target whether or not it supports the
outliner.

After this, it's possible to query the target in TargetPassConfig, before the
outliner pass is created. This ensures that passing -enable-machine-outliner
will not modify the pass pipeline of any target that does not support it.

https://reviews.llvm.org/D48683

llvm-svn: 335887

6 years ago[DAGCombiner] Ensure we use the correct CC result type in visitSDIV (REAPPLIED)
Simon Pilgrim [Thu, 28 Jun 2018 17:33:41 +0000 (17:33 +0000)]
[DAGCombiner] Ensure we use the correct CC result type in visitSDIV (REAPPLIED)

We could get away with it for constant folded cases, but not for rL335719.

Thanks to Krzysztof Parzyszek for noticing.

Reapply original commit rL335821 which was reverted at rL335871 due to a WebAssembly bug that was fixed at rL335884.

llvm-svn: 335886

6 years ago[llvm-mca] Delete Pipeline's copy ctor and assignement operator.
Matt Davis [Thu, 28 Jun 2018 17:33:24 +0000 (17:33 +0000)]
[llvm-mca] Delete Pipeline's copy ctor and assignement operator.

Prevent copying of the Pipeline.

llvm-svn: 335885

6 years ago[WebAssembly] Add getSetCCResultType placeholder override to handle vector compare...
Simon Pilgrim [Thu, 28 Jun 2018 17:27:09 +0000 (17:27 +0000)]
[WebAssembly] Add getSetCCResultType placeholder override to handle vector compare results.

Necessary to get the rL335821 bugfix (which was reverted at rL335871) un-reverted.

llvm-svn: 335884

6 years agoRevert "[MachineOutliner] Add always and never options to -enable-machine-outliner"
Jessica Paquette [Thu, 28 Jun 2018 17:26:19 +0000 (17:26 +0000)]
Revert "[MachineOutliner] Add always and never options to -enable-machine-outliner"

I accidentally committed this instead of D48683 because I haven't had coffee
yet.

llvm-svn: 335883

6 years agoRevert "[MachineOutliner] Never add the outliner in -O0"
Jessica Paquette [Thu, 28 Jun 2018 17:26:18 +0000 (17:26 +0000)]
Revert "[MachineOutliner] Never add the outliner in -O0"

This reverts commit 9c7c10e4073a0bc6a759ce5cd33afbac74930091.

It relies on r335872 since that introduces the machine outliner
flags test. I meant to commit D48683 in that commit, but got mixed
up and committed D48682 instead. So, I'm reverting this and
r335872, since D48682 hasn't made it through review yet.

llvm-svn: 335882

6 years ago[WebAssembly] Fix --export of LTO symbols
Sam Clegg [Thu, 28 Jun 2018 17:21:46 +0000 (17:21 +0000)]
[WebAssembly] Fix --export of LTO symbols

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

llvm-svn: 335881

6 years ago[CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.
Artem Belevich [Thu, 28 Jun 2018 17:15:52 +0000 (17:15 +0000)]
[CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.

That's where CUDA binaries appear to put them.

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

llvm-svn: 335880

6 years ago[MachineOutliner] Never add the outliner in -O0
Jessica Paquette [Thu, 28 Jun 2018 17:05:57 +0000 (17:05 +0000)]
[MachineOutliner] Never add the outliner in -O0

We shouldn't add the outliner when compiling at -O0 even if
-enable-machine-outliner is passed in. This makes sure that we
don't add it in this case.

This also updates machine-outliner-flags to reflect the change
and improves the comment describing what that test does.

llvm-svn: 335879

6 years ago[WebAssembly] Add support for bitcode archive members
Sam Clegg [Thu, 28 Jun 2018 17:04:58 +0000 (17:04 +0000)]
[WebAssembly] Add support for bitcode archive members

This change effects the behavior of --export-all. Previously
--export-all would only effect symbols that survived GC. Now
--export-all will prevent any non-local symbols from being GCed.

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

llvm-svn: 335878

6 years agoSelectionDAGBuilder, mach-o: Skip trap after noreturn call (for Mach-O)
Matthias Braun [Thu, 28 Jun 2018 17:00:45 +0000 (17:00 +0000)]
SelectionDAGBuilder, mach-o: Skip trap after noreturn call (for Mach-O)

Add NoTrapAfterNoreturn target option which skips emission of traps
behind noreturn calls even if TrapUnreachable is enabled.

Enable the feature on Mach-O to save code size; Comments suggest it is
not possible to enable it for the other users of TrapUnreachable.

rdar://41530228

DifferentialRevision: https://reviews.llvm.org/D48674
llvm-svn: 335877