platform/upstream/llvm.git
5 years ago[X86] Add VEX_LIG to scalar VEX/EVEX instructions that were missing it.
Craig Topper [Tue, 9 Apr 2019 23:30:36 +0000 (23:30 +0000)]
[X86] Add VEX_LIG to scalar VEX/EVEX instructions that were missing it.

Scalar VEX/EVEX instructions don't use the L bit and don't look at it for decoding either.
So we should ignore it in our disassembler.

The missing instructions here were found by grepping the raw tablegen class definitions in
the tablegen debug output.

llvm-svn: 358040

5 years ago[LLVM-C] Correct The Current Debug Location Accessors
Robert Widmann [Tue, 9 Apr 2019 22:31:56 +0000 (22:31 +0000)]
[LLVM-C] Correct The Current Debug Location Accessors

Summary: Deprecate the existing accessors for the "current debug location" of an IRBuilder.  The setter could not handle being reset to NULL, and the getter would create bogus metadata if the NULL location was returned.  Provide direct metadata-based accessors instead.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 358039

5 years ago[LLVM-C] Add Bindings to Access an Instruction's DebugLoc
Robert Widmann [Tue, 9 Apr 2019 22:27:51 +0000 (22:27 +0000)]
[LLVM-C] Add Bindings to Access an Instruction's DebugLoc

Summary: Provide direct accessors to supplement LLVMSetInstDebugLocation.  In addition, properly accept and return the NULL location.  The old accessors provided no way to do this, so the current debug location cannot currently be cleared.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 358038

5 years ago[LLVM-C] Add Section and Symbol Iterator Accessors for Object File Binaries
Robert Widmann [Tue, 9 Apr 2019 21:53:31 +0000 (21:53 +0000)]
[LLVM-C] Add Section and Symbol Iterator Accessors for Object File Binaries

Summary: This brings us to full feature parity with the old API, so I've deprecated it and updated the tests.  I'll do a follow-up patch to do some more cleanup and documentation work in this header.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 358037

5 years ago[X86] Fix a dangling StringRef issue introduced in r358029.
Craig Topper [Tue, 9 Apr 2019 21:37:21 +0000 (21:37 +0000)]
[X86] Fix a dangling StringRef issue introduced in r358029.

I was attempting to convert mnemonics to lower case after processing a pseudo prefix. But the ParseOperands just hold a StringRef for tokens so there is no where to allocate the memory.

Add FIXMEs for the lower case issue which also exists in the prefix parsing code.

llvm-svn: 358036

5 years ago[AArch64][GlobalISel] Add isel support for vector G_ICMP and G_ASHR & G_SHL
Amara Emerson [Tue, 9 Apr 2019 21:22:43 +0000 (21:22 +0000)]
[AArch64][GlobalISel] Add isel support for vector G_ICMP and G_ASHR & G_SHL

The selection for G_ICMP is unfortunately not currently importable from SDAG
due to the use of custom SDNodes. To support this, this selection method has an
opcode table which has been generated by a script, indexed by various
instruction properties. Ideally in future we will have a GISel native selection
patterns that we can write in tablegen to improve on this.

For selection of some types we also need support for G_ASHR and G_SHL which are
generated as a result of legalization. This patch also adds support for them,
generating the same code as SelectionDAG currently does.

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

llvm-svn: 358035

5 years ago[AArch64][GlobalISel] Legalize vector G_ICMP.
Amara Emerson [Tue, 9 Apr 2019 21:22:40 +0000 (21:22 +0000)]
[AArch64][GlobalISel] Legalize vector G_ICMP.

Selection support will be coming in a later patch.

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

llvm-svn: 358034

5 years ago[AArch64][GlobalISel] Add legalization for some vector G_SHL and G_ASHR.
Amara Emerson [Tue, 9 Apr 2019 21:22:37 +0000 (21:22 +0000)]
[AArch64][GlobalISel] Add legalization for some vector G_SHL and G_ASHR.

This is needed for some future support for vector ICMP.

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

llvm-svn: 358033

5 years ago[GlobalISel][AArch64] Allow CallLowering to handle types which are normally
Amara Emerson [Tue, 9 Apr 2019 21:22:33 +0000 (21:22 +0000)]
[GlobalISel][AArch64] Allow CallLowering to handle types which are normally
required to be passed as different register types. E.g. <2 x i16> may need to
be passed as a larger <2 x i32> type, so formal arg lowering needs to be able
truncate it back. Likewise, when dealing with returns of these types, they need
to be widened in the appropriate way back.

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

llvm-svn: 358032

5 years ago[InstCombine] Add with.overflow always overflow tests; NFC
Nikita Popov [Tue, 9 Apr 2019 20:02:23 +0000 (20:02 +0000)]
[InstCombine] Add with.overflow always overflow tests; NFC

The uadd and umul cases are currently handled, the usub, sadd, ssub
and smul cases are not. usub, sadd and ssub already have the
necessary ValueTracking support, smul doesn't.

llvm-svn: 358031

5 years ago[AArch64] Add test case to show missed opportunity to remove a shift before tbnz...
Craig Topper [Tue, 9 Apr 2019 19:23:37 +0000 (19:23 +0000)]
[AArch64] Add test case to show missed opportunity to remove a shift before tbnz when the shift has been zero extended from i32 to i64. NFC

This pattern showed up in D60358 and it was suggested I had a test and fix that separately.

llvm-svn: 358030

5 years ago[X86] Add support for {vex2}, {vex3}, and {evex} to the assembler to match gas. Use...
Craig Topper [Tue, 9 Apr 2019 18:45:15 +0000 (18:45 +0000)]
[X86] Add support for {vex2}, {vex3}, and {evex} to the assembler to match gas. Use {evex} to improve the one our 32-bit AVX512 tests.

