Commit Graph

197090 Commits

Author SHA1 Message Date
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
Leny Kholodov 1d01cc7c1b Commit access verification: blank line has been added
llvm-svn: 233267
2015-03-26 10:37:53 +00:00
Ilia K b6e094cc70 Fix StopHookForMultipleThreadsTestCase tests after r233098
llvm-svn: 233266
2015-03-26 10:28:15 +00:00
Ilia K c248ec2c29 Use std::vector::iterator in CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges to fix build on Linux after r233260 (MI)
llvm-svn: 233265
2015-03-26 09:43:23 +00:00
Chandler Carruth 52cee4dad2 [Modules] Preserve source order for the map of late parsed templates.
Clang was inserting these into a dense map. While it never iterated the
dense map during normal compilation, it did when emitting a module. Fix
this by using a standard MapVector to preserve the order in which we
encounter the late parsed templates.

I suspect this still isn't ideal, as we don't seem to remove things from
this map even when we mark the templates as no longer late parsed. But
I don't know enough about this particular extension to craft a nice,
subtle test case covering this. I've managed to get the stress test to
at least do some late parsing and demonstrate the core problem here.
This patch fixes the test and provides deterministic behavior which is
a strict improvement over the prior state.

I've cleaned up some of the code here as well to be explicit about
inserting when that is what is actually going on.

llvm-svn: 233264
2015-03-26 09:08:15 +00:00
Chandler Carruth 70a1369b34 [Modules] Add some more fun code to my modules stress test, this time
templates. Turns out all of this works correctly (so far). But it should
cover more code paths and will let me test some things that don't
actually work next.

llvm-svn: 233263
2015-03-26 08:49:55 +00:00
Ed Schouten 407bd03e6d Don't let time_put test use implementation dependent constructs.
The time_put test doesn't seem to work on Linux and CloudABI. For Linux
we already have an XFAIL. Closer inspection seems to reveal that this
test does not pass for a couple of reasons.

First of all, the tm_yday field is set to an invalid value. The
strftime() function doesn't behave consistently across platforms in case
the values in the tm structure are incoherent. Fix up this field to have
the value 121, which corresponds with tm_mday, tm_mon and tm_year. This
of course affects the output of time_put for some modifiers, so update
the tests accordingly.

Second, some of the tests actually use modifiers that are only present
on BSD derived systems. They are not part of the C standard/POSIX.
Simply remove them.

Finally, some of the tests actually use invalid modifiers, causing a
malformed format string to be passed to strftime(). Remove these tests
as well.

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

llvm-svn: 233262
2015-03-26 08:38:00 +00:00
Chandler Carruth f85d98285e [Modules] Make "#pragma weak" undeclared identifiers be tracked
deterministically.

This fixes a latent issue where even Clang's Sema (and diagnostics) were
non-deterministic in the face of this pragma. The fix is super simple --
just use a MapVector so we track the order in which these are parsed (or
imported). Especially considering how rare they are, this seems like the
perfect tradeoff. I've also simplified the client code with judicious
use of auto and range based for loops.

I've added some pretty hilarious code to my stress test which now
survives the binary diff without issue.

llvm-svn: 233261
2015-03-26 08:32:49 +00:00
Ilia K 23536d92c7 Use std::vector::const_iterator and std::vector::cbegin/cend in CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges (MI)
llvm-svn: 233260
2015-03-26 08:16:18 +00:00
Denis Protivensky 9e473d0929 [ARM] Handle mapping symbols
Mapping symbols should have their own code models,
and in some places must be treated in a specific way.
Make $t denote Thumb code, and $a and $d denote ARM code.
Set size, binding and type of mapping symbols to what the specification says.

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

llvm-svn: 233259
2015-03-26 07:47:16 +00:00
Ilia K c7efd564bb Fix Process::Finalize to do Process::Destroy if needed after r233255
llvm-svn: 233258
2015-03-26 07:40:40 +00:00
Timur Iskhodzhanov fd3241528d [Sanitizer] Plug a leak in POSIXSymbolizer::FindModuleForAddress
It was happening when we looked up a PC for a module that was dlopen'ed/dlclose'd
after the last time we fetched the list of modules

Reviewed at http://reviews.llvm.org/D8618

llvm-svn: 233257
2015-03-26 07:14:29 +00:00
Ilia K 490500a7e8 Fix =thread-exited message (MI)
Summary:
This patch includes:
# Fix invalid thread id in =thread-exited message
# Remove invalid threads from cache

All tests pass on OS X.

