platform/upstream/llvm.git
7 years agoMerge addInputSec with OutputSection::addSection.
Rui Ueyama [Sat, 7 Oct 2017 00:43:31 +0000 (00:43 +0000)]
Merge addInputSec with OutputSection::addSection.

Previously, when we added an input section to an output section, we
called `OutputSectionFactory::addInputSec`. This isn't a good design
because, a factory class is intended to create a new object and
return it, but in this use case, it will never create a new object.
This patch fixes the design flaw.

llvm-svn: 315138

7 years agoReturn early. NFC.
Rui Ueyama [Sat, 7 Oct 2017 00:22:59 +0000 (00:22 +0000)]
Return early. NFC.

llvm-svn: 315137

7 years ago[MachineOutliner] Disable outlining from LinkOnceODRs by default
Jessica Paquette [Sat, 7 Oct 2017 00:16:34 +0000 (00:16 +0000)]
[MachineOutliner] Disable outlining from LinkOnceODRs by default

Say you have two identical linkonceodr functions, one in M1 and one in M2.
Say that the outliner outlines A,B,C from one function, and D,E,F from another
function (where letters are instructions). Now those functions are not
identical, and cannot be deduped. Locally to M1 and M2, these outlining
choices would be good-- to the whole program, however, this might not be true!

To mitigate this, this commit makes it so that the outliner sees linkonceodr
functions as unsafe to outline from. It also adds a flag,
-enable-linkonceodr-outlining, which allows the user to specify that they
want to outline from such functions when they know what they're doing.

Changing this handles most code size regressions in the test suite caused by
competing with linker dedupe. It also doesn't have a huge impact on the code
size improvements from the outliner. There are 6 tests that regress > 5% from
outlining WITH linkonceodrs to outlining WITHOUT linkonceodrs. Overall, most
tests either improve or are not impacted.

Not outlined vs outlined without linkonceodrs:
https://hastebin.com/raw/qeguxavuda

Not outlined vs outlined with linkonceodrs:
https://hastebin.com/raw/edepoqoqic

Outlined with linkonceodrs vs outlined without linkonceodrs:
https://hastebin.com/raw/awiqifiheb

Numbers generated using compare.py with -m size.__text. Tests run for AArch64
with -Oz -mllvm -enable-machine-outliner -mno-red-zone.

llvm-svn: 315136

7 years agoRemove the input file specification from the
Jason Molenda [Sat, 7 Oct 2017 00:13:10 +0000 (00:13 +0000)]
Remove the input file specification from the
"Prepare Swig Bindings" shell script phase; it
wasn't the actual input file and could lead
to incorrect dependency analysis by the build
system.
<rdar://problem/34751196>

llvm-svn: 315135

7 years agoRemove unused parameters.
Rui Ueyama [Sat, 7 Oct 2017 00:08:30 +0000 (00:08 +0000)]
Remove unused parameters.

llvm-svn: 315133

7 years ago[asan] Disable wcslen test on 32-bit Android.
Evgeniy Stepanov [Sat, 7 Oct 2017 00:04:24 +0000 (00:04 +0000)]
[asan] Disable wcslen test on 32-bit Android.

llvm-svn: 315132

7 years agoUse error() instead of warn() to report undefined symbols.
Rui Ueyama [Fri, 6 Oct 2017 23:43:54 +0000 (23:43 +0000)]
Use error() instead of warn() to report undefined symbols.

I believe the reason why we used warn() instead of error() to report
undefined symbols is because the older implementation of error() exitted
immediately. Here, we want to find as many undefined symbols as we can,
so I chose to use warn() instead of error().

Now error() does not exit immediately, so it doesn't make sense to keep
them as warnings.

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

llvm-svn: 315131

7 years ago[InstCombine] use correct type when propagating constant condition in simplifyDivRemO...
Sanjay Patel [Fri, 6 Oct 2017 23:43:06 +0000 (23:43 +0000)]
[InstCombine] use correct type when propagating constant condition in simplifyDivRemOfSelectWithZeroOp (PR34856)

llvm-svn: 315130

7 years agoDo not mutate Script->Opt.Commands from a leaf helper function.
Rui Ueyama [Fri, 6 Oct 2017 23:34:43 +0000 (23:34 +0000)]
Do not mutate Script->Opt.Commands from a leaf helper function.

Factory::addInputSec added an output section to Script->Opt.Commands,
but that is too subtle. This patch makes it explicit so that it is easy
to see when a new element is added to Script->Opt.Commands.

llvm-svn: 315129

7 years ago[llvm-rc] Fix some endianness errors.
Zachary Turner [Fri, 6 Oct 2017 23:21:43 +0000 (23:21 +0000)]
[llvm-rc] Fix some endianness errors.

llvm-svn: 315128

7 years ago[InstCombine] rename SimplifyDivRemOfSelect to be clearer, add comments, simplify...
Sanjay Patel [Fri, 6 Oct 2017 23:20:16 +0000 (23:20 +0000)]
[InstCombine] rename SimplifyDivRemOfSelect to be clearer, add comments, simplify code; NFCI

There's at least one bug here - this code can fail with vector types (PR34856).
It's also being called for FREM; I'm still trying to understand how that is valid.

llvm-svn: 315127

7 years agoDriver: hoist the `wchar_t` handling to the driver
Saleem Abdulrasool [Fri, 6 Oct 2017 23:09:55 +0000 (23:09 +0000)]
Driver: hoist the `wchar_t` handling to the driver

Move the logic for determining the `wchar_t` type information into the
driver.  Rather than passing the single bit of information of
`-fshort-wchar` indicate to the frontend the desired type of `wchar_t`
through a new `-cc1` option of `-fwchar-type` and indicate the
signedness through `-f{,no-}signed-wchar`.  This replicates the current
logic which was spread throughout Basic into the
`RenderCharacterOptions`.

Most of the changes to the tests are to ensure that the frontend uses
the correct type.  Add a new test set under `test/Driver/wchar_t.c` to
ensure that we calculate the proper types for the various cases.

llvm-svn: 315126