These can be used to force the encoding used for instructions.

{vex2} will fail if the instruction is not VEX encoded, but otherwise won't do anything since we prefer vex2 when possible. Might need to skip use of the _REV MOV instructions for this too, but I haven't done that yet.

{vex3} will force the instruction to use the 3 byte VEX encoding or fail if there is no VEX form.

{evex} will force the instruction to use the EVEX version or fail if there is no EVEX version.

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

llvm-svn: 358029

5 years ago[pstl][CMake] Install CMake export files
Louis Dionne [Tue, 9 Apr 2019 18:35:56 +0000 (18:35 +0000)]
[pstl][CMake] Install CMake export files

This allows other projects to depend on PSTL using the classic CMake
find_package protocol.

llvm-svn: 358028

5 years ago[DAGCombiner][X86][SystemZ] Canonicalize SSUBO with immediate RHS to SADDO by negatin...
Craig Topper [Tue, 9 Apr 2019 18:33:56 +0000 (18:33 +0000)]
[DAGCombiner][X86][SystemZ] Canonicalize SSUBO with immediate RHS to SADDO by negating the immediate.

This lines up with what we do for regular subtract and it matches up better with X86 assumptions in isel patterns that add with immediate is more canonical than sub with immediate.

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

llvm-svn: 358027

5 years agoRevert "[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y)."
Nikita Popov [Tue, 9 Apr 2019 18:32:38 +0000 (18:32 +0000)]
Revert "[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y)."

This reverts commit 1383a9168948aabfd827220c9445ce0ce5765800.

sdiv-canonicalize.ll fails after this revision. The fold needs to be
moved outside the branch handling constant operands. However when this
is done there are further test changes, so I'm reverting this in the
meantime.

llvm-svn: 358026

5 years ago[InstCombine] Restructure OptimizeOverflowCheck; NFC
Nikita Popov [Tue, 9 Apr 2019 18:32:28 +0000 (18:32 +0000)]
[InstCombine] Restructure OptimizeOverflowCheck; NFC

Change the code to always handle the unsigned+signed cases together
with the same basic structure for add/sub/mul. The simple folds are
always handled first and then the ValueTracking overflow checks are
used.

llvm-svn: 358025

5 years agoRemove the unit at a time option
Eric Christopher [Tue, 9 Apr 2019 18:29:22 +0000 (18:29 +0000)]
Remove the unit at a time option
Removes the code from opt and the pass manager builder.
The code was unused - even by the C library code that was supposed to set
it and had been removed previously.

llvm-svn: 358024

