Commit Graph

251326 Commits

Author SHA1 Message Date
Rui Ueyama b4c63caf76 Rename lld::stringize -> lld::toString.
llvm-svn: 291223
2017-01-06 10:04:35 +00:00
Rui Ueyama ce039266c1 Merge elf::toString and coff::toString.
The two overloaded functions hid each other. This patch merges them.

llvm-svn: 291222
2017-01-06 10:04:08 +00:00
Rui Ueyama dac6169214 Remove lld::convertToUnixPathSeparator.
Now TarWriter takes care of path separator conversion, so we don't
need to handle that in LLD.

llvm-svn: 291221
2017-01-06 09:38:43 +00:00
Pavel Labath 927ec4b5ac Consolidate file handle usage in Editline.cpp
Summary:
To implement wide character reading, editline was mixing FILE*-based access with
a Connection-based one (plus it did some selects on the raw FD), which is very
fragile. Here, I replace it with one which uses only a Connection-based reads.
The code is somewhat longer as I had to read characters one by one to detect the
end of the multibyte sequence.

I've verified that international characters still work in lldb command line on
OSX.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 291220
2017-01-06 09:27:38 +00:00
Rui Ueyama 214a897681 Use \ as the path separator on Windows.
Previously, when we printed out a path obtained from DWARF debug info,
we replaced \ with / on Windows. But that doesn't make sense. We should
respect the system's path separator.

llvm-svn: 291219
2017-01-06 08:59:32 +00:00
Michal Gorny 1099e017f6 [llvm-config] Add --cmakedir to obtain CMake module location
Add a --cmakedir option to llvm-config that returns the correct path to
built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly
intended as a convenience option for stand-alone builds of other LLVM
projects that frequently reconstruct LLVM_CMAKE_PATH after querying
llvm-config.

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

llvm-svn: 291218
2017-01-06 08:23:33 +00:00
Michal Gorny c74123bdff [cmake] Disable appending -msse4.2 flag implicitly
Disable the code appending -msse4.2 flag implicitly when the compiler
supports it. The compiler support for this flags do not indicate that
the underlying CPU will support SSE4.2, and passing it may result in
SSE4.2 code being emitted *implicitly*.

If the target platform supports SSE4.2 appropriately, the relevant bits
should be already enabled via -march= or equivalent. In this case
passing -msse4.2 is redundant.

If a runtime detection is desired (which seems to be a case with SCUDO),
then (as gcc manpage points out) the specific SSE4.2 needs to be
isolated into a separate file, the -msse4.2 flag can be forced only
for that file and the function defined in that file can only be called
when the CPU is determined to support SSE4.2.

This fixes SIGILL on SCUDO when it is compiled using gcc-5.4.

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

llvm-svn: 291217
2017-01-06 08:21:02 +00:00
Lang Hames 702b3e494f [Orc][RPC] Fix an obvious locking-order bug in RawByteChannel::startSendMessage.
The lock needs to be acquired before the data is sent, not afterwards. This
think-o slipped in during the refactor in r286620, but went unnoticed as the
resulting bug only manifests in multi-threaded clients (of which there are none
in-tree).

No unit test as the bug depends on thread scheduling.

llvm-svn: 291216
2017-01-06 06:22:31 +00:00
Rui Ueyama f2a6275116 TarWriter: Emit PAX headers only when needed.
We use PAX headers to store long filenames (>= 100 bytes).
It is not needed to emit PAX headers if filenames fit in the
Ustar header. This patch implements that optimization.

llvm-svn: 291215
2017-01-06 05:33:45 +00:00
Craig Topper e86fb932ea [AVX-512] Add EXTRACT_SUBVECTOR support to combineBitcastForMaskedOp.
llvm-svn: 291214
2017-01-06 05:18:48 +00:00
Craig Topper 8cbac879db [AVX-512] Add more masked vector extract test cases with and without a bitcast between the select.
The ones with the bitcast need additional work to fold the mask operation properly. This will be fixed in a future commit.

llvm-svn: 291213
2017-01-06 05:18:44 +00:00
Rui Ueyama 0b3b813172 Attempt to unbreak buildbots.
llvm-svn: 291212
2017-01-06 02:54:38 +00:00
David Majnemer 9e04befb09 [SelectionDAG] Rework lowerRangeToAssertZExt
Utilize ConstantRange to make it easier to interpret range metadata.

llvm-svn: 291211
2017-01-06 02:43:28 +00:00
Rui Ueyama 7f1f912794 Use TarWriter to create tar archives instead of cpio.
This is how we use TarWriter in LLD. Now LLD does not append
a file extension, so you need to pass `--reproduce foo.tar`
instead of `--reproduce foo`.

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

llvm-svn: 291210
2017-01-06 02:33:53 +00:00
Rui Ueyama 4bb7883f0c Add a class to create a tar archive file.
In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

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