Test Plan:
now
```
=thread-exited,id="3",group-id="i1"
=thread-exited,id="4",group-id="i1"
=thread-exited,id="5",group-id="i1"
```

was
```
=thread-exited,id="4294967295",group-id="i1"
=thread-exited,id="4294967295",group-id="i1"
...
=thread-exited,id="4294967295",group-id="i1"
=thread-exited,id="4294967295",group-id="i1"
```

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 233256
2015-03-26 07:11:31 +00:00
Ilia K fcc89a079f Fix -gdb-exit to detach if was attached or destroy otherwise (MI)
Summary:
This patch fixes -gdb-exit for locally target. It includes the following changes:
# Fix Process::Finalize
# Use SBProcess::Destroy in -gdb-exit

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 233255
2015-03-26 07:08:47 +00:00
Duncan P. N. Exon Smith 7124230682 Revert "Linker: Drop function pointers for overridden subprograms"
This reverts commit r233164 and its testcase follow-ups in r233165,
r233207, r233214, and r233221.  It apparently unleashed an LTO bootstrap
failure, at least on Darwin:

http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/3376/

I'm reproducing now.

llvm-svn: 233254
2015-03-26 05:27:45 +00:00
Duncan P. N. Exon Smith 5fbcc46a4a bugpoint: Verify input files
Like r233229 for `llvm-link`, start verifying input files to `bugpoint`.

llvm-svn: 233253
2015-03-26 05:03:10 +00:00
Duncan P. N. Exon Smith 866aed7711 bugpoint: Return early after error, NFC
llvm-svn: 233252
2015-03-26 05:03:06 +00:00
Chandler Carruth 8a3d24dcf8 [Modules] Delete a bunch of complex code for ensuring visible decls in
updated decl contexts get emitted.

Since this code was added, we have newer vastly simpler code for
handling this. The code I'm removing was very expensive and also
generated unstable order of declarations which made module outputs
non-deterministic.

All of the tests continue to pass for me and I'm able to check the
difference between the .pcm files after merging modules together.

llvm-svn: 233251
2015-03-26 04:27:10 +00:00
Richard Smith 65ebb4ac8a [modules] If we reach a definition of a class for which we already have a
non-visible definition, skip the new definition and make the old one visible
instead of trying to parse it again and failing horribly. C++'s ODR allows
us to assume that the two definitions are identical.

llvm-svn: 233250
2015-03-26 04:09:53 +00:00
Chandler Carruth e972c36221 [Modules] A second attempt at writing out on-disk hash tables for the
decl context lookup tables.

The first attepmt at this caused problems. We had significantly more
sources of non-determinism that I realized at first, and my change
essentially turned them from non-deterministic output into
use-after-free. Except that they weren't necessarily caught by tools
because the data wasn't really freed.

The new approach is much simpler. The first big simplification is to
inline the "visit" code and handle this directly. That works much
better, and I'll try to go and clean up the other caller of the visit
logic similarly.

The second key to the entire approach is that we need to *only* collect
names into a stable order at first. We then need to issue all of the
actual 'lookup()' calls in the stable order of the names so that we load
external results in a stable order. Once we have loaded all the results,
the table of results will stop being invalidated and we can walk all of
the names again and use the cheap 'noload_lookup()' method to quickly
get the results and serialize them.

To handle constructors and conversion functions (whose names can't be
stably ordered) in this approach, what we do is record only the visible
constructor and conversion function names at first. Then, if we have
any, we walk the decls of the class and add those names in the order
they occur in the AST. The rest falls out naturally.

This actually ends up simpler than the previous approach and seems much
more robust.

It uncovered a latent issue where we were building on-disk hash tables
for lookup results when the context was a linkage spec! This happened to
dodge all of the assert by some miracle. Instead, add a proper predicate
to the DeclContext class and use that which tests both for function
contexts and linkage specs.

It also uncovered PR23030 where we are forming somewhat bizarre negative
lookup results. I've just worked around this with a FIXME in place
because fixing this particular Clang bug seems quite hard.

I've flipped the first part of the test case I added for stability back
on in this commit. I'm taking it gradually to try and make sure the
build bots are happy this time.

llvm-svn: 233249
2015-03-26 03:11:40 +00:00
Rui Ueyama da74d57edb Rename align2 -> align.
I believe "2" stands for log2. Just "align" would be appropriate now.

llvm-svn: 233248
2015-03-26 02:23:45 +00:00
Rui Ueyama 39eb6db9a5 Store non-log2 values to Native files.
llvm-svn: 233247
2015-03-26 02:23:42 +00:00
Rui Ueyama 629f964d50 Use arithmetic type to represent alignments (not in log2) everywhere.
This is the final step of conversion. Now log2 numbers are removed
from everywhere!