5 years ago[TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1
Julian Lettner [Tue, 9 Apr 2019 17:51:55 +0000 (17:51 +0000)]
[TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1

Remove the dependency on Foundation so we can start running those tests
on other platforms. Rename/move of tests will be done in a separate
commit.

Reviewed By: kubamracek, dvyukov

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

llvm-svn: 358023

5 years ago[PDB Docs] Clarifications and fixes for DBI Stream.
Zachary Turner [Tue, 9 Apr 2019 17:38:34 +0000 (17:38 +0000)]
[PDB Docs] Clarifications and fixes for DBI Stream.

llvm-svn: 358022

5 years agoUpdate modulemaps for Analysis/VecFuncs.def.
Kristina Brooks [Tue, 9 Apr 2019 17:05:36 +0000 (17:05 +0000)]
Update modulemaps for Analysis/VecFuncs.def.

Avoid a warning while building modular LLVM due to a new
textual header missing in the modulemap:

TargetLibraryInfo.cpp:1485:6: warning: missing submodule
  'LLVM_Analysis.VecFuncs' [-Wincomplete-umbrella]

Added VecFuncs.def as a textual header in LLVM_Analysis.

llvm-svn: 358021

5 years ago[ValueTracking] Use computeConstantRange() for signed sub overflow determination
Nikita Popov [Tue, 9 Apr 2019 17:01:49 +0000 (17:01 +0000)]
[ValueTracking] Use computeConstantRange() for signed sub overflow determination

This is the same change as D60420 but for signed sub rather than
signed add: Range information is intersected into the known bits
result, allows to detect more no/always overflow conditions.

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

llvm-svn: 358020

5 years ago[TargetLowering] SimplifyDemandedBits - add ISD::INSERT_SUBVECTOR support
Simon Pilgrim [Tue, 9 Apr 2019 16:52:21 +0000 (16:52 +0000)]
[TargetLowering] SimplifyDemandedBits - add ISD::INSERT_SUBVECTOR support

llvm-svn: 358019

5 years ago[pstl][NFC] Move the ParallelSTLConfig template to the cmake/ subdirectory
Louis Dionne [Tue, 9 Apr 2019 16:48:43 +0000 (16:48 +0000)]
[pstl][NFC] Move the ParallelSTLConfig template to the cmake/ subdirectory

llvm-svn: 358018

5 years ago[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y).
Chen Zheng [Tue, 9 Apr 2019 16:34:31 +0000 (16:34 +0000)]
[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y).

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

llvm-svn: 358017

5 years ago[OPENMP]Allow allocate directive on parameters.
Alexey Bataev [Tue, 9 Apr 2019 16:31:37 +0000 (16:31 +0000)]
[OPENMP]Allow allocate directive on parameters.

Patch allows to use allocate directives on the function parameters.

llvm-svn: 358016

5 years agoRevert LIS handling in MachineDCE
Stanislav Mekhanoshin [Tue, 9 Apr 2019 16:13:53 +0000 (16:13 +0000)]
Revert LIS handling in MachineDCE

One of out of tree targets has regressed with this patch. Reverting
it for now and let liveness to be fully reconstructed in case pass
was used after the LIS is created to resolve the regression.

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

llvm-svn: 358015

5 years ago[ValueTracking] Use computeConstantRange() in signed add overflow determination
Nikita Popov [Tue, 9 Apr 2019 16:12:59 +0000 (16:12 +0000)]
[ValueTracking] Use computeConstantRange() in signed add overflow determination

This is D59386 for the signed add case. The computeConstantRange()
result is now intersected into the existing known bits information,
allowing to detect additional no-overflow/always-overflow conditions
(though the latter isn't used yet).

This (finally...) covers the motivating case from D59071.

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

llvm-svn: 358014

5 years ago[InstCombine] prevent possible miscompile with sdiv+negate of vector op
Sanjay Patel [Tue, 9 Apr 2019 15:13:03 +0000 (15:13 +0000)]
[InstCombine] prevent possible miscompile with sdiv+negate of vector op

Similar to:
rL358005

Forego folding arbitrary vector constants to fix a possible miscompile bug.
We can enhance the transform if we do want to handle the more complicated
vector case.

llvm-svn: 358013

5 years ago[DWARF] DWARFDebugLine: replace Sequence::orderByLowPC with orderByHighPC
Fangrui Song [Tue, 9 Apr 2019 15:08:32 +0000 (15:08 +0000)]
[DWARF] DWARFDebugLine: replace Sequence::orderByLowPC with orderByHighPC

In a sorted list of non-overlapping [LowPC,HighPC) ranges, locating an address with
upper_bound on HighPC is simpler than lower_bound on LowPC.

llvm-svn: 358012

5 years ago[scudo][standalone] Add flags & related parsers
Kostya Kortchinsky [Tue, 9 Apr 2019 14:57:25 +0000 (14:57 +0000)]
[scudo][standalone] Add flags & related parsers

Summary:
As with other Sanitizers, and the current version of Scudo, we can
provide flags in differents way: at compile time, through a weak
function, through an environment variable.

This change adds support for the configuration flags, and the string
parsers. Those are fairly similar to the sanitizer_common way of doing
things.

Reviewers: morehouse, hctim, vitalybuka

Reviewed By: morehouse, vitalybuka

Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 358011

5 years ago[InstCombine] add tests for sdiv with negated dividend and constant divisor; NFC
Sanjay Patel [Tue, 9 Apr 2019 14:48:44 +0000 (14:48 +0000)]
[InstCombine] add tests for sdiv with negated dividend and constant divisor; NFC

llvm-svn: 358010

5 years ago[CMake] Fix statically linking in libcxxabi if built separately
Martin Storsjo [Tue, 9 Apr 2019 14:31:09 +0000 (14:31 +0000)]
[CMake] Fix statically linking in libcxxabi if built separately

In this case, CMake doesn't know about the c++abi target within the
same CMake run.

This reverts this aspect back to how it was before SVN r357811.

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

llvm-svn: 358009

5 years ago[InstCombine] add tests for sdiv-by-int-min; NFC
Sanjay Patel [Tue, 9 Apr 2019 14:27:07 +0000 (14:27 +0000)]
[InstCombine] add tests for sdiv-by-int-min; NFC

llvm-svn: 358008

5 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 9 Apr 2019 14:27:03 +0000 (14:27 +0000)]
[InstCombine] auto-generate complete test checks; NFC

llvm-svn: 358007

5 years agoFixed comment as pointed out by post-commit review of D59845
Raphael Isemann [Tue, 9 Apr 2019 14:18:23 +0000 (14:18 +0000)]
Fixed comment as pointed out by post-commit review of D59845

llvm-svn: 358006

5 years ago[InstCombine] prevent possible miscompile with negate+sdiv of vector op
Sanjay Patel [Tue, 9 Apr 2019 14:09:06 +0000 (14:09 +0000)]
[InstCombine] prevent possible miscompile with negate+sdiv of vector op

// 0 - (X sdiv C)  -> (X sdiv -C)  provided the negation doesn't overflow.

This fold has been around for many years and nobody noticed the potential
vector miscompile from overflow until recently...
So it seems unlikely that there's much demand for a vector sdiv optimization
on arbitrary vector constants, so just limit the matching to splat constants
to avoid the possible bug.

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

llvm-svn: 358005

5 years agogn build: Fix Windows builds after r357797
Nico Weber [Tue, 9 Apr 2019 14:02:02 +0000 (14:02 +0000)]
gn build: Fix Windows builds after r357797

llvm-svn: 358004

5 years ago[InstCombine] add tests/comments for negate+sdiv; NFC
Sanjay Patel [Tue, 9 Apr 2019 13:41:29 +0000 (13:41 +0000)]
[InstCombine] add tests/comments for negate+sdiv; NFC

llvm-svn: 358003

5 years agoAdd support for detection of devtoolset-8
Tom Stellard [Tue, 9 Apr 2019 13:26:10 +0000 (13:26 +0000)]
Add support for detection of devtoolset-8

Summary:
The current llvm/clang et al. project can be built with the latest developer toolset (devtoolset-8) on RHEL, which provides GCC 8.2.1.
However, the result compiler will not identify this toolset itself when compiling programs, which is of course not desirable.

After the patch - which simply adds the name of the developer toolset to the existing list - it gets identified and selected, as shown below:

[bamboo@bamboo llvm-project]$ clang -v
clang version 9.0.0 (https://github.com/llvm/llvm-project.git e5ac385fb1ffa4bd3875ea6a4d24efdbd7814572)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/bamboo/llvm/bin
Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.2.1
Found candidate GCC installation: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7
Found candidate GCC installation: /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

Patch By: Radu-Adrian Popescu

Reviewers: tstellar, fedor.sergeev

Reviewed By: tstellar

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 358002

5 years agoNFC: Refactor library-specific mappings of scalar maths functions to their vector...
Nemanja Ivanovic [Tue, 9 Apr 2019 13:21:11 +0000 (13:21 +0000)]
NFC: Refactor library-specific mappings of scalar maths functions to their vector counterparts

This patch factors out mappings of scalar maths functions to their vector
counterparts from TargetLibraryInfo.cpp to a separate VecFuncs.def file. Such
mappings are currently available for Accelerate framework, and SVML library.

This is in support of the follow-up: https://reviews.llvm.org/D59881

Patch by pjeeva01

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

llvm-svn: 358001

5 years ago[InstCombine] add more testcases for canonicalize (-X s/ Y) to -(X s/ Y).
Chen Zheng [Tue, 9 Apr 2019 12:47:29 +0000 (12:47 +0000)]
[InstCombine] add more testcases for canonicalize (-X s/ Y) to -(X s/ Y).

llvm-svn: 358000

5 years ago[TargetLowering] SimplifyDemandedBits - Remove GetDemandedSrcMask lambda. NFCI.
Simon Pilgrim [Tue, 9 Apr 2019 12:29:26 +0000 (12:29 +0000)]
[TargetLowering] SimplifyDemandedBits - Remove GetDemandedSrcMask lambda. NFCI.

An older version of this could return false but now that this always succeeds we can just inline and simplify it.

llvm-svn: 357999

5 years agoImprove hashing for time profiler
Anton Afanasyev [Tue, 9 Apr 2019 12:18:44 +0000 (12:18 +0000)]
Improve hashing for time profiler

Summary:
Use optimized hashing while writing time trace by join two hashes to one.
Used for -ftime-trace option.

Reviewers: rnk, takuto.ikuta

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357998

5 years agoMove tests in r357996 to correct location within monorepo
Chih-Mao Chen [Tue, 9 Apr 2019 11:46:47 +0000 (11:46 +0000)]
Move tests in r357996 to correct location within monorepo

llvm-svn: 357997

5 years ago[RISCV] Rewrite tests to use llvm-mc/llvm-objdump
Chih-Mao Chen [Tue, 9 Apr 2019 11:39:50 +0000 (11:39 +0000)]
[RISCV] Rewrite tests to use llvm-mc/llvm-objdump

Previously the tests in lld for RISC-V were given in yaml format as
LLVM's RISC-V assembler support was incomplete. Now that the
assembler/disassembler has matured we can rewrite all tests to use
LLVM's tools.

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

llvm-svn: 357996

5 years ago[RISCV] Fix range check for HI20/LO12/RVC_LUI relocations
Chih-Mao Chen [Tue, 9 Apr 2019 11:39:23 +0000 (11:39 +0000)]
[RISCV] Fix range check for HI20/LO12/RVC_LUI relocations

The code previously specified a 32-bit range for R_RISCV_HI20 and
R_RISCV_LO12_[IS], however this is incorrect as the maximum offset on
RV64 that can be formed from the immediate of lui and the displacement
of an I-type or S-type instruction is -0x80000800 to 0x7ffff7ff. There
is also the same issue with a c.lui and LO12 pair, whose actual
addressable range should be -0x20800 to 0x1f7ff.

The tests will be included in the next patch that converts all RISC-V
tests to use llvm-mc instead of yaml2obj, as assembler support has
matured enough to write tests in them.

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

llvm-svn: 357995

5 years agoClangTidy: Avoid mixing stdout with stderror when dealing with a large number of...
Andi-Bogdan Postelnicu [Tue, 9 Apr 2019 11:17:02 +0000 (11:17 +0000)]
ClangTidy: Avoid mixing stdout with stderror when dealing with a large number of files.

Summary:
At Mozilla we are using this tool in order to perform review-time static-analysis, since some patches contain a large number of files we've discovered this issue, where `stderr` gets mixed with `stdout` thus obfuscating our possibility to parse the output.
The patch that we are currently use can be found [here](https://searchfox.org/mozilla-central/source/build/build-clang/clang-tidy-8.patch).

This is just an upstream of the original patch.

Reviewers: JonasToth

Reviewed By: JonasToth

Subscribers: cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 357994

5 years ago[RISCV] Unbreak test from r357989
Alex Bradbury [Tue, 9 Apr 2019 10:44:47 +0000 (10:44 +0000)]
[RISCV] Unbreak test from r357989

There were some errors in the committed test checks, left in due to a git
stash apply mishap.

llvm-svn: 357993

5 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyDemandedBits in bitcast handling
Simon Pilgrim [Tue, 9 Apr 2019 10:27:59 +0000 (10:27 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyDemandedBits in bitcast handling

When bitcasting from a source op to a larger bitwidth op, split the demanded bits and OR them on top of one another and demand those merged bits in the SimplifyDemandedBits call on the source op.

llvm-svn: 357992

5 years ago[RISCV][NFC] Minor fixup for r357989
Alex Bradbury [Tue, 9 Apr 2019 10:25:05 +0000 (10:25 +0000)]
[RISCV][NFC] Minor fixup for r357989

One of the tests in riscv64-lp64-lp64f-lp64d would have had a different
lowering for lp64f/lp64d as a float argument was missed.

llvm-svn: 357991

5 years ago[llvm-rtdyld] Fix missing include on MSVC builds.
Simon Pilgrim [Tue, 9 Apr 2019 10:15:10 +0000 (10:15 +0000)]
[llvm-rtdyld] Fix missing include on MSVC builds.

llvm-svn: 357990

5 years ago[RISCV][NFC] Refactor RISC-V ABI lowering tests in preparation for hard float patches
Alex Bradbury [Tue, 9 Apr 2019 10:12:49 +0000 (10:12 +0000)]
[RISCV][NFC] Refactor RISC-V ABI lowering tests in preparation for hard float patches

Split tests in to files representing the subset of RISC-V ABIs they should
have identical output for.

llvm-svn: 357989

5 years ago[DebugInfo] Pass all values in DebugLocEntry's constructor, NFC
David Stenberg [Tue, 9 Apr 2019 10:08:26 +0000 (10:08 +0000)]
[DebugInfo] Pass all values in DebugLocEntry's constructor, NFC

Summary:
With MergeValues() removed, amend DebugLocEntry's constructor so that it
takes multiple values rather than a single, and keep non-fragment values
in OpenRanges, as this allows some cleanup of the code in
buildLocationList().

Reviewers: aprantl, dblaikie, loladiro

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 357988

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Tue, 9 Apr 2019 09:38:25 +0000 (09:38 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 357987

5 years ago[ASTImporter] Fix in ASTImporter::Import_New(const Decl *)
Bjorn Pettersson [Tue, 9 Apr 2019 09:12:32 +0000 (09:12 +0000)]
[ASTImporter] Fix in ASTImporter::Import_New(const Decl *)

Make sure ASTImporter::Import_New(const Decl *) returns
a Expected<const Decl *> and not Expected<Decl *> to
make the clang/unittests/AST/ASTImporterTest.cpp compile
without the warning

 clang/unittests/AST/ASTImporterTest.cpp:117:12: error: no viable conversion from 'Expected<clang::Decl *>' to 'Expected<const clang::Decl *>'
    return Imported;

(I got the above when building with clang 3.6).

llvm-svn: 357985

5 years agoRemove unneeded #ifdef SWIGs
Pavel Labath [Tue, 9 Apr 2019 09:03:43 +0000 (09:03 +0000)]
Remove unneeded #ifdef SWIGs

Summary:
Some of these were present in files which should never be read by swig
(and we also had one in the interface file, which is only read by swig).
They are probably leftovers from the time when we were running swig over
lldb headers directly.

While writing this patch, I noticed that some of the #ifdefs were
guarding public functions that were operating on lldb_private data
types. While it wasn't strictly necessary for this patch, I made these
private, as nobody should really be accessing them. This can potentially
break existing code if it happened to use these methods, though it will
only break at build time -- if someone builds against an old header, he
should still be able to link to a new lldb library, since the functions
are still there.

We could keep these public for backward compatbility, but I would argue
that if anyone was actually using these functions for anything, his code
is already broken.

Reviewers: JDevlieghere, clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 357984

5 years agoFix doxygen warning about function argument
Jonas Devlieghere [Tue, 9 Apr 2019 09:03:30 +0000 (09:03 +0000)]
Fix doxygen warning about function argument

This fixes the following doxygen warning when building the lldb-cpp-doc
target.

This commit fixes:
  SBStructuredData.h:94 warning: Found unknown command `\dst'
  SBStructuredData.h:97 warning: Found unknown command `\dst'
  SBStructuredData.h:98 warning: Found unknown command `\dst'
  SBStructuredData.h:100 warning: Found unknown command `\dst'
  SBStructuredData.h:104 warning: Found unknown command `\dst'

Patch by: Konrad Kleine

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

llvm-svn: 357983

5 years agoDe-template SymbolTable::addShared.
Rui Ueyama [Tue, 9 Apr 2019 08:52:00 +0000 (08:52 +0000)]
De-template SymbolTable::addShared.

Because of r357925, this member function doesn't have to be a
template of ELFT.

llvm-svn: 357982

5 years ago[PowerPC] fix trivial typos in comment, NFC
Hiroshi Inoue [Tue, 9 Apr 2019 08:40:02 +0000 (08:40 +0000)]
[PowerPC] fix trivial typos in comment, NFC

llvm-svn: 357981

5 years agoAdd missing space between \btrue
Jonas Devlieghere [Tue, 9 Apr 2019 08:34:07 +0000 (08:34 +0000)]
Add missing space between \btrue

There was a space missing in some the documentation for
lldb::BreakpointsWriteToFile.

This fixes the following doxygen error when building the lldb-cpp-doc
target:

  llvm-project/lldb/include/lldb/API/SBTarget.h:775 warning: Found
  unknown command `\btrue'

Patch by: Konrad Kleine

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

llvm-svn: 357980

5 years ago[CMake] Fix accidentally swapped input/output parameters of string(REPLACE) for mingw
Martin Storsjo [Tue, 9 Apr 2019 08:31:25 +0000 (08:31 +0000)]
[CMake] Fix accidentally swapped input/output parameters of string(REPLACE) for mingw

llvm-svn: 357979

5 years ago[asan_symbolize] Move argument parser epilog text into script doc comment.
Dan Liew [Tue, 9 Apr 2019 08:30:43 +0000 (08:30 +0000)]
[asan_symbolize] Move argument parser epilog text into script doc comment.

Summary:
This will make it easier to expand on the documentation in the future
that avoids cluttering the code.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 357978

5 years agoMinidump: use string parsing functionality from llvm
Pavel Labath [Tue, 9 Apr 2019 08:28:27 +0000 (08:28 +0000)]
Minidump: use string parsing functionality from llvm

llvm-svn: 357977

5 years ago[CMake] Move configuration of LLVM_CXX_STD to HandleLLVMOptions.cmake
Justin Bogner [Tue, 9 Apr 2019 08:14:32 +0000 (08:14 +0000)]
[CMake] Move configuration of LLVM_CXX_STD to HandleLLVMOptions.cmake

Standalone builds of projects other than llvm itself (lldb, libcxx,
etc) include HandleLLVMOptions but not the top level llvm CMakeLists,
so we need to set this variable here to ensure that it always has a
value.

This should fix the build issues some folks have been seeing.

llvm-svn: 357976

5 years agoBreakpad: Parse Stack CFI records
Pavel Labath [Tue, 9 Apr 2019 08:05:11 +0000 (08:05 +0000)]
Breakpad: Parse Stack CFI records

Summary:
This patch adds support for parsing STACK CFI records from breakpad
files. The expressions specifying the values of registers are not
parsed.The idea is that these will be handed off to the postfix
expression -> dwarf compiler, once it is extracted from the internals of
the NativePDB plugin.

Reviewers: clayborg, amccarth, markmentovai

Subscribers: aprantl, lldb-commits

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

llvm-svn: 357975

5 years ago[DebugInfo] Remove redundant DebugLocEntry::MergeValues() function, NFC
David Stenberg [Tue, 9 Apr 2019 07:46:09 +0000 (07:46 +0000)]
[DebugInfo] Remove redundant DebugLocEntry::MergeValues() function, NFC

Summary:
The MergeValues() function would try to merge two entries if they shared
the same beginning label. Having the same beginning label means that the
former entry's range would be empty; however, after D55919 we no longer
create entries for empty ranges, so we can no longer land in a situation
where that check in MergeValues would succeed. Instead, the "merging" is
done by keeping the live values from the preceding empty ranges in
OpenRanges, and adding them to the first non-empty range.

Reviewers: aprantl, dblaikie, loladiro

Reviewed By: aprantl

Subscribers: llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 357974

5 years ago[X86] Remove check on isAsmParserOnly from EVEX2VEX tablegenerator. NFCI
Craig Topper [Tue, 9 Apr 2019 07:40:19 +0000 (07:40 +0000)]
[X86] Remove check on isAsmParserOnly from EVEX2VEX tablegenerator. NFCI

There are no instructions VEX or EVEX instructions that set this field.

llvm-svn: 357973

5 years ago[X86] Have EVEX2VEX tablegenerator use HasVEX_L and HasEVEX_L2 fields instead of...
Craig Topper [Tue, 9 Apr 2019 07:40:14 +0000 (07:40 +0000)]
[X86] Have EVEX2VEX tablegenerator use HasVEX_L and HasEVEX_L2 fields instead of the composite EVEX_LL field. Remove the EVEX_LL field. NFCI

The composite existed to simplify some other tablegen code and not really in an
important way. Remove the combined field and just calculate the vector size
using two ifs.

llvm-svn: 357972

5 years ago[X86] Use VEX_WIG for VPINSRB/W and VPEXTRB/W to match what is done for EVEX.
Craig Topper [Tue, 9 Apr 2019 07:40:10 +0000 (07:40 +0000)]
[X86] Use VEX_WIG for VPINSRB/W and VPEXTRB/W to match what is done for EVEX.

The instruction's document this as W0 for the VEX encoding. But there's a
footnote mentioning that VEX.W is ignored in 64-bit mode. And the main VEX
encoding description says the VEX.W bit is ignored for instructions that are
equivalent to a legacy SSE instruction that uses REX.W to select a GPR which
would apply here.

By making this match EVEX we can remove a special case of allowing EVEX2VEX to
turn an EVEX.WIG instruction into VEX.W0.

llvm-svn: 357971

5 years ago[X86] Split the VEX_WPrefix in X86Inst tablegen class into 3 separate fields with...
Craig Topper [Tue, 9 Apr 2019 07:40:06 +0000 (07:40 +0000)]
[X86] Split the VEX_WPrefix in X86Inst tablegen class into 3 separate fields with clear meanings.

llvm-svn: 357970

5 years ago[ValueTracking] Use ConstantRange methods; NFC
Nikita Popov [Tue, 9 Apr 2019 07:13:09 +0000 (07:13 +0000)]
[ValueTracking] Use ConstantRange methods; NFC

Switch part of the computeOverflowForSignedAdd() implementation to
use Range.isAllNegative() rather than KnownBits.isNegative() and
similar. They do the same thing, but using the ConstantRange methods
allows dropping the KnownBits variables more easily in D60420.

llvm-svn: 357969

5 years ago[ValueTracking] Explicitly specify intersection type; NFC
Nikita Popov [Tue, 9 Apr 2019 07:13:03 +0000 (07:13 +0000)]
[ValueTracking] Explicitly specify intersection type; NFC

Preparation for D60420.

llvm-svn: 357968

5 years agoInclude omitted word in comment.
Eric Christopher [Tue, 9 Apr 2019 06:35:47 +0000 (06:35 +0000)]
Include omitted word in comment.

llvm-svn: 357967

5 years ago[WebAssembly] Ensure ArchiveName is set even in the presence of --whole-archive.
Sam Clegg [Tue, 9 Apr 2019 05:41:52 +0000 (05:41 +0000)]
[WebAssembly] Ensure ArchiveName is set even in the presence of --whole-archive.

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

llvm-svn: 357966

5 years ago[llvm-objdump] Migrate some functions from std::error_code to Error
Fangrui Song [Tue, 9 Apr 2019 05:41:24 +0000 (05:41 +0000)]
[llvm-objdump] Migrate some functions from std::error_code to Error

llvm-svn: 357965

5 years agoAMDGPU/GlobalISel: Implement call lowering for shaders returning values
Tom Stellard [Tue, 9 Apr 2019 02:26:03 +0000 (02:26 +0000)]
AMDGPU/GlobalISel: Implement call lowering for shaders returning values

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, volkan, llvm-commits

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

llvm-svn: 357964

5 years agoGet the run locker before you ask if your thread is valid.
Jim Ingham [Tue, 9 Apr 2019 01:33:23 +0000 (01:33 +0000)]
Get the run locker before you ask if your thread is valid.

I have occasional crashes coming from SBThread::GetExtendedBacktraceThread.  The
symptom is that we got true back from HasThreadScope - so we should have a valid
live thread, but then when we go to use the thread, it is not good anymore and we
crash.
I can't spot any obvious cause for this crash, but in looking for same I noticed
that in the current code we check that the thread is valid, THEN we take the stop
locker.  We really should do that in the other order, and ensure that the process
will stay stopped before we check our thread is still good.  That's what this patch does.

<rdar://problem/47478205>

llvm-svn: 357963

5 years ago[PowerPC] initialize SchedModel according to platform.
Chen Zheng [Tue, 9 Apr 2019 01:25:25 +0000 (01:25 +0000)]
[PowerPC] initialize SchedModel according to platform.
Differential Revision: https://reviews.llvm.org/D60177

llvm-svn: 357962

5 years agoAdd a reduced copy of the llvm .gitignore
Eric Christopher [Tue, 9 Apr 2019 00:52:49 +0000 (00:52 +0000)]
Add a reduced copy of the llvm .gitignore
as a start for the monorepo .gitignore.

llvm-svn: 357961

5 years agohwasan: Enable -hwasan-allow-ifunc by default.
Peter Collingbourne [Tue, 9 Apr 2019 00:25:59 +0000 (00:25 +0000)]
hwasan: Enable -hwasan-allow-ifunc by default.

It's been on in Android for a while without causing problems, so it's time
to make it the default and remove the flag.

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

llvm-svn: 357960

5 years ago[X86] Derive ssmem and sdmem from X86MemOperand. NFCI
Craig Topper [Tue, 9 Apr 2019 00:24:17 +0000 (00:24 +0000)]
[X86] Derive ssmem and sdmem from X86MemOperand. NFCI

This changes the operand type from v4f32/v2f64 to iPTR which seems more correct. But that doesn't seem to do anything other than change the comments in X86GenDAGISel.inc. Probably because we use a ComplexPattern to do the matching so there's no autogenerated code to change.

llvm-svn: 357959

5 years agoRevert "Make reads and writes of the guard variable atomic."
Eric Fiselier [Mon, 8 Apr 2019 23:37:48 +0000 (23:37 +0000)]
Revert "Make reads and writes of the guard variable atomic."

This reverts commit r357944 and r357949.

These changes failed to account for the fact that
the guard object is under aligned for atomic operations
on 32 bit platforms (It's aligned to 4 bytes but we require 8).

llvm-svn: 357958

5 years ago[clang-format] Add AfterCaseLabel to BraceWrapping
Owen Pan [Mon, 8 Apr 2019 23:36:25 +0000 (23:36 +0000)]
[clang-format] Add AfterCaseLabel to BraceWrapping

Fixes PR38686

> llvm-svn: 52527

llvm-svn: 357957

5 years agoFix incorrect change during refactoring.
Eric Fiselier [Mon, 8 Apr 2019 23:20:09 +0000 (23:20 +0000)]
Fix incorrect change during refactoring.

cxa_guard_abort should still broadcast on exit.

llvm-svn: 357956

5 years agoRename Target::GetSharedModule to Target::GetOrCreateModule.
Jason Molenda [Mon, 8 Apr 2019 23:03:02 +0000 (23:03 +0000)]
Rename Target::GetSharedModule to Target::GetOrCreateModule.

Add a flag to control whether the ModulesDidLoad notification is
called when a module is added.  If the notifications are disabled,
the caller must call ModulesDidLoad after adding all the new modules,
but postponing this notification until they're all batched up can
allow for better efficiency than notifying one-by-one.

Change the name of the ModuleList notifier functions that a subclass
can implement to start with 'Notify' to make it clear what they are.
Add a NotifyModulesRemoved.

Add header documentation for the changed/updated methods.

Added defaulted-value 'notify' argument to ModuleList Append,
AppendIfNeeded, and Remove because callers working with a local
ModuleList don't have an obvious idea of what notify means in this
context.  When the ModuleList is a part of the Target class, the
notify behavior matters.

DynamicLoaderDarwin has been updated so that libraries being
added/removed are correctly batched up before notifications are
sent.  Added the TestModuleLoadedNotifys.py test to run on
Darwin to test this.

<rdar://problem/48293064>

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

llvm-svn: 357955

5 years agoExperiment with a larger packet timeout.
Adrian Prantl [Mon, 8 Apr 2019 23:02:11 +0000 (23:02 +0000)]
Experiment with a larger packet timeout.

This is a follow-up to r357829 (https://reviews.llvm.org/D60340) to
see whether increasing the packet timeout for non-asan builds could
also positively affect the stability of non-asan bots.

llvm-svn: 357954

5 years ago[InstCombine] add tests for negate+sdiv; NFC
Sanjay Patel [Mon, 8 Apr 2019 22:55:10 +0000 (22:55 +0000)]
[InstCombine] add tests for negate+sdiv; NFC

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

llvm-svn: 357953

5 years agoRevert "[MS] Add metadata for __declspec(allocator)"
Amy Huang [Mon, 8 Apr 2019 22:46:41 +0000 (22:46 +0000)]
Revert "[MS] Add metadata for __declspec(allocator)"

This reverts commit e7bd735bb03a7b8141e32f7d6cb98e8914d8799e.
Reverting because of buildbot failure.

llvm-svn: 357952

5 years ago[asan_symbolize] Use proper logging infrastructure.
Dan Liew [Mon, 8 Apr 2019 22:28:27 +0000 (22:28 +0000)]
[asan_symbolize] Use proper logging infrastructure.

Summary:
The previous logging infrastructure had several problems:

* Debugging output was emitted to standard output which is also where
  the symbolized output would go. Interleaving these two separate
  bits of information makes inspecting the output difficult and could
  potentially break tests.

* Enabling debugging output requires modifying the script which is
  not very conveninent.

* When debugging it isn't immediately obvious where the output is
  coming from.

This patch uses the Python standard library logging infrastructure
which fixes all of the above problems. Logging is controlled using
two new options.

* `--log-level` - Sets the logging level, default is
`info`.
* `--log-dest` - Set the logging destination, default
is standard error.

Some simple test cases for the feature are included.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 357951

5 years ago[RuntimeDyld] Fix an ambiguous make_unique call.
Lang Hames [Mon, 8 Apr 2019 22:19:05 +0000 (22:19 +0000)]
[RuntimeDyld] Fix an ambiguous make_unique call.

llvm-svn: 357950

5 years agoRemove unneeded write in __cxa_guard_release.
Eric Fiselier [Mon, 8 Apr 2019 22:07:36 +0000 (22:07 +0000)]
Remove unneeded write in __cxa_guard_release.

The INIT_COMPLETE write now writes to the entire guard object
instead of just one byte.

llvm-svn: 357949

5 years agoFix a stack buffer overflow found by ASAN.
Adrian Prantl [Mon, 8 Apr 2019 21:58:36 +0000 (21:58 +0000)]
Fix a stack buffer overflow found by ASAN.

llvm::StringRef host_and_port is not guaranteed to be null-terminated.
Generally, it is not safe at all to convert a StringRef into a char *
by calling data() on it.

<rdar://problem/49698580>

llvm-svn: 357948

5 years ago[RuntimeDyld] Decouple RuntimeDyldChecker from RuntimeDyld.
Lang Hames [Mon, 8 Apr 2019 21:50:48 +0000 (21:50 +0000)]
[RuntimeDyld] Decouple RuntimeDyldChecker from RuntimeDyld.

This will allow RuntimeDyldChecker (and rtdyld-check tests) to test a new JIT
linker: JITLink (https://reviews.llvm.org/D58704).

llvm-svn: 357947

5 years ago[libc++] Remove install_name and compatibility_version on OS X
Louis Dionne [Mon, 8 Apr 2019 21:37:42 +0000 (21:37 +0000)]
[libc++] Remove install_name and compatibility_version on OS X

CMake already specifies those, and we never actually want those to be
used. In fact, r357811 re-ordered those flags in a way that the
explicitly-provided install_name was overriding the CMake-provided
install_name (instead of the other way around). This caused the dylib
to be considered a system dylib, and hence the explicitly provided rpath
to be ignored. This, in turn, caused some unit tests to start linking
against the system libc++.dylib instead of the freshly-built one.
Specifically, the unit tests that started linking against the system
dylib are those that didn't specify a DYLD_LIBRARY_PATH, such as
last_write_time.sh.cpp.

llvm-svn: 357946

5 years ago[BinaryFormat] Update Mach-O ARM64E CPU subtype and dumping
Shoaib Meenai [Mon, 8 Apr 2019 21:37:08 +0000 (21:37 +0000)]
[BinaryFormat] Update Mach-O ARM64E CPU subtype and dumping

The new value is taken from <mach/machine.h> in the MacOSX10.14 SDK from
Xcode 10.1. Update llvm-objdump and llvm-readobj accordingly.

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

llvm-svn: 357945

5 years agoMake reads and writes of the guard variable atomic.
Eric Fiselier [Mon, 8 Apr 2019 21:26:25 +0000 (21:26 +0000)]
Make reads and writes of the guard variable atomic.

The read of the guard variable by the caller is atomic,
and doesn't happen under a mutex.

Our internal reads and writes were non-atomic, because they happened
under a mutex.

The writes should always be atomic since they can be observed outside
of the lock.

Making the reads atomic is not strictly necessary under the current
global mutex approach, but will be under implementations that use a
futex (which I plan to land shortly). However, they should add little
additional cost.

llvm-svn: 357944

5 years ago[InstCombine] peek through fdiv to find a squared sqrt
Sanjay Patel [Mon, 8 Apr 2019 21:23:50 +0000 (21:23 +0000)]
[InstCombine] peek through fdiv to find a squared sqrt

A more general canonicalization between fdiv and fmul would not
handle this case because that would have to be limited by uses
to prevent 2 values from becoming 3 values:
(x/y) * (x/y) --> (x*x) / (y*y)

(But we probably should still have that limited -- but more general --
canonicalization independently of this change.)

llvm-svn: 357943

5 years ago[TargetLowering] SimplifyDemandedBits - use DemandedElts in bitcast handling
Simon Pilgrim [Mon, 8 Apr 2019 20:59:38 +0000 (20:59 +0000)]
[TargetLowering] SimplifyDemandedBits - use DemandedElts in bitcast handling

Be more selective in the SimplifyDemandedBits -> SimplifyDemandedVectorElts bitcast call based on the demanded elts.

llvm-svn: 357942

5 years agoMove the builtin headers to use the new license file header.
Chandler Carruth [Mon, 8 Apr 2019 20:51:30 +0000 (20:51 +0000)]
Move the builtin headers to use the new license file header.

Summary:
These all had somewhat custom file headers with different text from the
ones I searched for previously, and so I missed them. Thanks to Hal and
Kristina and others who prompted me to fix this, and sorry it took so
long.

Reviewers: hfinkel

Subscribers: mcrosier, javed.absar, cfe-commits

Tags: #clang

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

llvm-svn: 357941

5 years ago[ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name...
Shafik Yaghmour [Mon, 8 Apr 2019 20:50:21 +0000 (20:50 +0000)]
[ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName

Summary:
https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitEnumDecl(...) for the conflicting names case. This could lead to erroneous return of an error in that case since we should have been using SearchName. Name may be empty in the case where we find the name via getTypedefNameForAnonDecl(...).

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

llvm-svn: 357940