Commit Graph

194899 Commits

Author SHA1 Message Date
Tamas Berghammer 6806fded8c Make it possible to stop the operation thread in NativeProcessLinux
Previously the operation thread is stopped with a cancel event but
pthread_cancel is not supported on android. This CL creates a custom
operation which asks the operation thread to exit without any pthread
call.

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

llvm-svn: 230945
2015-03-02 11:04:03 +00:00
Ilia K f1115fe0c5 Rename CMIDriver::LocalDebugSessionStartupInjectCommands to CMIDriver::LocalDebugSessionStartupExecuteCommands after r230003
llvm-svn: 230944
2015-03-02 10:58:02 +00:00
Alexander Kornienko 1ca3b83255 [clang-tidy] Assert related checkers
This patch contains two assert related checkers. These checkers are the part of
those that is being open sourced by Ericsson
(http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040520.html).

The checkers:

AssertSideEffect:
/// \brief Finds \c assert() with side effect.
///
/// The conition of \c assert() is evaluated only in debug builds so a condition
/// with side effect can cause different behaviour in debug / relesase builds.

StaticAssert:
/// \brief Replaces \c assert() with \c static_assert() if the condition is 
/// evaluatable at compile time.
///
/// The condition of \c static_assert() is evaluated at compile time which is
/// safer and more efficient.

http://reviews.llvm.org/D7375

Patch by Szabolcs Sipos!

llvm-svn: 230943
2015-03-02 10:46:43 +00:00
Daniel Jasper e662316994 clang-format: Prefer wrapping a lambda's body over the lambda's return type.
Before:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
          -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; });

After:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa {
        return aaaaaaaaaaaaaaaaa;
      });

llvm-svn: 230942
2015-03-02 10:35:13 +00:00
Owen Anderson 63fbf10c32 Teach the verifier to enforce that the alignment argument of memory intrinsics must be a power of 2.
llvm-svn: 230941
2015-03-02 09:35:06 +00:00
Owen Anderson 5af4b21c2e Teach DataLayout that alignments on basic types must be powers of two.
Fixes assertion failures/crashes on bad datalayout specifications.

llvm-svn: 230940
2015-03-02 09:35:03 +00:00
Owen Anderson ab1c7a77d2 Teach DataLayout that ABI alignments for non-aggregate types must be non-zero.
This manifested as assertions and/or crashes in later phases of optimization,
depending on the build configuration.

llvm-svn: 230939
2015-03-02 09:34:59 +00:00
Owen Anderson 040f2f890e Teach DataLayout that pointer ABI and preferred alignments are required to be powers of two.
Previously this resulted in asserts and/or crashes (depending on build configuration) at various phases in the optimizer.

llvm-svn: 230938
2015-03-02 06:33:51 +00:00
Davide Italiano d333c36e8a Update the list of relocations that need to be implemented.
While at it, point the correct document where the missing TLS
relocation(s) are described.

llvm-svn: 230937
2015-03-02 06:17:38 +00:00
Owen Anderson 5bc2bbe601 Teach DataLayout that zero-byte pointer sizes don't make sense.
Previously this would result in assertion failures or simply crashes
at various points in the optimizer when trying to create types of zero
bit width.

llvm-svn: 230936
2015-03-02 06:00:02 +00:00
Owen Anderson 576a9a2728 Teach the LLParser to fail gracefully when it encounters an invalid label name.
Previous it would either assert in +Asserts, or crash in -Asserts. Found by fuzzing LLParser.

llvm-svn: 230935
2015-03-02 05:25:09 +00:00
Owen Anderson 91bdf07650 Fix a crash in the LL parser where it failed to validate that the pointer operand of a GEP was valid.
This manifested as an assertion failure in +Asserts builds, and a hard crash in -Asserts builds.  Found by fuzzing the LL parser.

llvm-svn: 230934
2015-03-02 05:25:06 +00:00
Zachary Turner 7797c726b9 [llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:

1) Now supports -all command line argument, which implies many
   other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
   exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.

And a few other minor tweaks.

llvm-svn: 230933
2015-03-02 04:39:56 +00:00
Nico Weber 968ceddca9 Revert r230930, it caused PR22747.
llvm-svn: 230932
2015-03-02 04:37:11 +00:00
Craig Topper 9c26bcca5a [X86] There are only 8 mask registers. Fail disassembly if instruction tries to reference more.
llvm-svn: 230931
2015-03-02 03:33:11 +00:00
Adrian Prantl e2c9e64532 Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.

Ought to be NFC, but it does slightly alter the output format of the
textual assembly.

