Commit Graph

213556 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith a25ad0685a AsmPrinter: Remove implicit ilist iterator conversion, NFC
llvm-svn: 250776
2015-10-20 00:36:08 +00:00
Davide Italiano 1ea1fd6b34 [Driver] Error out instead of silently ignoring on invalid -z argument.
This matches what both ld.bfd and gold do.

llvm-svn: 250775
2015-10-20 00:34:04 +00:00
Reid Kleckner 7d3a2f067f Revert "Diagnose UnresolvedLookupExprs that resolve to instance members in static methods"
This reverts commit r250592.

It has issues around unevaluated contexts, like this:
  template <class T> struct A { T i; };
  template <class T>
  struct B : A<T> {
    using A<T>::i;
    typedef decltype(i) U;
  };
  template struct B<int>;

llvm-svn: 250774
2015-10-20 00:31:42 +00:00
Sean Callanan 3e7e915dca Added support for the "--repl" argument to LLDB.
This makes LLDB launch and create a REPL, specifying no target so that the REPL
can create one for itself.  Also added the "--repl-language" option, which
specifies the language to use.  Plumbed the relevant arguments and errors
through the REPL creation mechanism.

llvm-svn: 250773
2015-10-20 00:23:46 +00:00
Greg Clayton 7449ab9834 Fixed PlatformDarwin to locate Xcode by using HostInfo::GetProgramFileSpec(). This function returns the FileSpec to the program that is running the LLDB.framework or lldb.so and is more reliable than checking the path of LLDB.framework/lldb.so itself since it might not exist within the Xcode.app bundle (DYLD_FRAMEWORK_PATH). Then we check DEVELOPER_DIR, then check the currently installed Xcode with xcrun.
<rdar://problem/23167253>

llvm-svn: 250772
2015-10-20 00:22:50 +00:00
Davide Italiano 88f476b9eb [ELF2] Introduce support for -z nodelete.
llvm-svn: 250771
2015-10-20 00:20:20 +00:00
Greg Clayton 5b94e11873 When calling FileSpec::AppendPathComponent() we don't need to include "." in the path if m_filename is set to exactly '.'. Previously this would cause a FileSpec object that looked like:
m_directory = "/tmp"
m_filename = "."
                                         
To look like:

m_directory = "/tmp/."
m_filename = "foo.txt"

if "foo.txt" was appended to it. With this fix it will be:

m_directory = "/tmp"
m_filename = "foo.txt"

llvm-svn: 250770
2015-10-20 00:17:39 +00:00
Duncan P. N. Exon Smith 7869148c47 Mips: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250769
2015-10-20 00:15:20 +00:00
Greg Clayton e75e5d8afa Make sure we restore the process events so they aren't hijacked when using the async attach when attaching to a process by name and with waitfor.
<rdar://problem/22821480>

llvm-svn: 250768
2015-10-20 00:14:20 +00:00
Enrico Granata b3f0c3400f Introduce the concept of a type that is meaningless without dynamic resolution, which are essentially placeholder types meant to appease a language's type system but do not offer any actual information to the debugger, unless further resolved
This is currently meant for data formatters to know to ignore such types in caching and lookup

llvm-svn: 250767
2015-10-20 00:13:19 +00:00
Duncan P. N. Exon Smith 19d951874a CppBackend: Remove implicit ilist iterator conversions, NFC
Mostly just converted to range-based for loops.  May have converted a
couple of extra loops as a drive-by (not sure).

llvm-svn: 250766
2015-10-20 00:06:41 +00:00
Duncan P. N. Exon Smith d95fa4ccf1 BPF: Remove implicit ilist iterator conversion, NFC
llvm-svn: 250765
2015-10-20 00:02:50 +00:00
Craig Topper d945d50efc [X86] Remove a few 'else' after 'return'
llvm-svn: 250764
2015-10-20 00:00:17 +00:00
Zachary Turner ff890daf12 Convert print statements to print function calls.
This patch was generating by running `2to3` on the files in the
lldb/test directory.  This patch should be NFC, but it does
introduce the `from __future__ import print_function` line, which
will break future uses of the print statement.

llvm-svn: 250763
2015-10-19 23:45:41 +00:00
Zachary Turner 1756e05688 Run py2to3 on lldb/scripts folder.
This mostly fixes some print statements, but there were also some
instances of dict.iteritems() lingering that this found.

llvm-svn: 250762
2015-10-19 23:45:25 +00:00
Evgeniy Stepanov 0b98b27677 [msan] Intercept mincore.
llvm-svn: 250761
2015-10-19 23:39:11 +00:00
Davide Italiano 58cbaf0604 [ELF2/OutputSections] Allocate the correct number of entries after r250739.
llvm-svn: 250760
2015-10-19 23:32:16 +00:00
Duncan P. N. Exon Smith 9f9559e807 ARM: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250759
2015-10-19 23:25:57 +00:00
Lang Hames 6372a0bd51 [Orc] Fix MSVC bugs introduced in r250749.
llvm-svn: 250758
2015-10-19 23:23:17 +00:00
David Majnemer fac5243493 [MS ABI] Give linkonce_odr, instead of external_linkage, to certain kinds of static data members
Out-of-line definitions of static data members which have an inline
initializer must get GVA_DiscardableODR linkage instead of
GVA_StrongExternal linkage.