7 years agoSimplify LinkerScript::addOrphanSections. NFCI.
Rui Ueyama [Fri, 6 Oct 2017 23:06:55 +0000 (23:06 +0000)]
Simplify LinkerScript::addOrphanSections. NFCI.

This patch moves a std::find to a new function. It also removes
the following piece of code. I believe it should be fine because all
tests still pass.

  unsigned Index = std::distance(Opt.Commands.begin(), I);
  assert(Sec->SectionIndex == INT_MAX || Sec->SectionIndex == Index);
  Sec->SectionIndex = Index;

llvm-svn: 315125

7 years agoSplit addSection into two small functions. NFCI.
Rui Ueyama [Fri, 6 Oct 2017 23:06:40 +0000 (23:06 +0000)]
Split addSection into two small functions. NFCI.

addSection function was hard to read because it behaves differently
depending on its arguments but what exactly it does is not clear.
Now it should be better. Still, it is not clear (not what but) why
it does what it does, but I'll take a look at it later.

llvm-svn: 315124

7 years agoSpecify the input & output results of the "Prepare Swig Bindings"
Jason Molenda [Fri, 6 Oct 2017 22:43:42 +0000 (22:43 +0000)]
Specify the input & output results of the "Prepare Swig Bindings"
shell script phase to aid build systems.
<rdar://problem/34751196>

llvm-svn: 315123

7 years ago[AVX512] Fix TERNLOG when folding broadcast
Cameron McInally [Fri, 6 Oct 2017 22:31:29 +0000 (22:31 +0000)]
[AVX512] Fix TERNLOG when folding broadcast

Patch to fix ternlog instructions with a folded
broadcast. The broadcast decorator, e.g. {1toX}, was missing.

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

llvm-svn: 315122

7 years ago[dwarfdump] Verify that unit type matches root DIE
Jonas Devlieghere [Fri, 6 Oct 2017 22:27:31 +0000 (22:27 +0000)]
[dwarfdump] Verify that unit type matches root DIE

This patch adds two new verifiers:

  - It checks that the root DIE of a CU is actually a valid unit DIE.
    (based on its tag)
  - For DWARF5 which contains a unit type int he CU header, it checks that
    this matches the type of the unit DIE.

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

llvm-svn: 315121

7 years ago[CMake] Add LLDB_INCLUDE_TESTS variable
Chris Bieneman [Fri, 6 Oct 2017 22:21:36 +0000 (22:21 +0000)]
[CMake] Add LLDB_INCLUDE_TESTS variable

This behaves like the other *_INCLUDE_TESTS variables in CMake and is tied to LLVM_INCLUDE_TESTS so that if you're building in-tree and not building the LLVM tests, you also won't build the LLDB tests.

llvm-svn: 315120

7 years agoReland r315114, "ELF: Export preempted symbols even if there is a dynamic list."...
Peter Collingbourne [Fri, 6 Oct 2017 22:09:03 +0000 (22:09 +0000)]
Reland r315114, "ELF: Export preempted symbols even if there is a dynamic list." which was reverted in r315116.

I hadn't synced past the change that changed the default hash style
to --hash-style=both, so my test had the symbols in the wrong order.

llvm-svn: 315119

7 years ago[llvm-rc] Implement escape sequences in .rc files.
Zachary Turner [Fri, 6 Oct 2017 22:05:15 +0000 (22:05 +0000)]
[llvm-rc] Implement escape sequences in .rc files.

This allows the escape sequences (\a, \n, \r, \t, \\, \x[0-9a-f]*,
\[0-7]*, "") to appear in .rc scripts. These are parsed and output in
the same way as it's done in original MS implementation.

The way these sequences are processed depends on the type of the
resource it resides in, and on whether the user declared the string to
be "wide" or "narrow".

I tried to maintain the maximum compatibility with the original tool
(and fail in some erroneous situations that are accepted by .rc).
However, there are some (extremely rare) cases where Microsoft tool
outputs nonsense. I found it infeasible to detect such casses.

Patch by Marek Sokolowski

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

llvm-svn: 315118

7 years ago[llvm-rc] Serialize user-defined resources to .res files.
Zachary Turner [Fri, 6 Oct 2017 21:52:15 +0000 (21:52 +0000)]
[llvm-rc] Serialize user-defined resources to .res files.

This allows rc to serialize user-defined resources, as
documented at:

msdn.microsoft.com/en-us/library/windows/desktop/aa381054.aspx

Escape sequences are yet unavailable, and are to be added in one of
child patches.

Patch by: Marek Sokolowski

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

llvm-svn: 315117

7 years agoRevert r315114, "ELF: Export preempted symbols even if there is a dynamic list."
Peter Collingbourne [Fri, 6 Oct 2017 21:48:39 +0000 (21:48 +0000)]
Revert r315114, "ELF: Export preempted symbols even if there is a dynamic list."

For some reason the symbols get emitted in the wrong order on one of the
buildbots: http://bb9.pgr.jp/#builders/15/builds/180

llvm-svn: 315116

7 years agoMake a few member varaibles/functions private.
Rui Ueyama [Fri, 6 Oct 2017 21:42:37 +0000 (21:42 +0000)]
Make a few member varaibles/functions private.

llvm-svn: 315115

7 years agoELF: Export preempted symbols even if there is a dynamic list.
Peter Collingbourne [Fri, 6 Oct 2017 21:33:59 +0000 (21:33 +0000)]
ELF: Export preempted symbols even if there is a dynamic list.

Dynamic lists in an executable are additive, not restrictive, so we
must continue to export preempted symbols even with a dynamic list.

This fixes sanitizer interception of libc symbols (and should also fix
symbol preemption by users of sanitizers).

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

llvm-svn: 315114

7 years agoInline a small function.
Rui Ueyama [Fri, 6 Oct 2017 21:32:23 +0000 (21:32 +0000)]
Inline a small function.

llvm-svn: 315113

7 years ago[llvm-rc] Serialize STRINGTABLE statements to .res file.
Zachary Turner [Fri, 6 Oct 2017 21:30:55 +0000 (21:30 +0000)]
[llvm-rc] Serialize STRINGTABLE statements to .res file.