llvm-svn: 291209
2017-01-06 02:29:48 +00:00
Saleem Abdulrasool 3f4ab5c0c6 CodeGen: address post commit review comments for r291123
This test would force the execution of the backend.  However, the
backend already has a test for this.  Effectively, this was trying to
test that an API call was made properly.  We do not have a good way to
really test this.  The test itself tested very little.

Addresses post-commit review comments from Eric Christopher.

llvm-svn: 291208
2017-01-06 02:27:40 +00:00
Bob Wilson 37df90a474 Revert "Use _Unwind_Backtrace on Apple platforms."
This reverts commit 63165f6ae3bac1623be36d4b3ce63afa1d51a30a.

After making this change, I discovered that _Unwind_Backtrace is
unable to unwind past a signal handler after an assertion failure.
I filed a bug report about that issue in rdar://29866587 but even if
we get a fix soon, it will be awhile before it get released.

llvm-svn: 291207
2017-01-06 02:26:33 +00:00
Bob Wilson d39ead4105 Disable sigaltstack on Apple platforms
Using sigaltstack on Apple platforms is a bad idea. Darwin's backtrace()
function does not work with sigaltstack, and my change in r286851 was
supposed to solve that by using _Unwind_Backtrace instead. I tested that
_Unwind_Backtrace works for crashes but then discovered that it does not
work for assertion failures when using sigaltstack, at least on macOS.
The stack trace shows only the frames on the alternate stack.
I also saw some reports of this happening for crashes, but it fails
consistently for assertion failures. I tried various things to get it to
work but the problem seems to be in _Unwind_Backtrace itself. Disabling
sigaltstack is unfortunate since it would be nice to get backtraces for
stack overflows, but at least this gets us backtraces for the more common
cases. rdar://problem/29662459

llvm-svn: 291206
2017-01-06 02:26:30 +00:00
Peter Collingbourne 81271b7bd2 LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

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

llvm-svn: 291205
2017-01-06 02:22:47 +00:00
David Blaikie a77ec68e50 Revert part of cleanup to fix a build break
Wasn't sure I could include ErrorHandling.h here, and evidently I wasn't
building this part (must've made the change using sed after getting
tired of fixing each compilation error individually).

llvm-svn: 291204
2017-01-06 01:42:56 +00:00
David Blaikie 201f0f5502 Fixes for Clang API change
llvm-svn: 291203
2017-01-06 01:09:06 +00:00
David Blaikie 9c28cb3f65 shared_ptrify (from InclusiveRefCntPtr) HeaderSearchOptions
llvm-svn: 291202
2017-01-06 01:04:46 +00:00
David Blaikie 1e58b463d9 Remove unused private fields to fix the clang -Werror build.
llvm-svn: 291201
2017-01-06 00:48:24 +00:00
David Blaikie e9c678cfca Fixes for Clang API changes to use std::shared_ptr
llvm-svn: 291200
2017-01-06 00:38:12 +00:00
David Blaikie 73902cc0ac Fix -Wunused-function warning by preprocessor conditionalizing the function the same way as the caller
llvm-svn: 291199
2017-01-06 00:38:10 +00:00
David Blaikie a322f36cfd Make lldb -Werror clean for -Wstring-conversion
Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.

llvm-svn: 291198
2017-01-06 00:38:06 +00:00
Eugene Zelenko 049b017538 [AArch64, Lanai] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 291197
2017-01-06 00:30:53 +00:00
David Majnemer eaba06cffa [SelectionDAG] Correctly transform range metadata to AssertZExt
We used the logBase2 of the high instead of the ceilLogBase2 resulting
in the wrong result for certain values.  For example, it resulted in an
i1 AssertZExt when the exclusive portion of the range was 3.

llvm-svn: 291196
2017-01-06 00:11:46 +00:00
Kostya Serebryany 61f5473bad [libFuzzer] remove dead code, NFC
llvm-svn: 291195
2017-01-06 00:09:40 +00:00
Greg Clayton 93e4fe8aad Add iterator support to DWARFDie to allow child DIE iteration.
Differential Revision: https://reviews.llvm.org/D28303

llvm-svn: 291194
2017-01-05 23:47:37 +00:00
Logan Chien ce542eefe3 Code cleanup: Remove tab indents.
llvm-svn: 291193
2017-01-05 23:41:33 +00:00
Saleem Abdulrasool caabc1be3b config_elast: fix typo (NFC)
Missed the original typo which was duplicated.  NFC.

llvm-svn: 291192
2017-01-05 23:25:44 +00:00
Richard Smith c8a32e5ed2 Fix bug where types other than 'cv auto', 'cv auto &', and 'cv auto &&' could
incorrectly be deduced from an initializer list in pathological cases.

llvm-svn: 291191
2017-01-05 23:12:16 +00:00
Richard Smith c92d206ce4 Add missing "original call argument has same type as deduced parameter type"
check for deductions from elements of a braced-init-list.