llvm-svn: 233246
2015-03-26 02:20:25 +00:00
Rui Ueyama f217ef0d75 Use alignment values everywhere instead of log2.
This patch defines implicit conversion between integers and PowerOf2
instances, so uses of the classes is now implicit and look like
regular integers. Now we are ready to remove the scaffolding.

llvm-svn: 233245
2015-03-26 02:03:44 +00:00
Rui Ueyama f006f4d62c Define an implicit constructor which takes actual alignment value to PowerOf2.
The new constructor's type is the same, but this one takes not a log2
value but an alignment value itself, so the meaning is totally differnet.

llvm-svn: 233244
2015-03-26 01:44:01 +00:00
Rui Ueyama 48865ca64d Make PowerOf2's constructor private.
Ban conversion from integers to PowerOf2 even if explicit
to make all places we create PowerOf2 instances visible.

llvm-svn: 233243
2015-03-26 01:29:06 +00:00
Rui Ueyama c3d18f5120 Remove implicit constructor and operator int from PowerOf2.
This patch is to make instantiation and conversion to an integer explicit,
so that we can mechanically replace all occurrences of the class with
integer in the next step.

Now get() returns an alignment value rather than its log2 value.

llvm-svn: 233242
2015-03-26 01:12:32 +00:00
Quentin Colombet 2c6e0597c6 [RegisterCoalescer] Add a rule to consider more profitable copies first when
those are in the same basic block.
The previous approach was the topological order of the basic block.

By default this rule is disabled.

Related to PR22768.

llvm-svn: 233241
2015-03-26 01:01:48 +00:00
Eric Christopher 9f74ca5e0f Testcase for r233239.
llvm-svn: 233240
2015-03-26 00:57:33 +00:00
Eric Christopher ed1042b97c Add computeFSAdditions to the function based subtarget creation
for PPC due to some unfortunate default setting via TargetMachine
creation. I've added a FIXME on how this can be unraveled in the
backend and a test to make sure we successfully legalize 64-bit things
if we say we're 64-bits.

llvm-svn: 233239
2015-03-26 00:50:23 +00:00
Eric Christopher 118ee4c07b Add an explanatory comment as to why we're turning on and off
certain other options as aliases. There be dragons here.

llvm-svn: 233238
2015-03-26 00:50:13 +00:00
Sean Callanan 7e9793f57a Changed '-x'/'-xsize' to '-s'/'-size' when specifying
the size of a watchpoint.

<rdar://problem/18184972>

llvm-svn: 233237
2015-03-26 00:42:27 +00:00
Greg Clayton 40ca211071 Add a test to make sure if you do:
% lldb /bin/echo
(lldb) r 1 2 3
(lldb) r 

You get "1", "2", and "3" as arguments in the next re-run when no args are specified. This is behavior we do to match what GDB did and we need to test that we don't regress on it.

<rdar://problem/20300941>

llvm-svn: 233236
2015-03-26 00:27:46 +00:00
Richard Smith 88f4bba21e Reformatting, NFC
llvm-svn: 233234
2015-03-26 00:16:07 +00:00
Greg Clayton 896e0ecd16 Keep launch info up to date when accessors are called directly (not through "settings set").
<rdar://problem/20300941>

llvm-svn: 233233
2015-03-26 00:15:24 +00:00
Rui Ueyama d2c1bf638b Add a scaffolding to merge alignment representations.
We are using log2 values and values themselves to represent alignments.
For example, alignment 8 is sometimes represented as 3 (8 == 2^3).
We want to stop using log2 values.

Because both types are regular arithmetic types, we cannot get help from
a compiler to find places we mix two representations. That makes this
merging work surprisingly hard because if I make a mistake, I'll just get
wrong results at runtime (Yay types!). In this patch, I introduced
a class to represents power-of-two values, which is basically an alias
for an integer type.

Once the migration is done, the class will be removed.

llvm-svn: 233232
2015-03-26 00:10:50 +00:00
Alexey Samsonov 1c1407395f [LSan] Don't explicitly exclude LSan from Windows build - it should just produce dummy object files. NFC.
llvm-svn: 233231
2015-03-25 23:26:49 +00:00
Siva Chandra 71e080646e [DWARF] Remove an unused arg to SymbolFileDWARF::ParseChildParameters.
Test Plan: Build LLDB

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 233230
2015-03-25 23:23:44 +00:00