This allows llvm-rc to serialize STRINGTABLE resources.

These are output in an unusual way: we locate them at the end of the
file, and strings are merged into bundles of max 16 strings, depending
on their IDs, language, and characteristics.

Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381050.aspx

Patch by: Marek Sokolowski
Differential Revision: https://reviews.llvm.org/D38420

llvm-svn: 315112

7 years agoRevert "For dllexport class templates, export specializations of member functions...
Reid Kleckner [Fri, 6 Oct 2017 21:28:21 +0000 (21:28 +0000)]
Revert "For dllexport class templates, export specializations of member functions (PR34849)"

This reverts r315025, it caused http://crbug.com/772461

llvm-svn: 315111

7 years ago[llvm-rc] Serialize VERSIONINFO resources to .res files.
Zachary Turner [Fri, 6 Oct 2017 21:26:06 +0000 (21:26 +0000)]
[llvm-rc] Serialize VERSIONINFO resources to .res files.

This is now able to dump VERSIONINFO resources.

Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx

Differential Revision: https://reviews.llvm.org/D38410
Patch by: Marek Sokolowski

llvm-svn: 315110

7 years ago[llvm-rc] Serialize CURSOR and ICON resources to .res
Zachary Turner [Fri, 6 Oct 2017 21:25:44 +0000 (21:25 +0000)]
[llvm-rc] Serialize CURSOR and ICON resources to .res

This is part 6 of llvm-rc serialization.

This adds ability to output cursors and icons as resources.

Unfortunately, we can't just copy .cur or .ico files to output - as each
file might contain multiple images, each of them needs to be unpacked
and stored as a separate resource. This forces us to parse cursor and
icon contents. (Fortunately, these formats are pretty similar and can be
processed by mostly common code).

As test files are binary, here is a short explanation of .cur and .ico
files stored:

cursor.cur, cursor-8.cur, cursor-32.cur are sample correct cursor files,
differing in their bit depth.

icon-old.ico, icon-new.ico are sample correct icon files;

icon-png.ico is a sample correct icon file in PNG format (instead of
usual BMP);

cursor-eof.cur is an incorrect cursor file - this is cursor.cur with
some of its final bytes removed.

cursor-bad-offset.cur is an incorrect cursor file - image header states
that image data begins at offset 0xFFFFFFFF.

Sample correct cursors and icons were created by Nico Weber.

Patch by Marek Sokolowski
Differential Revision: https://reviews.llvm.org/D37878

llvm-svn: 315109

7 years agoRevert "Roll forward r314928"
Reid Kleckner [Fri, 6 Oct 2017 21:17:51 +0000 (21:17 +0000)]
Revert "Roll forward r314928"

This appears to be miscompiling Clang, as shown on two Windows bootstrap
bots:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/7611
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/6870

Nothing else is in the blame list. Both emit errors on this valid code
in the Windows ucrt headers:

C:\...\ucrt\malloc.h:95:32: error: invalid operands to binary expression ('char *' and 'int')
            _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
                   ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~

I am attempting to reproduce this now.

This reverts r315044

llvm-svn: 315108

7 years ago[MS] Raise the default value of _MSC_VER to 1911, which is VS 2017
Reid Kleckner [Fri, 6 Oct 2017 21:02:28 +0000 (21:02 +0000)]
[MS] Raise the default value of _MSC_VER to 1911, which is VS 2017

Summary:
This raises our default past 1900, which controls whether char16_t is a
builtin type or not.

Implements PR34243

Reviewers: hans

Subscribers: STL_MSFT, rsmith, cfe-commits

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

llvm-svn: 315107

7 years agoFactor out default_(a|ub)sanitizer_opts in lit.
Evgeniy Stepanov [Fri, 6 Oct 2017 20:53:40 +0000 (20:53 +0000)]
Factor out default_(a|ub)sanitizer_opts in lit.

Reviewers: vitalybuka

Subscribers: srhines, llvm-commits, kubamracek

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

llvm-svn: 315106

7 years ago[sanitizer] Test ubsan and cfi on android.
Evgeniy Stepanov [Fri, 6 Oct 2017 20:51:51 +0000 (20:51 +0000)]
[sanitizer] Test ubsan and cfi on android.

Summary:
Enable check-cfi and check-ubsan on Android.
Check-ubsan includes standalone and ubsan+asan, but not tsan or msan.
Cross-dso cfi tests are disabled for now.

Reviewers: vitalybuka, pcc

Subscribers: srhines, kubamracek, llvm-commits, mgorny

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

llvm-svn: 315105

7 years ago[llvm-rc] Add optional serialization support for DIALOG(EX) resources.
Zachary Turner [Fri, 6 Oct 2017 20:51:20 +0000 (20:51 +0000)]
[llvm-rc] Add optional serialization support for DIALOG(EX) resources.

This is part 5 of llvm-rc serialization support.

This allows DIALOG and DIALOGEX to serialize if dialog-specific optional
statements are provided. These are (as of now): CAPTION, FONT, and
STYLE.

Notably, FONT statement can take more than two arguments when describing
DIALOGEX resources (as in
msdn.microsoft.com/en-us/library/windows/desktop/aa381013.aspx). I made
some changes to the parser to reflect this fact.

Patch by Marek Sokolowski
Differential Revision: https://reviews.llvm.org/D37864

llvm-svn: 315104

7 years ago-Wdocumentation should allow '...' params in variadic function type aliases
Alex Lorenz [Fri, 6 Oct 2017 20:51:04 +0000 (20:51 +0000)]
-Wdocumentation should allow '...' params in variadic function type aliases

rdar://34811344

llvm-svn: 315103

7 years agoUnify spelling.
Adrian Prantl [Fri, 6 Oct 2017 20:24:35 +0000 (20:24 +0000)]
Unify spelling.

llvm-svn: 315102

7 years agollvm-dwarfdump: Add an option to collect debug info quality metrics.
Adrian Prantl [Fri, 6 Oct 2017 20:24:34 +0000 (20:24 +0000)]
llvm-dwarfdump: Add an option to collect debug info quality metrics.

