Commit Graph

197127 Commits

Author SHA1 Message Date
Robert Flack a5bcb2ed8a Add/fix FreeBSD/arm64 files in xcode build from r233273.
llvm-svn: 233317
2015-03-26 21:02:03 +00:00
Rui Ueyama d97b9d8999 Remove duplicate code and empty classes.
llvm-svn: 233316
2015-03-26 21:01:13 +00:00
Zachary Turner e6d213a84a Fix a race condition in Target::Launch
When no hijack listener is set up, the global event listener will
try to pull events off the queue, racing with the event thread.
By always forcing a hijack listener, even when one was not given,
we guarantee that the listener always gets all events.

This was causing problems in synchronous mode with the process
stop event sometimes never being picked up and causing the debugger
to hang while processing a .lldbinit file.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D8562

llvm-svn: 233315
2015-03-26 20:41:14 +00:00
Bill Schmidt 3303eff774 [PowerPC] Remove assembly testing from test/CodeGen/ppc64-elf-abi.c
Eric Christopher pointed out that we have a check for assembly code
generation in a clang test, which isn't cool.  We already have Driver
and back-end CodeGen tests for the .abiversion handling, so this
testing is unnecessary anyway.  Make it go away.

llvm-svn: 233314
2015-03-26 20:16:52 +00:00
Rui Ueyama 24f2d2a9d5 Remove Makefiles.
Most developers prefer to not have them, and we agreed to
remove them from LLD.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html

llvm-svn: 233313
2015-03-26 20:09:47 +00:00
Yaron Keren 39fc5a6fd7 Fix rare case where APInt divide algorithm applied un-needed transformation.
APInt uses Knuth's D algorithm for long division. In rare cases the
implementation applied a transformation that was not needed.

Added unit tests for long division. KnuthDiv() procedure is fully covered.
There is a case in APInt::divide() that I believe is never used (marked with
a comment) as all users of divide() handle trivial cases earlier.

Patch by Pawel Bylica!

  http://reviews.llvm.org/D8448

llvm-svn: 233312
2015-03-26 19:45:19 +00:00
Robert Flack efa49c2665 Change expectedFailureOS and skipIfPlatform checks to be based on target platform when running test suite remotely.
Most expected OS failures or skipped tests are about the target platform on
which the test binary is being run, not the host platform launching the tests.
This changes expectedFailureOS and skipIfPlatform to check against the remote
platform when running remote tests.

Test Plan:
Run ./do_sep.py test suite against a remote target on a different platform and
verify that tests which should be excluded on the remote platform are excluded.

Differential Revision: http://reviews.llvm.org/D8611

llvm-svn: 233311
2015-03-26 19:34:26 +00:00
Sanjoy Das 8ce6499bdd [ADT][CMake][AutoConf] Fail-fast iterators for DenseMap
Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Enabling fail-fast iterators breaks the LLVM C++ ABI, so they are
predicated on `LLVM_ENABLE_ABI_BREAKING_CHECKS`.
`LLVM_ENABLE_ABI_BREAKING_CHECKS` by default flips with
`LLVM_ENABLE_ASSERTS`, but can be clamped to ON or OFF using the CMake /
autoconf build system.

Reviewers: chandlerc, dexonsmith, rnk, zturner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8351

llvm-svn: 233310
2015-03-26 19:25:01 +00:00
Justin Bogner 54dd7df1c0 [ARM] Fix some non-portable shell syntax in r233301's tests
The "|&" operator isn't POSIX, so it can fail depending on the host's
default shell. Avoid it.

There were also a couple of places that did "2>1", but this creates a
file called "1". They clearly meant "2>&1".

llvm-svn: 233309
2015-03-26 19:24:13 +00:00
Zachary Turner 072964dc0d Fix the remaining two test failures caused by re-ordering of teardown.
Previously we were using teardown hooks in these two instances to
shutdown processes.  TestBase already deletes all targets in its
own teardown, which will kill processes, so these steps weren't
necessary.

llvm-svn: 233308
2015-03-26 18:59:56 +00:00
Paul Robinson d8587b8ba6 Ignore compile_commands.json only at the root of the tree.
Can avoid a problem if tools/clang/tools/extra is in the tree.

Patch by Douglas Yung!