llvm-svn: 230930
2015-03-02 02:38:18 +00:00
NAKAMURA Takumi 0cd23c842e Revert r230921, "Revert some changes that were made to fix PR20680.", for now.
It caused a failure on clang/test/Misc/backend-optimization-failure.cpp .

llvm-svn: 230929
2015-03-02 01:14:03 +00:00
Nico Weber f609839244 Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change.
llvm-svn: 230928
2015-03-02 01:12:28 +00:00
Benjamin Kramer 43e7f96f64 Add another missing header that used to be included transitively.
llvm-svn: 230927
2015-03-02 01:08:07 +00:00
NAKAMURA Takumi 85c9baca06 llvm/examples: Add missing include according to r230907.
llvm-svn: 230926
2015-03-02 01:04:34 +00:00
Benjamin Kramer 06a42af61e Add missing includes for make_unique, lld edition.
llvm-svn: 230925
2015-03-02 00:48:06 +00:00
Craig Topper 09b27e7b24 [X86] Fix diassembler crash on AVX512 cmpps/cmppd with immediate that doesn't fit in 5-bits. Fixes PR22743.
llvm-svn: 230924
2015-03-02 00:22:29 +00:00
Sanjoy Das e5d1466ab3 [AArch64] fix an invalid-iterator-use bug.
Summary:
In AArch64PromoteConstant::appendAndTransferDominatedUses,
`InsertPts[NewPt]` invalidates IPI.  Therefore, `InsertPts[NewPt] =
std::move(IPI->second)` is not legal.

This was caught by running `make check` with
http://reviews.llvm.org/D7931.

Reviewers: t.p.northover, grosbach, bkramer

Reviewed By: bkramer

Subscribers: aemerson, llvm-commits

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

llvm-svn: 230923
2015-03-02 00:17:18 +00:00
Benjamin Kramer 201a48471b Fix a really bad typo in my last commit.
llvm-svn: 230922
2015-03-01 23:56:19 +00:00
Sanjoy Das 876bd51486 Revert some changes that were made to fix PR20680.
Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533.  SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow.  There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.

Revert "IndVarSimplify: Allow LFTR to fire more often"

This reverts commit 1ade0f0faa98877b688e0b9da58e876052c1e04e (SVN: 222213).

Revert "IndVarSimplify: Don't let LFTR compare against a poison value"

This reverts commit c0f2b8b528d8a37b0a1522aae90af649d6357eb5 (SVN: 217102).

Reviewers: majnemer, atrick, spatel

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

llvm-svn: 230921
2015-03-01 23:36:26 +00:00
Benjamin Kramer 7f360ce5c2 ArrayRef: Put back std::equal for operator== with a check for the empty ArrayRefs
This has the nice property of compiling down to memcmp when feasible. An empty
ArrayRef can have a nullptr in its Data field. I didn't find anything in the
standard speaking against std::equal(nullptr, nullptr, nullptr) begin valid but
MSVC asserts. The way libstdc++ lowers std::equal down to memcmp also makes
invoking std::equal with a nullptr undefined behavior so checking is the only
way to be safe.

The extra check doesn't cost us perf either because we're essentially peeling
the loop header away from the rotated loop.

llvm-svn: 230920
2015-03-01 23:35:20 +00:00
Vince Harron bc477ddee0 Linux - debugging of local processes via lldb-gdbserver
Instead of lldb calling the ptrace APIs directly, it launches an llgs
instance and communicates with it via the remote debug protocol.

This has two advantages.

There is more code shared between the remote debugging code path
and the local debugging code path. If a feature works in remote, it
probably works locally and vice-versa.

It makes us more architecturally similar to OSX (which also does
local debugging via a connection to debugserver).

This path is called LLGS local. We think that this configuration is
now at parity with (or better than) local linux debugging.

It is currently invoked if you have an environment variable defined
"PLATFORM_LINUX_FORCE_LLGS_LOCAL"

We would like to switch to LLGS local as the default path and only
use the non-LLGS path if someone has an environment variable defined
"PLATFORM_LINUX_DISABLE_LLGS_LOCAL"

Later, if all goes well, we would like to remove non-LLGS local
debugging support to simplify the codebase and avoid confusion.

llvm-svn: 230919
2015-03-01 23:21:29 +00:00
Benjamin Kramer 66e7a5cc9a Another missing include for MSVC.
llvm-svn: 230918
2015-03-01 22:34:04 +00:00
Peter Collingbourne d251b0a60e DebugInfo: Give externally defined types a size and alignment where
possible. Fixes PR22736.