At the last LLVM dev meeting we had a debug info for optimized code
BoF session. In that session I presented some graphs that showed how
the quality of the debug info produced by LLVM changed over the last
couple of years. This is a cleaned up version of the patch I used to
collect the this data. It is implemented as an extension of
llvm-dwarfdump, adding a new --statistics option. The intended
use-case is to automatically run this on the debug info produced by,
e.g., our bots, to identify eyebrow-raising changes or regressions
introduced by new transformations that we could act on.

In the current form, two kinds of data are being collected:

- The number of variables that have a debug location versus the number
  of variables in total (this takes into account inlined instances of
  the same function, so if a variable is completely missing form only
  one instance it will be found).

- The PC range covered by variable location descriptions versus the PC
  range of all variables' containing lexical scopes.

The output format is versioned and extensible, so I'm looking forward
to both bug fixes and ideas for other data that would be interesting
to track.

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

llvm-svn: 315101

7 years agoRevert r314616: Run writeTo() concurrently.
Rui Ueyama [Fri, 6 Oct 2017 20:12:43 +0000 (20:12 +0000)]
Revert r314616: Run writeTo() concurrently.

This reverts commit r314616 because nested parallel-for loops can hang.
Our ThreadPoolExecutor is not necessarily able to handle nested calls.

llvm-svn: 315098

7 years agoRefine our --wrap implementation.
Rafael Espindola [Fri, 6 Oct 2017 20:09:34 +0000 (20:09 +0000)]
Refine our --wrap implementation.

Before this patch we would copy foo into real_foo and wrap_foo into
foo. The net result is that __wrap_foo shows up twice in the symbol
table.

With this patch we:

* save a copy of __real_foo before copying foo.
* drop one of the __wrap_foo from the symbol table.
* if __real_foo was not undefined, add a *new* symbol with that content to
  the symbol table.

The net result is that

Anything using foo now uses __wrap_foo
Anything using __real_foo now uses foo.
Anything using __wrap_foo still does.

And the symbol table has foo, __wrap_foo and __real_foo (if defined).

Which I think is the desired behavior.

llvm-svn: 315097

7 years agoInline a small function. NFC.
Rui Ueyama [Fri, 6 Oct 2017 20:08:51 +0000 (20:08 +0000)]
Inline a small function. NFC.

llvm-svn: 315096

7 years agoRevert r315087
Alex Lorenz [Fri, 6 Oct 2017 19:49:29 +0000 (19:49 +0000)]
Revert r315087

clang-refactor crashes on some bots after this commit

llvm-svn: 315095

7 years agoOpenCL: Assume functions are convergent
Matt Arsenault [Fri, 6 Oct 2017 19:34:40 +0000 (19:34 +0000)]
OpenCL: Assume functions are convergent

This was done for CUDA functions in r261779, and for the same
reason this also needs to be done for OpenCL. An arbitrary
function could have a barrier() call in it, which in turn
requires the calling function to be convergent.

llvm-svn: 315094

7 years ago[ObjC] Don't warn on readwrite properties with custom setters that
Alex Lorenz [Fri, 6 Oct 2017 19:24:26 +0000 (19:24 +0000)]
[ObjC] Don't warn on readwrite properties with custom setters that
override readonly properties from protocols

rdar://34192541

llvm-svn: 315093

7 years ago[GlobalISel] Fix legalizer trying to process a deleted instruction.
Amara Emerson [Fri, 6 Oct 2017 19:24:15 +0000 (19:24 +0000)]
[GlobalISel] Fix legalizer trying to process a deleted instruction.

In some cases an instruction is deleted from the block during combining,
however it can still exist in the legalizer worklist.

This change modifies the combiner routines to add the given MI to the
dead instruction list rather than trying to remove it from the block
themselves. The responsibility is then on the caller to delete the instruction
from the block and any worklists.

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

llvm-svn: 315092

7 years agoKMP_HW_SUBSET vs KMP_PLACE_THREADS rival envirables fix
Jonathan Peyton [Fri, 6 Oct 2017 19:23:19 +0000 (19:23 +0000)]
KMP_HW_SUBSET vs KMP_PLACE_THREADS rival envirables fix

If both KMP_HW_SUBSET and KMP_PLACE_THREADS are set and KMP_PLACE_THREADS gets
parsed first, then the current environment variable parser rejects both and
neither get used. This patch uses the rivals mechanism that is used for other
environment variable groups (e.g., KMP_STACKSIZE, GOMP_STACKSIZE, OMP_STACKSIZE).
If both are set, then it tells the user that it is ignoring KMP_PLACE_THREADS in
favor of KMP_HW_SUBSET. The message about deprecating KMP_PLACE_THREADS when it
is set is still printed regardless.

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

llvm-svn: 315091

7 years ago[docs] Mention that SjLj works on any OS on the archs where supported by the compiler
Martin Storsjo [Fri, 6 Oct 2017 19:14:07 +0000 (19:14 +0000)]
[docs] Mention that SjLj works on any OS on the archs where supported by the compiler

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

llvm-svn: 315090

7 years ago[PEI] Remove required properties and use 'if' instead of std::function
Reid Kleckner [Fri, 6 Oct 2017 18:21:19 +0000 (18:21 +0000)]
[PEI] Remove required properties and use 'if' instead of std::function

Summary:
After r303360, we initialize UsesCalleeSaves in runOnMachineFunction,
which runs after getRequiredProperties. UsesCalleeSaves was initialized
to 'false', so getRequiredProperties would always return an empty set.
We don't have a TargetMachine available early anymore after r303360.
Just removing the requirement of NoVRegs seems to make things work, so
let's do that.

Reviewers: thegameg, dschuff, MatzeB

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 315089

7 years agoRevert "[dsymutil] Emit valid debug locations when no symbol flags are set"
Francis Ricci [Fri, 6 Oct 2017 18:19:52 +0000 (18:19 +0000)]
Revert "[dsymutil] Emit valid debug locations when no symbol flags are set"

This reverts commit r315082, which fails on non-darwin buildbots.