llvm-svn: 233307
2015-03-26 18:55:42 +00:00
Zachary Turner 9581204ceb Fix test failures caused by order of initialization.
tear down hooks run as part of Base.tearDown().  Some of these
hooks rely on accessing the debugger instance.  So although it
looks awkward, we need to call "del self.dbg" after calling
Base.tearDown().

llvm-svn: 233306
2015-03-26 18:54:21 +00:00
Andrew Kaylor f8fea09542 Supress MSVC padding warning in alignment test
llvm-svn: 233305
2015-03-26 18:48:42 +00:00
Daniel Jasper 05cd92922d clang-format: Force line break in trailing calls after multline exprs.
Before:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb).a();

After:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb)
      .a();

llvm-svn: 233304
2015-03-26 18:46:28 +00:00
Renato Golin 4c8713969c Adds an option to disable ARM ld/st optim pass
Enabled by default, but it's useful when debugging with llc.

Patch by Ranjeet Singh.

llvm-svn: 233303
2015-03-26 18:38:04 +00:00
Duncan P. N. Exon Smith c947892d10 Reapply "Linker: Drop function pointers for overridden subprograms"
This reverts commit r233254, effectively reapplying r233164 (and its
successors), with an additional testcase for when subprograms match
exactly.  This fixes PR22792 (again).

I'm using the same approach, but I've moved up the call to
`stripReplacedSubprograms()`.  The function pointers need to be dropped
before mapping any metadata from the source module, or else this can
drop the function from new subprograms that have merged (via Metadata
uniquing) with the old ones.  Dropping the pointers first prevents them
from merging.

**** The original commit message follows. ****

Linker: Drop function pointers for overridden subprograms

Instead of dropping subprograms that have been overridden, just set
their function pointers to `nullptr`.  This is a minor adjustment to the
stop-gap fix for PR21910 committed in r224487, and fixes the crasher
from PR22792.

The problem that r224487 put a band-aid on: how do we find the canonical
subprogram for a `Function`?  Since the backend currently relies on
`DebugInfoFinder` (which does a naive in-order traversal of compile
units and picks the first subprogram) for this, r224487 tried dropping
non-canonical subprograms.

Dropping subprograms fails because the backend *also* builds up a map
from subprogram to compile unit (`DwarfDebug::SPMap`) based on the
subprogram lists.  A missing subprogram causes segfaults later when an
inlined reference (such as in this testcase) is created.

Instead, just drop the `Function` pointer to `nullptr`, which nicely
mirrors what happens when an already-inlined `Function` is optimized
out.  We can't really be sure that it's the same definition anyway, as
the testcase demonstrates.