llvm-svn: 291190
2017-01-05 23:02:44 +00:00
Tim Shen 1594e0629d [APFloatTest] Add tests for various operations
Differential Revision: https://reviews.llvm.org/D27833

llvm-svn: 291189
2017-01-05 22:57:54 +00:00
Sean Fertile 222626564d Remove the ppc insertword/extractword expected fail tests.
llvm-svn: 291188
2017-01-05 22:54:34 +00:00
Simon Pilgrim aa186c632d [CostModel][X86] Tidyup arithmetic costs code. NFCI.
Remove unnecessary braces, remove one use variables and keep LUTs to similar naming convention.

llvm-svn: 291187
2017-01-05 22:48:02 +00:00
David Blaikie d02498c6ad Fix for shared_ptrification in Clang
llvm-svn: 291186
2017-01-05 22:44:07 +00:00
David Blaikie bbe146f226 Fix examples for recent shared_ptrification
llvm-svn: 291185
2017-01-05 22:36:44 +00:00
David Blaikie 9280a857bc IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer
llvm-svn: 291184
2017-01-05 22:19:11 +00:00
Evgeniy Stepanov 04cfed9af5 Improved ASAN allocator and quarantine stats.
Summary: Improved ASAN allocator and quarantine stats.

Reviewers: eugenis

Patch by Alex Shlyapnikov.

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 291183
2017-01-05 22:17:53 +00:00
Kostya Serebryany 4aa0590e33 [libFuzzer] improve error handling during the merge (handle various IO failures)
llvm-svn: 291182
2017-01-05 22:05:47 +00:00
Geoff Berry d46b6e8096 [AArch64] Fold some filled/spilled subreg COPYs
Summary:
Extend AArch64 foldMemoryOperandImpl() to handle folding spills of
subreg COPYs with read-undef defs like:

  %vreg0:sub_32<def,read-undef> = COPY %WZR; GPR64:%vreg0

by widening the spilled physical source reg and generating:

  STRXui %XZR <fi#0>

as well as folding fills of similar COPYs like:

  %vreg0:sub_32<def,read-undef> = COPY %vreg1; GPR64:%vreg0, GPR32:%vreg1

by generating:

  %vreg0:sub_32<def,read-undef> = LDRWui <fi#0>

Reviewers: MatzeB, qcolombet

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 291180
2017-01-05 21:51:42 +00:00
Sean Fertile 96d9e0ec05 Add vec_insert4b and vec_extract4b functions to altivec.h
Add builtins for the functions and custom codegen mapping the builtins to their
corresponding intrinsics and handling the endian related swapping.

https://reviews.llvm.org/D26546

llvm-svn: 291179
2017-01-05 21:43:30 +00:00
Xin Tong 8b8a600d92 Fix typo. NFC
llvm-svn: 291178
2017-01-05 21:40:08 +00:00
Teresa Johnson 6c475a7595 ThinLTO: add early "dead-stripping" on the Index
Summary:
Using the linker-supplied list of "preserved" symbols, we can compute
the list of "dead" symbols, i.e. the one that are not reachable from
a "preserved" symbol transitively on the reference graph.
Right now we are using this information to mark these functions as
non-eligible for import.

The impact is two folds:
- Reduction of compile time: we don't import these functions anywhere
  or import the function these symbols are calling.
- The limited number of import/export leads to better internalization.

Patch originally by Mehdi Amini.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

llvm-svn: 291177
2017-01-05 21:34:18 +00:00
Vitaly Buka 8f05c786c9 [compiler-rt] Set valid PC calling __asan_report_error SetErrorReportCallbackTest
Reviewers: eugenis

Subscribers: kubabrecka, dberris, llvm-commits

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

llvm-svn: 291176
2017-01-05 21:25:21 +00:00
Vitaly Buka e40277987f [compiler-rt] Make macros use __sanitizer::uptr instead of just uptr.
Summary: This allows to use macros outside of __sanitizer namespace

Reviewers: eugenis

Subscribers: kubabrecka, dberris, llvm-commits

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

llvm-svn: 291175
2017-01-05 21:25:20 +00:00
Saleem Abdulrasool 9075622d58 typeinfo: style adjustments for adding MS ABI RTTI
This is motivated by adding a third RTTI scheme to libc++.  Split out
the two forms of the itanium RTTI representation.  This is based on
suggestions from Eric Fiselier.  NFC

llvm-svn: 291174
2017-01-05 21:22:22 +00:00
Vitaly Buka 006aaaf59c [asan] Fix comparison in BufferedStackTrace::LocatePcInTrace
Summary:
Debug builds can have larger distance between stack trace and PC on that stack.
If we assume that PC is always correct we can snap it to the nearest trace.

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 291173
2017-01-05 21:04:47 +00:00