llvm-svn: 315088

7 years ago[refactor] add support for refactoring options
Alex Lorenz [Fri, 6 Oct 2017 18:12:29 +0000 (18:12 +0000)]
[refactor] add support for refactoring options

This commit adds initial support for refactoring options. One can now use
optional and required std::string options.

This commit also adds a NewNameOption for the local-rename refactoring action to
allow rename to work with custom names.

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

llvm-svn: 315087

7 years agoBitcode: add an auto-upgrade for LTO section name
Saleem Abdulrasool [Fri, 6 Oct 2017 18:06:59 +0000 (18:06 +0000)]
Bitcode: add an auto-upgrade for LTO section name

The bitcode reader looks specifically for `__DATA, __objc_catlist` as a
section name.  However, SVN r304661 removed the spaces (the two names
are functionally equivalent but do not compare equally
lexicographically).  This causes compatibility issues.  Add an
auto-upgrade path for removing the spaces as well as use the new name in
the LTO plugin.

llvm-svn: 315086

7 years ago[lit] Improve tool substitution in lit.
Zachary Turner [Fri, 6 Oct 2017 17:54:46 +0000 (17:54 +0000)]
[lit] Improve tool substitution in lit.

This addresses two sources of inconsistency in test configuration
files.

1. Substitution boundaries.  Previously you would specify a
   substitution, such as 'lli', and then additionally a set
   of characters that should fail to match before and after
   the tool.  This was used, for example, so that matches that
   are parts of full paths would not be replaced.  But not all
   tools did this, and those that did would often re-invent
   the set of characters themselves, leading to inconsistency.
   Now, every tool substitution defaults to using a sane set
   of reasonable defaults and you have to explicitly opt out
   of it.  This actually fixed a few latent bugs that were
   never being surfaced, but only on accident.

2. There was no standard way for the system to decide how to
   locate a tool.  Sometimes you have an explicit path, sometimes
   we would search for it and build up a path ourselves, and
   sometimes we would build up a full command line.  Furthermore,
   there was no standardized way to handle missing tools.  Do we
   warn, fail, ignore, etc?  All of this is now encapsulated in
   the ToolSubst class.  You either specify an exact command to
   run, or an instance of FindTool('<tool-name>') and everything
   else just works.  Furthermore, you can specify an action to
   take if the tool cannot be resolved.

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

llvm-svn: 315085

7 years agoRun pyformat on lit code.
Zachary Turner [Fri, 6 Oct 2017 17:54:27 +0000 (17:54 +0000)]
Run pyformat on lit code.

llvm-svn: 315084

7 years ago[ARM] GlobalISel: Make tests less strict
Diana Picus [Fri, 6 Oct 2017 17:47:27 +0000 (17:47 +0000)]
[ARM] GlobalISel: Make tests less strict

These are intended as integration tests, so they shouldn't be too
specific about what they're checking.

llvm-svn: 315083

7 years ago[dsymutil] Emit valid debug locations when no symbol flags are set
Francis Ricci [Fri, 6 Oct 2017 17:43:37 +0000 (17:43 +0000)]
[dsymutil] Emit valid debug locations when no symbol flags are set

Summary:
swiftc emits symbols without flags set, which led dsymutil to ignore
them when searching for global symbols, causing dwarf location data
to be omitted. Xcode's dsymutil handles this case correctly, and emits
valid location data. Add this functionality to llvm-dsymutil by
allowing parsing of symbols with no flags set.

Reviewers: aprantl, friss, JDevlieghere

Subscribers: llvm-commits

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

llvm-svn: 315082

7 years ago[AMDGPU] New 64 bit div/rem expansion
Stanislav Mekhanoshin [Fri, 6 Oct 2017 17:24:45 +0000 (17:24 +0000)]
[AMDGPU] New 64 bit div/rem expansion

Old expansion was 20 VGPRs, 78 SGPRs and ~380 instructions.
This expansion is 11 VGPRs, 12 SGPRs and ~120 instructions.

Passes OpenCL conformance test_integer_ops quick_[u]long_math

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

llvm-svn: 315081

7 years ago[MC] Use unique_ptr to manage WinFrameInfos, NFC
Reid Kleckner [Fri, 6 Oct 2017 17:21:49 +0000 (17:21 +0000)]
[MC] Use unique_ptr to manage WinFrameInfos, NFC

The FrameInfo cannot be stored directly in the vector because chained
frames may refer to parent frames, so we need pointers that are stable
across a vector resize.

llvm-svn: 315080

7 years agoSupport: Rewrite Windows implementation of sys::fs::rename to be more POSIXy.
Peter Collingbourne [Fri, 6 Oct 2017 17:14:36 +0000 (17:14 +0000)]
Support: Rewrite Windows implementation of sys::fs::rename to be more POSIXy.

The current implementation of rename uses ReplaceFile if the
destination file already exists. According to the documentation for
ReplaceFile, the source file is opened without a sharing mode. This
means that there is a short interval of time between when ReplaceFile
renames the file and when it closes the file during which the
destination file cannot be opened.

This behaviour is not POSIX compliant because rename is supposed
to be atomic. It was also causing intermittent link failures when
linking with a ThinLTO cache; the ThinLTO cache implementation expects
all cache files to be openable.

This patch addresses that problem by re-implementing rename
using CreateFile and SetFileInformationByHandle. It is roughly a
reimplementation of ReplaceFile with a better sharing policy as well
as support for renaming in the case where the destination file does
not exist.

This implementation is still not fully POSIX. Specifically in the case
where the destination file is open at the point when rename is called,
there will be a short interval of time during which the destination
file will not exist. It isn't clear whether it is possible to avoid
this using the Windows API.

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

llvm-svn: 315079

7 years agoFor Windows, allow .exe extension in a test.
Paul Robinson [Fri, 6 Oct 2017 17:12:28 +0000 (17:12 +0000)]
For Windows, allow .exe extension in a test.

llvm-svn: 315078