This still isn't completely satisfactory.  Two flaws at least that I can
think of:

  - I still haven't found a straightforward way to make this symmetric
    in the IR.  (Interestingly, the DWARF output is already symmetric,
    and I've tested for that to be sure we don't regress.)
  - Using `DebugInfoFinder` to find the canonical subprogram for a
    function is kind of crazy.  We should just attach metadata to the
    function, like this:

        define weak i32 @foo(i32, i32) !dbg !MDSubprogram(...) {

llvm-svn: 233302
2015-03-26 18:35:30 +00:00
Vladimir Sukharev 4b18c727a2 [ARM] Add v8.1a "Rounding Double Multiply Add/Subtract" extension
Reviewers: t.p.northover

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8503

llvm-svn: 233301
2015-03-26 18:29:02 +00:00
Vladimir Sukharev edc71abedd [AArch64] Rename Pairs to Mappings in AArch64NamedImmMapper
Third element is to be added soon to "struct AArch64NamedImmMapper::Mapping". So its instances are renamed from ...Pairs to ...Mappings

Reviewers: jmolloy

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8582

llvm-svn: 233300
2015-03-26 17:57:39 +00:00
Ed Schouten 6e57615ac8 Enable -ffunction-sections and -fdata-sections for CloudABI by default.
Unlike most of the other platforms supported by Clang, CloudABI only
supports static linkage, for the reason that global filesystem access is
prohibited. Functions provided by dlfcn.h are not present. As we know
that applications will not try to do any symbol lookups at run-time, we
can garbage collect unused code quite aggressively. Because of this, it
makes sense to enable -ffunction-sections and -fdata-sections by
default.

Object files will be a bit larger than usual, but the resulting binary
will not be affected, as the sections are merged again. However, when
--gc-sections is used, the linker is able to remove unused code far more
more aggressively. It also has the advantage that transitive library
dependencies only need to be provided to the linker in case that
functionality is actually used.

Differential Revision:	http://reviews.llvm.org/D8635
Reviewed by:	echristo

llvm-svn: 233299
2015-03-26 17:50:28 +00:00
Stephane Sezer ca05ae2bff Add an assertion for frame[0] being valid in CommandObjectThread.cpp.
Summary:
This should always be true but sometimes is not, during platform bring
up. As recommended by Jim Ingham, an assertion should be enough here to
help.
This addresses post commit comments in http://reviews.llvm.org/D8554.

Test Plan: Run unit tests.

Reviewers: jasonmolenda, emaste, jingham, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8574

llvm-svn: 233298
2015-03-26 17:47:34 +00:00
Vladimir Sukharev 017d10bb76 [AArch64] Move initializations of AArch64NamedImmMapper out of void AArch64Operand::print(...)
class AArch64NamedImmMapper is to become dependent of SubTargetFeatures, while class AArch64Operand don't have access to the latter. 

So, AArch64NamedImmMapper constructor invocations are refactored away from methods of AArch64Operand.

Reviewers: jmolloy

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8579

llvm-svn: 233297
2015-03-26 17:29:53 +00:00
Sanjoy Das 14598830fe [SCEV] Revert bailout added in r75511.
Summary:
With the introduction of MarkPendingLoopPredicates in r157092, I don't
think the bailout is needed anymore.

Reviewers: atrick, nicholas

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8624

llvm-svn: 233296
2015-03-26 17:28:26 +00:00
Alexey Samsonov 0781e98cc7 [UBSan] Explicitly list all supported OS/arch pairs supported by UBSan.
llvm-svn: 233295
2015-03-26 17:26:04 +00:00
Sanjay Patel 5b305d2d66 revert inadvertent change
llvm-svn: 233294
2015-03-26 17:19:24 +00:00
Sanjay Patel 4fa4a886d7 comment cleanup; NFC
llvm-svn: 233293
2015-03-26 17:18:17 +00:00
Benjamin Kramer 3d0031e0b8 Remove outdated README-SSE.txt entries.
llvm-svn: 233292
2015-03-26 17:12:16 +00:00
Benjamin Kramer 7fa8c430f7 InstCombine: fold (A << C) == (B << C) --> ((A^B) & (~0U >> C)) == 0
Anding and comparing with zero can be done in a single instruction on
most archs so this is a bit cheaper.

llvm-svn: 233291
2015-03-26 17:12:06 +00:00
Vladimir Sukharev c632cda8b2 [AArch64, ARM] Add v8.1a architecture and generic cpu
New architecture and cpu added, following http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers: t.p.northover

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8505

llvm-svn: 233290
2015-03-26 17:05:54 +00:00
Sanjay Patel cdf1e2e363 Use SDValue bool checks; NFC intended
llvm-svn: 233289
2015-03-26 16:55:43 +00:00
Sanjay Patel d95dd9e5fb fix indent; NFC
llvm-svn: 233288
2015-03-26 16:55:17 +00:00
Adrian McCarthy c7fd5ff745 Fixing typo in tutorial as test commit.
llvm-svn: 233287
2015-03-26 16:53:34 +00:00
Jingyue Wu 177a81578f [SLSR] handle candidate form &B[i * S]
Summary:
This patch enhances SLSR to handle another candidate form &B[i * S]. If
we found two candidates

S1: X = &B[i * S]
S2: Y = &B[i' * S]

and S1 dominates S2, we can replace S2 with

Y = &X[(i' - i) * S]

Test Plan:
slsr-gep.ll
X86/no-slsr.ll: verify that we do not run SLSR on GEPs that already fit into
an addressing mode

Reviewers: eliben, atrick, meheff, hfinkel

Reviewed By: hfinkel

Subscribers: sanjoy, llvm-commits

Differential Revision: http://reviews.llvm.org/D7459

llvm-svn: 233286
2015-03-26 16:49:24 +00:00
Eric Fiselier 09b80854e8 Add tests for library version of is_convertible
llvm-svn: 233285
2015-03-26 16:45:21 +00:00
Zachary Turner 65fe1eb5f8 Tear down tests in reverse order from setting them up.
Tests derive from TestBase, which derives from Base.  In the
test setUp() methods, we always call TestBase.setUp() first and
then call implementation-specific setup.  Tear down needs to do
the reverse.

This was causing over 20 failures on Windows, and was the culprit
behind about 80% of the files not being cleaned up after test run.
TestBase.tearDown() is responsible for deleting all targets created
during the test run and without this step, on Windows files will
be locked and cannot be deleted.  But TestBase.tearDown() was
calling Base.tearDown() before its own cleanup (i.e. deleting the
targets) and in some cases one of the teardown hooks would be to
call make clean.  So make clean would be run before the targets
had been deleted, and fail to remove the files, and subsequently
result in a failed test as well.

llvm-svn: 233284
2015-03-26 16:43:25 +00:00
Zachary Turner aa4dabfd85 Add a --all command option to "target delete".
llvm-svn: 233283
2015-03-26 16:43:13 +00:00
Aaron Ballman 50af8d4670 Sometimes report_fatal_error is called when there is not a handler function used to fail gracefully. In that case, RunInterruptHandlers is called, which attempts to enter a critical section object. Ensure that the critical section is properly initialized so that this code functions properly, and tools like clang-tidy do not crash in Debug builds.
llvm-svn: 233282
2015-03-26 16:24:38 +00:00
Ed Maste 27b4ed0983 Add FreeBSD/arm64 files to xcode build
llvm-svn: 233281
2015-03-26 15:55:16 +00:00
Leny Kholodov ab57d42dea [ARM] Fix PLT IFUNC symbol names in Release build
The fix is for r233277.
This makes tests work.

llvm-svn: 233280
2015-03-26 15:44:19 +00:00
Ilia K 841e30ae71 Fix RegisterCommandsTestCase and HelloWorldTestCase tests which hang on OS X after TestBase.tearDown()
llvm-svn: 233279
2015-03-26 15:43:46 +00:00
Ilia K 5704347c29 Fix infinite loop when ^D was pressed (MI)
llvm-svn: 233278
2015-03-26 15:10:32 +00:00
Leny Kholodov 28074d6e9b [ARM] Implementation of PLT: handling of IFUNC calls (gnu_indirect_function)
This diff includes implementation of linking calls to ifunc functions.
It provides ifunc entries in PLT and corresponding relocations (R_ARM_ALU_PC_G0_NC,
R_ARM_ALU_PC_G1_NC, R_ARM_LDR_PC_G2 for link-time and R_ARM_IRELATIVE for run-time).

Differential Revision: http://reviews.llvm.org/D7833

llvm-svn: 233277
2015-03-26 14:57:50 +00:00
Daniel Jasper e99c72fc2e clang-format: Fix merging of _T macros.
NewlinesBefore and HasUnescapedNewline were not properly propagated
leading to llvm.org/PR23032.

llvm-svn: 233276
2015-03-26 14:47:35 +00:00
Ed Schouten f4ac884f2b Make the presence of stdin and stdout optional.
The idea behind Nuxi CloudABI is that it is targeted at (but not limited to)
running networked services in a sandboxed environment. The model behind stdin,
stdout and stderr is strongly focused on interactive tools in a command shell.
CloudABI does not support the notion of stdin and stdout, as 'standard
input/output' does not apply to services. The concept of stderr does makes
sense though, as services do need some mechanism to log error messages in a
uniform way.

This patch extends libc++ in such a way that std::cin and std::cout and the
associated <cstdio>/<cwchar> functions can be disabled through the flags
_LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time
it attempts to clean up src/iostream.cpp a bit. Instead of using a single array
of mbstate_t objects and hardcoding the array indices, it creates separate
objects that declared next to the iostream objects and their buffers. The code
is also restructured by interleaving the construction and setup of c* and wc*
objects. That way it is more obvious that this is done identically.

The c* and wc* objects already have separate unit tests. Make use of this fact
by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in
both directions. If stdin or stdout is disabled, these tests will therefore
test for the absence of c* and wc*.

Differential Revision:	http://reviews.llvm.org/D8340

llvm-svn: 233275
2015-03-26 14:35:46 +00:00
Ed Schouten 4d5142937f Remove the state_types array.
If we want to add support for making std::cin and std::cout optional, it
is impractical to have all of the mbstate_t objects in one array. This
would mean that if std::cin and std::cout are omitted, the state_types
array is only used partially.

Solve this by using separate global variables. These are placed right
next to the iostream object and the buffer, meaning we can easily #ifdef
them away.

Differential Revision:	http://reviews.llvm.org/D8359

llvm-svn: 233274
2015-03-26 14:33:46 +00:00
Ed Maste 7754d21ae0 Handle FreeBSD/arm64 core files
This is derived from FreeBSD/mips64 and Darwin and Linux arm64 support.

Differential Revision:	http://reviews.llvm.org/D7835

llvm-svn: 233273
2015-03-26 14:20:00 +00:00
Ilia K c235b16819 Destroy the attached process in tearDown() to fix ProcessAttachTestCase tests on OS X
This patch fixes the following:
```
1: test_attach_to_process_by_id_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process id ... ok
2: test_attach_to_process_by_id_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process id ... ok
3: test_attach_to_process_by_name_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name ... FAILURE
4: test_attach_to_process_by_name_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name ... FAILURE

======================================================================
FAIL: test_attach_to_process_by_name_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 462, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 35, in test_attach_to_process_by_name_with_dsym
    self.process_attach_by_name()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 79, in process_attach_by_name
    self.runCmd("process attach -n s" + exe_name)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'process attach -n sProcessAttach' returns successfully
Config=x86_64-clang
======================================================================
FAIL: test_attach_to_process_by_name_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 41, in test_attach_to_process_by_name_with_dwarf
    self.process_attach_by_name()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 79, in process_attach_by_name
    self.runCmd("process attach -n s" + exe_name)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'process attach -n sProcessAttach' returns successfully
Config=x86_64-clang
----------------------------------------------------------------------
```

Failure-x86_64-clang-TestProcessAttach.ProcessAttachTestCase.test_attach_to_process_by_name_with_dsym.log:
```
[...]
runCmd: process attach -n ProcessAttach
runCmd failed!
error: attach failed: more than one process named ProcessAttach:
PID    PARENT USER       TRIPLE                   ARGUMENTS
====== ====== ========== ======================== ============================
43752  43680  IliaK      x86_64-apple-macosx      /Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/ProcessAttach
43663  1      IliaK      x86_64-apple-macosx      /Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/ProcessAttach
[...]
```

llvm-svn: 233272
2015-03-26 13:39:25 +00:00
Toma Tabacu 92dbbf1700 [mips] Move the setATReg definition inside the MipsAssemblerOptions class. NFC.
Summary: This groups all of the MipsAssemblerOptions functionality together, making it more reader-friendly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8445

llvm-svn: 233271
2015-03-26 13:08:55 +00:00
Andrea Di Biagio 8f7feec5fd [X86][FastIsel] Teach how to select vector load instructions.
This patch teaches fast-isel how to select 128-bit vector load instructions.
Added test CodeGen/X86/fast-isel-vecload.ll

Differential Revision: http://reviews.llvm.org/D8605

llvm-svn: 233270
2015-03-26 11:29:02 +00:00
Ed Schouten 3c3e58c42d Let Clang invoke CloudABI's linker.
Now that CloudABI's target information and header search logic for Clang
has been submitted, the only thing that remains to be done is adding
support for CloudABI's linker.

CloudABI uses Binutils ld, although there is some work to use lld
instead. This means that this code is largely based on what we use on
FreeBSD. There are some exceptions, however:

- Only static linking is performed. CloudABI does not support any
  dynamically linked executables.
- CloudABI uses compiler-rt, libc++ and libc++abi unconditionally. Link
  in these libraries instead of using libgcc_s, libstdc++, etc.
- We must ensure that the .eh_frame_hdr is present to make C++
  exceptions work properly.


Differential Revision:	http://reviews.llvm.org/D8250

llvm-svn: 233269
2015-03-26 11:13:44 +00:00
Leny Kholodov 4fdbf55730 Revert blank line after test commit
llvm-svn: 233268
2015-03-26 10:44:14 +00:00