MSVC 2013's behavior is different with respect to this and would cause
link errors if one TU provided a definition while another did not.
MSVC 2015 fixed this bug, making this OK.  Note that the 2015 behavior
is always compatible with 2013: it never produces a strong definition.

This essentially reverts r237787.

llvm-svn: 250757
2015-10-19 23:22:49 +00:00
Duncan P. N. Exon Smith 1e59a66c69 ObjCARC: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250756
2015-10-19 23:20:14 +00:00
Sean Callanan ffd77e01a5 Added REPL.cpp to the relevant CMakeLists.txt
llvm-svn: 250755
2015-10-19 23:18:49 +00:00
Cong Hou 7745dbc5c4 Enhance loop rotation with existence of profile data in MachineBlockPlacement pass.
Currently, in MachineBlockPlacement pass the loop is rotated to let the best exit to be the last BB in the loop chain, to maximize the fall-through from the loop to outside. With profile data, we can determine the cost in terms of missed fall through opportunities when rotating a loop chain and select the best rotation. Basically, there are three kinds of cost to consider for each rotation:

1. The possibly missed fall through edge (if it exists) from BB out of the loop to the loop header.
2. The possibly missed fall through edges (if they exist) from the loop exits to BB out of the loop.
3. The missed fall through edge (if it exists) from the last BB to the first BB in the loop chain.

Therefore, the cost for a given rotation is the sum of costs listed above. We select the best rotation with the smallest cost. This is only for PGO mode when we have more precise edge frequencies.

Differential revision: http://reviews.llvm.org/D10717

llvm-svn: 250754
2015-10-19 23:16:40 +00:00
Sean Callanan 6681041d70 Added the concept of a Read-Eval-Print-Loop to LLDB.
A REPL takes over the command line and typically treats input as source code.
REPLs can also do code completion.  The REPL class allows its subclasses to
implement the language-specific functionality without having to know about the
IOHandler-specific internals.

Also added a PluginManager-based way of getting to a REPL given a language and
a target.

Also brought in some utility code and expression options that are useful for
REPLs, such as line offsets for expressions, ANSI terminal coloring of errors,
and a few IOHandler convenience functions.

llvm-svn: 250753
2015-10-19 23:11:07 +00:00
Evgeniy Stepanov cc25301092 [msan] Intercept pthread_getcancel*.
llvm-svn: 250752
2015-10-19 23:00:13 +00:00
Keno Fischer f23c0c405e Revert r248047 and fix the problem properly
In r248047, I attempted to fix a build breakage introduced by using
llvm's regex support from lldb-mi. However, my approach was flawed
when LLVM and lldb are dynamically linked, in which case two copies
of LLVMSupport would end up in memory, causing crashes on lldb start up.
Instead, use LINK_COMPONENTS to make sure lldb-mi has access to the
LLVMSupport symbols without causing duplication in the dynamic library
case.

llvm-svn: 250751
2015-10-19 22:59:16 +00:00
Enrico Granata a512103bdf Add a flakey category for flakey tests
llvm-svn: 250750
2015-10-19 22:53:34 +00:00
Lang Hames 16a4cfb80d [Orc] Use '= default' for move constructor/assignment as per dblaikie's review.
Thanks Dave!

llvm-svn: 250749
2015-10-19 22:49:18 +00:00
Duncan P. N. Exon Smith 9934b26b0f Linker: Remove implicit ilist iterator conversion, NFC
llvm-svn: 250748
2015-10-19 22:23:36 +00:00
David Blaikie 437aafdab2 Fix -Wdeprecated regarding ORC copying ValueMaterializers
As usual, this is a polymorphic hierarchy without polymorphic ownership,
so simply make the dtor protected non-virtual, protected default copy
ctor/assign, and make derived classes final. The derived classes will
pick up correct default public copy ops (and dtor) implicitly.

(wish I could add -Wdeprecated to the build, but last time I tried it
triggered on some system headers I still need to look into/figure out)

llvm-svn: 250747
2015-10-19 22:15:55 +00:00
Michael Liao c65d386b81 [InstCombine] Optimize icmp of inc/dec at RHS
Allow LLVM to optimize the sequence like the following:

  %inc = add nsw i32 %i, 1
  %cmp = icmp slt %n, %inc

into:

  %cmp = icmp sle i32 %n, %i

The case is not handled previously due to the complexity of compuation of %n.
Hence, LLVM cannot swap operands of icmp accordingly.