7 years agoDirectly return promoted direct call instead of rely on stripPointerCast.
Dehao Chen [Fri, 6 Oct 2017 17:04:55 +0000 (17:04 +0000)]
Directly return promoted direct call instead of rely on stripPointerCast.

Summary: stripPointerCast is not reliably returning the value that's being type-casted. Instead it may look further at function attributes to further propagate the value. Instead of relying on stripPOintercast, the more reliable solution is to directly use the pointer to the promoted direct call.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 315077

7 years ago[OPENMP] Do not capture local static variables.
Alexey Bataev [Fri, 6 Oct 2017 17:00:28 +0000 (17:00 +0000)]
[OPENMP] Do not capture local static variables.

Previously we may erroneously try to capture locally declared static
variables, which will lead to crash for target-based constructs.
Patch fixes this problem.

llvm-svn: 315076

7 years agoSplit X86::BI__builtin_cpu_init handling into own function[NFC]
Erich Keane [Fri, 6 Oct 2017 16:40:45 +0000 (16:40 +0000)]
Split X86::BI__builtin_cpu_init handling into own function[NFC]

The Cpu Init functionality is required for the target
attribute, so this patch simply splits it out into its own
function, exactly like CpuIs and CpuSupports.

llvm-svn: 315075

7 years ago[OPENMP] Capture references to global variables.
Alexey Bataev [Fri, 6 Oct 2017 16:17:25 +0000 (16:17 +0000)]
[OPENMP] Capture references to global variables.

In C++11 variable to global variables are considered as constant
expressions and these variables are not captured in the outlined
regions. Patch allows capturing of such variables in the OpenMP regions.

llvm-svn: 315074

7 years ago[ELF][MIPS] Check for overflow when writing R_MIPS_CALL16 and R_MIPS_TLS_GOTTPREL
Alexander Richardson [Fri, 6 Oct 2017 16:15:59 +0000 (16:15 +0000)]
[ELF][MIPS] Check for overflow when writing R_MIPS_CALL16 and R_MIPS_TLS_GOTTPREL

Summary:
These are 16 bit relocations and not part of a HI/LO pair so we need to
check that they don't overflow.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: ruiu, llvm-commits, emaste, sdardis

Tags: #lld

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

llvm-svn: 315073

7 years agoGuard xar RAII behind HAVE_LIBXAR
Francis Ricci [Fri, 6 Oct 2017 15:54:20 +0000 (15:54 +0000)]
Guard xar RAII behind HAVE_LIBXAR

llvm-svn: 315072

7 years ago[ARM] GlobalISel: Select shifts
Diana Picus [Fri, 6 Oct 2017 15:39:16 +0000 (15:39 +0000)]
[ARM] GlobalISel: Select shifts

Unfortunately TableGen doesn't handle this yet:
Unable to deduce gMIR opcode to handle Src (which is a leaf).

Just add some temporary hand-written code to generate the proper MOVsr.

llvm-svn: 315071

7 years agoStrip trailing whitespace
Simon Pilgrim [Fri, 6 Oct 2017 15:33:55 +0000 (15:33 +0000)]
Strip trailing whitespace

llvm-svn: 315070

7 years ago[llvm-objdump] Add RAII for xar apis
Francis Ricci [Fri, 6 Oct 2017 15:33:28 +0000 (15:33 +0000)]
[llvm-objdump] Add RAII for xar apis

Summary:
xar_open and xar_iter_new require manual calls to close/free functions
to deallocate resources. This makes it easy to introduce memory leaks,
so add RAII struct wrappers for these resources.

Reviewers: enderby, rafael, compnerd, lhames, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 315069

7 years ago[TableGen] Simplify SubtargetEmitter
Javed Absar [Fri, 6 Oct 2017 15:25:04 +0000 (15:25 +0000)]
[TableGen] Simplify SubtargetEmitter

Remove unnecessary duplicate if-condition.

llvm-svn: 315068

7 years ago[ARM] GlobalISel: Map shift operands to GPRs
Diana Picus [Fri, 6 Oct 2017 14:52:43 +0000 (14:52 +0000)]
[ARM] GlobalISel: Map shift operands to GPRs

llvm-svn: 315067

7 years ago[llvm-dsymutil] Add support for __swift_ast MachO DWARF section
Francis Ricci [Fri, 6 Oct 2017 14:49:20 +0000 (14:49 +0000)]
[llvm-dsymutil] Add support for __swift_ast MachO DWARF section