llvm-svn: 230914
2015-03-01 22:07:04 +00:00
Benjamin Kramer 3c63d666a3 std::function is part of <functional>, not <utility>
llvm-svn: 230913
2015-03-01 21:49:21 +00:00
Benjamin Kramer 5b0617281c Add another missing include for MSVC.
llvm-svn: 230912
2015-03-01 21:47:46 +00:00
Benjamin Kramer 42cc33e816 X86: Replace variadic function with init list. NFC.
llvm-svn: 230911
2015-03-01 21:47:40 +00:00
Benjamin Kramer 33335df819 Add missing include.
llvm-svn: 230910
2015-03-01 21:36:40 +00:00
Benjamin Kramer 0a446fd56c Add missing includes. make_unique proliferated everywhere.
llvm-svn: 230909
2015-03-01 21:28:53 +00:00
Arnaud A. de Grandmaison a57ca81eb4 [PBQP] Address post-commit style comment for r230904. NFC.
Thanks David !

llvm-svn: 230908
2015-03-01 21:22:50 +00:00
Benjamin Kramer 030133c5db ArrayRef: Remove the equals helper with many arguments.
With initializer lists there is a really neat idiomatic way to write
this, 'ArrayRef.equals({1, 2, 3, 4, 5})'. Remove the equal method which
always had a hard limit on the number of arguments. I considered
rewriting it with variadic templates but that's not really a good fit
for a function with homogeneous arguments.

'ArrayRef == {1, 2, 3, 4, 5}' would've been even more awesome, but C++11
doesn't allow init lists with binary operators.

llvm-svn: 230907
2015-03-01 21:05:05 +00:00
Chaoren Lin 451dd50673 Advertise 32 bit support for PlatformRemoteGDBServer on 64 bit systems.
Reviewers: vharron, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 230906
2015-03-01 20:48:18 +00:00
Rui Ueyama 990bb16036 Revert "PECOFF: Don't parse files in .drectve asynchronously."
This reverts commit r228955. Previously files appear in a .drectve
section are parsed synchronously to avoid threading issues. I believe
it's now safe to do that asynchronously.

llvm-svn: 230905
2015-03-01 20:48:14 +00:00
Arnaud A. de Grandmaison 21fa09890c [PBQP] Do not add an edge between nodes with totally disjoint allowed registers
Such edges are zero matrix, and they bring no additional info to the
allocation problem, apart from contributing to nodes' degree. Removing
those edges is expected to improve allocation time.

Tune the spill cost comparison, as this gives better average performances
now that the nodes' degrees has changed.

llvm-svn: 230904
2015-03-01 20:39:34 +00:00
Daniel Jasper bea1ab46d9 clang-format: Always align */& in multi-var DeclStmts.
Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identifier.

llvm-svn: 230903
2015-03-01 18:55:26 +00:00
Johannes Doerfert de4a0fd813 [Refactor] Include explicitly what is used
llvm-svn: 230902
2015-03-01 18:51:51 +00:00
Johannes Doerfert f32d651df6 [Refactor] Include explicitly what is used
llvm-svn: 230901
2015-03-01 18:45:58 +00:00
Johannes Doerfert f94d5178a5 [Refactor] Remove Scop * member to simplify JSON class
llvm-svn: 230900
2015-03-01 18:44:57 +00:00
Johannes Doerfert 2495cfe01d [Refactor] Simplify ScopPass interface
llvm-svn: 230899
2015-03-01 18:43:50 +00:00
Johannes Doerfert 909a3bf21d [Refactor] Use virtual and override appropriately
+ Add override for overwritten methods.
  + Remove virtual for methods we do not want to be overwritten.

llvm-svn: 230898
2015-03-01 18:42:08 +00:00
Johannes Doerfert 3fe584d64f [Refactor] Add a Scop & as argument to printScop
This is the first step in the interface simplification.

llvm-svn: 230897
2015-03-01 18:40:25 +00:00
Johannes Doerfert 0200f2507e [Cleanup] Remove unused passes
llvm-svn: 230896
2015-03-01 18:38:35 +00:00
Benjamin Kramer 8ec82e88c3 Make VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
There are static variables of this around that we really want to go
into a read-only segment. Sadly compilers are not smart enough to figure
that out without constexpr.

llvm-svn: 230895
2015-03-01 18:10:07 +00:00
Benjamin Kramer 7149aabf8b Make some non-constant static variables non-static or fully const.
Otherwise we have to emit thread-safe initialization for them. NFC.

llvm-svn: 230894
2015-03-01 18:09:56 +00:00
Benjamin Kramer e0ca6e1375 Sema: Remove stray static
This is a real bug if the code path is ever used with different pointer
sizes in the same process.

llvm-svn: 230893
2015-03-01 18:09:50 +00:00