llvm-svn: 250746
2015-10-19 22:08:14 +00:00
Duncan P. N. Exon Smith 6b92a14a28 Vectorize: Remove implicit ilist iterator conversions, NFC
Besides the usual, I finally added an overload to
`BasicBlock::splitBasicBlock()` that accepts an `Instruction*` instead
of `BasicBlock::iterator`.  Someone can go back and remove this overload
later (after updating the callers I'm going to skip going forward), but
the most common call seems to be
`BB->splitBasicBlock(BB->getTerminator(), ...)` and I'm not sure it's
better to add `->getIterator()` to every one than have the overload.
It's pretty hard to get the usage wrong.

llvm-svn: 250745
2015-10-19 22:06:09 +00:00
Enrico Granata c8e7649a19 Let Language plugins vend a default DeclPrintingHelper in case a custom one is not specified for the specific invocation
llvm-svn: 250744
2015-10-19 22:04:25 +00:00
Sanjay Patel 69a50a1e17 [CGP] transform select instructions into branches and sink expensive operands
This was originally checked in at r250527, but reverted at r250570 because of PR25222.
There were at least 2 problems: 
1. The cost check was checking for an instruction with an exact cost of TCC_Expensive;
that should have been >=.
2. The cause of the clang stage 1 failures was illegally sinking 'call' instructions;
we can't sink instructions that may have side effects / are not safe to execute speculatively.

Fixed those conditions in sinkSelectOperand() and added test cases.

Original commit message:
This is a follow-up to the discussion in D12882.

Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands
are expensive (as defined by the TTI cost model) because that may expose further optimizations.
However, we would then like a later pass like CodeGenPrepare to undo that transformation if the
target would likely benefit from not speculatively executing an expensive op (this patch).

Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its
select-formation behavior that changed with r248439.

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

llvm-svn: 250743
2015-10-19 21:59:12 +00:00
Samuel Benzaquen daef163199 Added check uniqueptr-delete-release to replace "delete x.release()" with "x = nullptr"
Reviewers: alexfh

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

llvm-svn: 250742
2015-10-19 21:49:51 +00:00
Duncan P. N. Exon Smith d77de6495e X86: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250741
2015-10-19 21:48:29 +00:00
Siva Chandra fdbefca88c [PlatformDarwin.cpp] Include <mutex> for std::once_flag.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 250740
2015-10-19 21:43:07 +00:00
Davide Italiano 56d18f4f8a [OutputSection] Set the symbolic bit in DT_FLAGS and not DT_FLAGS_1.
The two names are similar enough that they might lead to confusion.
The output of readobj clarifies but I missed it when I originally
committed this. Found while linking FreeBSD userland with lld.

llvm-svn: 250739
2015-10-19 21:34:00 +00:00
Davide Italiano 5d1ec86910 [Driver] Ignore some options used to link FreeBSD userland.
We're gonna implement them at some point, but they're mostly warning,
not of vital importance at this stage of development.

llvm-svn: 250738
2015-10-19 21:01:32 +00:00
Rafael Espindola c159c967f6 Add support for merging the contents of SHF_MERGE sections.
For now SHF_STRINGS are not supported.

llvm-svn: 250737
2015-10-19 21:00:02 +00:00
Rui Ueyama f215dac553 Replace auto with a real type. NFC.
llvm-svn: 250736
2015-10-19 20:55:28 +00:00
Greg Clayton 6988abc14d Allow LLDB.framework to locate debugserver even when it doesn't exist in the LLDB.framework.
This allows open source MacOSX clients to not have to build debugserver and the current LLDB can find debugserver inside the selected Xcode.app on your system.

<rdar://problem/23167253>

llvm-svn: 250735
2015-10-19 20:44:01 +00:00
Enrico Granata 238de51eed Teach the lldbinline test cases to run in DWO mode
llvm-svn: 250734
2015-10-19 20:40:50 +00:00
Lang Hames f1381cb8d0 [RuntimeDyld][COFF] Fix some endianness issues, re-enable the regression test.
llvm-svn: 250733
2015-10-19 20:37:52 +00:00
Rui Ueyama b7f2867a85 Reduce nesting level. NFC.
llvm-svn: 250732
2015-10-19 20:31:49 +00:00
Rafael Espindola 932efcfa77 Change getLocalRelTarget to include the addend.
Given the name, it is natural for this function to compute the full target.

This will simplify SHF_MERGE handling by allowing getLocalRelTarget to
centralize the addend logic.

llvm-svn: 250731
2015-10-19 20:24:44 +00:00
Rafael Espindola 4975752389 Simplify by computing on relocation field at a time.
llvm-svn: 250730
2015-10-19 19:58:18 +00:00
Jonathan Peyton 6778c73243 Fix OMP_PLACES negation operator parsing (!place)
Just moved the *scan++ line up before the recursive call.  Otherwise,
infinite recursion occurs and leads to a segmentation fault.

llvm-svn: 250729
2015-10-19 19:43:01 +00:00
Rui Ueyama 75656eebb8 COFF: /OPT should accept comma-separated multiple arguments.
/OPT:foo,bar is equivalent to /OPT:foo /OPT:bar.

Reported by alexchandel. https://llvm.org/bugs/show_bug.cgi?id=25228

llvm-svn: 250728
2015-10-19 19:40:43 +00:00
Jonathan Peyton 45ca5dada1 Clean-up cancellation state flag between parallel regions
Without this fix, cancellation requests in one parallel region cause
cancellation of the second region even though the second one was
not intended to be cancelled.

llvm-svn: 250727
2015-10-19 19:33:38 +00:00