Summary:
Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging,
and which contains a byte-for-byte dump of the swiftmodule file.
Add this feature to llvm-dsymutil.

Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of
`__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil
(Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the
__swift_ast section).

Reviewers: aprantl, friss

Subscribers: llvm-commits, JDevlieghere

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

llvm-svn: 315066

7 years ago[clangd] Run clang-format on the source code. NFC.
Ilya Biryukov [Fri, 6 Oct 2017 14:39:39 +0000 (14:39 +0000)]
[clangd] Run clang-format on the source code. NFC.

llvm-svn: 315065

7 years ago[ARM] GlobalISel: Mark shifts as legal for s32
Diana Picus [Fri, 6 Oct 2017 14:30:05 +0000 (14:30 +0000)]
[ARM] GlobalISel: Mark shifts as legal for s32

The new legalize combiner introduces shifts all over the place, so we
should support them sooner rather than later.

llvm-svn: 315064

7 years ago[SystemZ] Enable machine scheduler.
Jonas Paulsson [Fri, 6 Oct 2017 13:59:28 +0000 (13:59 +0000)]
[SystemZ]  Enable machine scheduler.

The machine scheduler (before register allocation) is enabled by default for
SystemZ.

The SelectionDAG scheduling preference now becomes source order scheduling
(was regpressure).

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

llvm-svn: 315063

7 years ago[MergeICmp][NFC] Make test tuple-four-int8.ll more readable.
Clement Courbet [Fri, 6 Oct 2017 13:45:16 +0000 (13:45 +0000)]
[MergeICmp][NFC] Make test tuple-four-int8.ll more readable.

llvm-svn: 315062

7 years ago[X86][SSE] Add SKX cpu tests to SSE/AVX scheduling tests (D38443)
Simon Pilgrim [Fri, 6 Oct 2017 13:40:29 +0000 (13:40 +0000)]
[X86][SSE] Add SKX cpu tests to SSE/AVX scheduling tests (D38443)

llvm-svn: 315061

7 years agoRenaming a test to start with the name of the check based on post-commit review feedb...
Aaron Ballman [Fri, 6 Oct 2017 13:27:59 +0000 (13:27 +0000)]
Renaming a test to start with the name of the check based on post-commit review feedback; NFC.

llvm-svn: 315060

7 years agoFixing the command line for a test and switching from tabs to spaces.
Aaron Ballman [Fri, 6 Oct 2017 13:14:28 +0000 (13:14 +0000)]
Fixing the command line for a test and switching from tabs to spaces.

llvm-svn: 315059

7 years agoRevert "[MergeICmps] Disable mergeicmps if the target does not want to handle memcmp...
Clement Courbet [Fri, 6 Oct 2017 13:02:24 +0000 (13:02 +0000)]
Revert "[MergeICmps] Disable mergeicmps if the target does not want to handle memcmp expansion."

Still a few stability issues on windows.

This reverts commit 67e3db9bc121ba244e20337aabc7cf341a62b545.

llvm-svn: 315058

7 years agoFix nested namespaces in google-readability-nested-namespace-comments.
Aaron Ballman [Fri, 6 Oct 2017 12:57:28 +0000 (12:57 +0000)]
Fix nested namespaces in google-readability-nested-namespace-comments.

Fixes PR34701.

Patch by Alexandru Octavian BuČ›iu.

llvm-svn: 315057

7 years agoRe-land "[MergeICmps] Disable mergeicmps if the target does not want to handle memcmp...
Clement Courbet [Fri, 6 Oct 2017 12:12:35 +0000 (12:12 +0000)]
Re-land "[MergeICmps] Disable mergeicmps if the target does not want to handle memcmp expansion."

(fixed unit tests by making comparisons stable)

This reverts commit 1b2d359ce256fd6737da4e93833346a0bd6d7583.

llvm-svn: 315056

7 years ago[clangd] Add textDocument/signatureHelp
Ilya Biryukov [Fri, 6 Oct 2017 11:54:17 +0000 (11:54 +0000)]
[clangd] Add textDocument/signatureHelp

Summary:
Makes clangd respond to a client's "textDocument/signatureHelp" request by
presenting function/method overloads.

Patch by Raoul Wols.

Reviewers: bkramer, ilya-biryukov, krasimir

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 315055

7 years ago[ELF] - Do not produce broken .dynamic section with --no-rosegment
George Rimar [Fri, 6 Oct 2017 10:06:13 +0000 (10:06 +0000)]
[ELF] - Do not produce broken .dynamic section with --no-rosegment

LLD produces broken .dynamic section when --no-rosegment and at least
one of following options is present:
  1) -z rodynamic is given.
  2) MIPS target.

That happens because code that writes .dynamic assumes target buffer
is zero-filled, what can be not true after LLD fills it with trap
instructions. With one of two options above, .dynamic becomes
SHF_ALLOC section, so can be affected.

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

llvm-svn: 315054

7 years ago[ELF] - Do not produce broken .dynsym with --no-rosegment.
George Rimar [Fri, 6 Oct 2017 09:56:24 +0000 (09:56 +0000)]
[ELF] - Do not produce broken .dynsym with --no-rosegment.

We produce broken output currently.
Code that writes .dynsym assumes output buffer is zero-filled,
though that is not always true. When --no-rosegment is given,
buffer can be filled with trap instructions. Patch fixes the issue.

It is relative with PR34705.

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

llvm-svn: 315053

7 years ago[ELF] - Fix BB after r315051.
George Rimar [Fri, 6 Oct 2017 09:46:04 +0000 (09:46 +0000)]
[ELF] - Fix BB after r315051.

Testcase has "zlib" requirement, which is unsupported on
windows, so that it was not run locally for me.

llvm-svn: 315052

7 years ago[ELF] - Do --hash-style=both by default.
George Rimar [Fri, 6 Oct 2017 09:37:44 +0000 (09:37 +0000)]
[ELF] - Do --hash-style=both by default.

Its PR34712,

GNU linkers recently changed default values to "both" of "sysv".
Patch do the same for all targets except MIPS, where .gnu.hash
section is not yet supported.

Code suggested by Rui Ueyama.

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

llvm-svn: 315051

7 years ago[TableGen] : CodeGenInsrtuction modify to range loop. NFC.
Javed Absar [Fri, 6 Oct 2017 09:32:45 +0000 (09:32 +0000)]
[TableGen] : CodeGenInsrtuction modify to range loop. NFC.

llvm-svn: 315050

7 years agoFix one more check string after r315045.
Akira Hatanaka [Fri, 6 Oct 2017 08:19:31 +0000 (08:19 +0000)]
Fix one more check string after r315045.

llvm-svn: 315049

7 years agoRefine generation of TBAA information in clang
Ivan A. Kosarev [Fri, 6 Oct 2017 08:17:48 +0000 (08:17 +0000)]
Refine generation of TBAA information in clang

This patch is an attempt to clarify and simplify generation and
propagation of TBAA information. The idea is to pack all values
that describe a memory access, namely, base type, access type and
offset, into a single structure. This is supposed to make further
changes, such as adding support for unions and array members,
easier to prepare and review.

DecorateInstructionWithTBAA() is no more responsible for
converting types to tags. These implicit conversions not only
complicate reading the code, but also suggest assigning scalar
access tags while we generally prefer full-size struct-path tags.

TBAAPathTag is replaced with TBAAAccessInfo; the latter is now
the type of the keys of the cache map that translates access
descriptors to metadata nodes.

Fixed a bug with writing to a wrong map in
getTBAABaseTypeMetadata() (former getTBAAStructTypeInfo()).

We now check for valid base access types every time we
dereference a field. The original code only checks the top-level
base type. See isValidBaseType() / isTBAAPathStruct() calls.

Some entities have been renamed to sound more adequate and less
confusing/misleading in presence of path-aware TBAA information.

Now we do not lookup twice for the same cache entry in
getAccessTagInfo().

Refined relevant comments and descriptions.

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

llvm-svn: 315048

7 years agoFix one more check string after r315045.
Akira Hatanaka [Fri, 6 Oct 2017 08:05:34 +0000 (08:05 +0000)]
Fix one more check string after r315045.

llvm-svn: 315047

7 years agoFix check strings in test case and use llvm::to_string instead of
Akira Hatanaka [Fri, 6 Oct 2017 07:47:47 +0000 (07:47 +0000)]
Fix check strings in test case and use llvm::to_string instead of
std::to_string.

These changes were needed to fix bots that started failing after
r315045.

llvm-svn: 315046

7 years ago[CodeGen] Emit a helper function for __builtin_os_log_format to reduce
Akira Hatanaka [Fri, 6 Oct 2017 07:12:46 +0000 (07:12 +0000)]
[CodeGen] Emit a helper function for __builtin_os_log_format to reduce
code size.

Currently clang expands a call to __builtin_os_log_format into a long
sequence of instructions at the call site, causing code size to
increase in some cases.

This commit attempts to reduce code size by emitting a helper function
that can be shared by calls to __builtin_os_log_format with similar
formats and arguments. The helper function has linkonce_odr linkage to
enable the linker to merge identical functions across translation units.
Attribute 'noinline' is attached to the helper function at -Oz so that
the inliner doesn't inline functions that can potentially be merged.

This commit also fixes a bug where the generated IR writes past the end
of the buffer when "%m" is the last specifier appearing in the format
string passed to __builtin_os_log_format.

Original patch by Duncan Exon Smith.

rdar://problem/34065973
rdar://problem/34196543

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

llvm-svn: 315045

7 years agoRoll forward r314928
Xinliang David Li [Fri, 6 Oct 2017 05:15:25 +0000 (05:15 +0000)]
Roll forward r314928

Fixed ThinLTO bootstrap failure : track new
bitcast per incomingVal. Added new tests.

llvm-svn: 315044

7 years ago[PM] Retire disable unit-at-a-time switch.
Davide Italiano [Fri, 6 Oct 2017 04:39:40 +0000 (04:39 +0000)]
[PM] Retire disable unit-at-a-time switch.

This is a vestige from the GCC-3 days, which disables IPO passes
when set. I don't think anybody actually uses it as there are
several IPO passes which still run with this flag set and
nobody complained/noticed. This reduces the delta between
current and new pass manager and allows us to easily review
the difference when we decide to flip the switch (or audit
which passes should run, FWIW).

llvm-svn: 315043

7 years agoFix typo.
Rui Ueyama [Fri, 6 Oct 2017 04:32:08 +0000 (04:32 +0000)]
Fix typo.

llvm-svn: 315042

7 years ago[CodeExtractor] Fix multiple bugs under certain shape of extracted region
Jakub Kuderski [Fri, 6 Oct 2017 03:37:06 +0000 (03:37 +0000)]
[CodeExtractor] Fix multiple bugs under certain shape of extracted region

Summary:
If the extracted region has multiple exported data flows toward the same BB which is not included in the region, correct resotre instructions and PHI nodes won't be generated inside the exitStub. The solution is simply put the restore instructions right after the definition of output values instead of putting in exitStub.
Unittest for this bug is included.

Author: myhsu

Reviewers: chandlerc, davide, lattner, silvas, davidxl, wmi, kuhar

Subscribers: dberlin, kuhar, mgorny, llvm-commits

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

llvm-svn: 315041

7 years agoNewGVN: Factor out duplicate parts of OpIsSafeForPHIOfOps
Daniel Berlin [Fri, 6 Oct 2017 01:33:06 +0000 (01:33 +0000)]
NewGVN: Factor out duplicate parts of OpIsSafeForPHIOfOps

llvm-svn: 315040

7 years ago[asan] Use gold linker in android tests.
Evgeniy Stepanov [Fri, 6 Oct 2017 00:00:53 +0000 (00:00 +0000)]
[asan] Use gold linker in android tests.

Replace a partial workaround for ld.bfd strangeness with the ultimate one: -fuse-ld=gold.
Reason: ld.bfd problem gets worse with libc++-based NDK toolchain.

llvm-svn: 315039

7 years ago[ELF] Add missing REQUIRES: mips to the test added in r315035
Alexander Richardson [Thu, 5 Oct 2017 23:48:29 +0000 (23:48 +0000)]
[ELF] Add missing REQUIRES: mips to the test added in r315035

llvm-svn: 315038

7 years agoImplement interactive command interruption
Leonard Mosescu [Thu, 5 Oct 2017 23:41:28 +0000 (23:41 +0000)]
Implement interactive command interruption

The core of this change is the new CommandInterpreter::m_command_state,
which models the state transitions for interactive commands, including
an "interrupted" state transition.

In general, command interruption requires cooperation from the code
executing the command, which needs to poll for interruption requests
through CommandInterpreter::WasInterrupted().

CommandInterpreter::PrintCommandOutput() implements an optionally
interruptible printing of the command output, which for large outputs
was likely the longest blocking part.
(ex. target modules dump symtab on a complex binary could take 10+ minutes)

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

llvm-svn: 315037

7 years ago[ELF] Don't crash when parsing a file with out-of-bounds version references
Alexander Richardson [Thu, 5 Oct 2017 23:28:34 +0000 (23:28 +0000)]
[ELF] Don't crash when parsing a file with out-of-bounds version references

Summary:
We were crashing when linking telnetd in FreeBSD because lld was emitting
corrupted output files for --norosegment. In this file the version index of some symbols
was set to 9 but lld only found 8 version definitions.

I am not sure how to create a minimal .so file that also exposes this behaviour so I just added the one that initially caused the error to Inputs/

This partially addresses https://bugs.llvm.org/show_bug.cgi?id=34705

Reviewers: ruiu, rafael, pcc, grimar

Reviewed By: ruiu

Subscribers: emaste, krytarowski

Tags: #lld

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

llvm-svn: 315036