platform/upstream/llvm.git
9 years agoDetect malformed YAML sequence in yaml::Input::beginSequence()
Justin Bogner [Mon, 2 Mar 2015 17:26:43 +0000 (17:26 +0000)]
Detect malformed YAML sequence in yaml::Input::beginSequence()

When reading a yaml::SequenceTraits object, YAMLIO does not report an
error if the yaml item is not a sequence. Instead, YAMLIO reads an
empty sequence. For example:

---
seq:
    foo: 1
    bar: 2
...

If `seq` is a SequenceTraits object, then reading the above yaml will
yield `seq` as an empty sequence.

Fix this to report an error for the above mapping ("not a sequence")

Patch by William Fisher. Thanks!

llvm-svn: 230976

9 years agoRefactor DebugLocDWARFExpression so it doesn't require access to the
Adrian Prantl [Mon, 2 Mar 2015 17:21:06 +0000 (17:21 +0000)]
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.

This reapplies 230930 with a relaxed assertion in DebugLocEntry::finalize()
that allows for empty DWARF expressions for constant FP values.

llvm-svn: 230975

9 years ago[asan] Demote "trying to poison/unpoison memory region" messages...
Sergey Matveev [Mon, 2 Mar 2015 17:13:38 +0000 (17:13 +0000)]
[asan] Demote "trying to poison/unpoison memory region" messages...

... to verbosity level 3. Because log spam.

llvm-svn: 230974

9 years agoAccidentaly inverted the condition again. Sorry.
Benjamin Kramer [Mon, 2 Mar 2015 16:45:08 +0000 (16:45 +0000)]
Accidentaly inverted the condition again. Sorry.

llvm-svn: 230973

9 years agoAvoid assertion in MSVC 2013 debug builds.
Benjamin Kramer [Mon, 2 Mar 2015 16:42:56 +0000 (16:42 +0000)]
Avoid assertion in MSVC 2013 debug builds.

llvm-svn: 230972

9 years agoCodeGen: Fix passing of classes with only one AVX vector member in AVX registers
Benjamin Kramer [Mon, 2 Mar 2015 16:09:24 +0000 (16:09 +0000)]
CodeGen: Fix passing of classes with only one AVX vector member in AVX registers

isSingleElementStruct was a bit too tight in its definition of struct
so we got a mismatch between classify() and the actual code generation.
To make matters worse the code in GetByteVectorType still defaulted to
<2 x double> if it encountered a type it didn't know, making this a
silent miscompilation (PR22753).

Completely remove the "preferred type" stuff from GetByteVectorType and
make it fail an assertion if someone tries to use it with a type not
suitable for a vector register.

llvm-svn: 230971

9 years agoImplement step builtin
Tom Stellard [Mon, 2 Mar 2015 15:29:41 +0000 (15:29 +0000)]
Implement step builtin

This has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 230970

9 years agoImplement smoothstep builtin v2
Tom Stellard [Mon, 2 Mar 2015 15:29:39 +0000 (15:29 +0000)]
Implement smoothstep builtin v2

This has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Fix typo in smoothstep.h

llvm-svn: 230969

9 years agoImplement radians builtin v2
Tom Stellard [Mon, 2 Mar 2015 15:29:37 +0000 (15:29 +0000)]
Implement radians builtin v2

This has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Move to the common/ directory

llvm-svn: 230968

9 years agoImplement degrees builtin v2
Tom Stellard [Mon, 2 Mar 2015 15:29:35 +0000 (15:29 +0000)]
Implement degrees builtin v2

This has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Move to the common/ directory

llvm-svn: 230967

9 years agoAsmWriter: Only print one space after the load type
Benjamin Kramer [Mon, 2 Mar 2015 15:24:41 +0000 (15:24 +0000)]
AsmWriter: Only print one space after the load type

Before: %x = load i32,  i32* %i
After:  %x = load i32, i32* %i

Purely cosmetic, so no new test case.

llvm-svn: 230966

9 years agoSLPVectorizer: Rewrite ArrayRef slice compare to be more idiomatic.
Benjamin Kramer [Mon, 2 Mar 2015 15:24:36 +0000 (15:24 +0000)]
SLPVectorizer: Rewrite ArrayRef slice compare to be more idiomatic.

NFC intended.

llvm-svn: 230965

9 years agoTblGen: Remove copy of SmallVector::operator==. NFC intended.
Benjamin Kramer [Mon, 2 Mar 2015 15:24:30 +0000 (15:24 +0000)]
TblGen: Remove copy of SmallVector::operator==. NFC intended.

llvm-svn: 230964

9 years agoReduce the number of components initialized by lldb-server to reduce static binary...
Robert Flack [Mon, 2 Mar 2015 15:14:50 +0000 (15:14 +0000)]
Reduce the number of components initialized by lldb-server to reduce static binary size.

Separate out the necessary component initialization for lldb-server such that the linker can greatly reduce the binary size. With this patch the size of lldb-server on my 64 bit linux release build drops from 46MB to 26MB.

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

llvm-svn: 230963

9 years agoAVX-512: Add assembly parser support for Rounding mode
Elena Demikhovsky [Mon, 2 Mar 2015 15:00:34 +0000 (15:00 +0000)]
AVX-512: Add assembly parser support for Rounding mode
By Asaf Badouh <asaf.badouh@intel.com>

llvm-svn: 230962

9 years ago[ASan/Win] Rename a test.
Timur Iskhodzhanov [Mon, 2 Mar 2015 14:49:44 +0000 (14:49 +0000)]
[ASan/Win] Rename a test.

I came up with the original name trying to test a different issue and forgot to rename afterwards

llvm-svn: 230961

9 years agoDo not model scalar accesses in non-affine subregions
Johannes Doerfert [Mon, 2 Mar 2015 14:06:01 +0000 (14:06 +0000)]
Do not model scalar accesses in non-affine subregions

  If a scalar was defined and used only in a non-affine subregion we do
  not need to model the accesses. However, if the scalar was defined
  inside the region and escapes the region we have to model the access.
  The same is true if the scalar was defined outside and used inside the
  region.

llvm-svn: 230960

9 years ago[FIX] Make parallel codegen aware of region statements
Johannes Doerfert [Mon, 2 Mar 2015 13:41:53 +0000 (13:41 +0000)]
[FIX] Make parallel codegen aware of region statements

llvm-svn: 230959

9 years agoFix build breakage on win7-msvc caused by r230955
Pavel Labath [Mon, 2 Mar 2015 13:39:39 +0000 (13:39 +0000)]
Fix build breakage on win7-msvc caused by r230955

llvm-svn: 230958

9 years agoNVPTX: Remove dead code.
Benjamin Kramer [Mon, 2 Mar 2015 13:16:28 +0000 (13:16 +0000)]
NVPTX: Remove dead code.

Fun fact: This file was never referenced since the initial checkin of
the NVPTX backend.

llvm-svn: 230957

9 years ago[mips] Optimize conditional moves where RHS is zero.
Vasileios Kalintiris [Mon, 2 Mar 2015 12:47:32 +0000 (12:47 +0000)]
[mips] Optimize conditional moves where RHS is zero.

Summary:
When the RHS of a conditional move node is zero, we can utilize the $zero
register by inverting the conditional move instruction and by swapping the
order of its True/False operands.

Reviewers: dsanders

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

llvm-svn: 230956

9 years agoFix handling of backslashes in Args parsing
Pavel Labath [Mon, 2 Mar 2015 12:46:22 +0000 (12:46 +0000)]
Fix handling of backslashes in Args parsing

Summary:
Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the
backslash itself is not removed from the argument, nor there is a way to escape the backslash
itself. This leads to surprising results:

"a b" c"   -> 'a b', 'c'  # Here we actually have an unterminated quote, but that is ignored
"a b\" c"  -> 'a b\" c'   # We try to escape the quote. That works but the backslash is not removed.
"a b\\" c" -> 'a b\\" c'  # Escaping the backslash has no effect.

This change changes quote handling to be more shell-like:
- single quotes and backquotes are literal and there is no way to escape the closing quote or
  anything else inside;
- inside double quotes you can use backslash to escape the closing quote and another backslash
- outside any quotes, you can use backslash to escape quotes, spaces and itself.

This makes the parsing more consistent with what the user is familiar and increases the
probability that pasting the command line from shell to the "process launch" command "just work".

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 230955

9 years agoAVX-512: Simplified MOV patterns, no functional changes.
Elena Demikhovsky [Mon, 2 Mar 2015 12:46:21 +0000 (12:46 +0000)]
AVX-512: Simplified MOV patterns, no functional changes.

llvm-svn: 230954

9 years ago[llgo] debug: create replaceable type through DIBuilder
Andrew Wilkins [Mon, 2 Mar 2015 12:42:45 +0000 (12:42 +0000)]
[llgo] debug: create replaceable type through DIBuilder

Summary:
llgo was asserting in DebugInfo, which was interpreting
the temporary MDNodes we were creating as DIScopes instead
of DITypes (in DIScope::getRef).

This proposal changes llgo to use DIBuilder's
createReplaceableCompositeType method to create a DIType
that can be RAUW'd.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 230953

9 years ago[clang-tidy] Refactor: Move llvm clang-tidy checks to namespace clang::tidy::llvm
Alexander Kornienko [Mon, 2 Mar 2015 12:39:18 +0000 (12:39 +0000)]
[clang-tidy] Refactor: Move llvm clang-tidy checks to namespace clang::tidy::llvm

clang-tidy checks are organized into modules. This refactoring moves the llvm
module checks to clang::tidy::llvm

http://reviews.llvm.org/D7995

Patch by Richard Thomson!

llvm-svn: 230952

9 years agobindings/go: expose DIBuilder::createReplaceableCompositeType
Andrew Wilkins [Mon, 2 Mar 2015 12:27:04 +0000 (12:27 +0000)]
bindings/go: expose DIBuilder::createReplaceableCompositeType

Summary:
We extend the DIBuilder type, adding a method for creating
replaceable composite types. This is necessary for creating
debug info describing self-referential types.

Reviewers: pcc

Reviewed By: pcc

Subscribers: axw, llvm-commits

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

llvm-svn: 230951

9 years ago[clang-tidy] Refactor: Move misc clang-tidy checks to namespace clang::tidy::misc
Alexander Kornienko [Mon, 2 Mar 2015 12:25:03 +0000 (12:25 +0000)]
[clang-tidy] Refactor: Move misc clang-tidy checks to namespace clang::tidy::misc

clang-tidy checks are organized into modules. This refactoring moves the misc
module checks into the namespace clang::tidy::misc

http://reviews.llvm.org/D7996

Patch by Richard Thomson!

llvm-svn: 230950

9 years agoReplace loop with equivalent ArrayRef function. NFC.
Benjamin Kramer [Mon, 2 Mar 2015 11:57:06 +0000 (11:57 +0000)]
Replace loop with equivalent ArrayRef function. NFC.

llvm-svn: 230949

9 years agoSimplify code. NFC.
Benjamin Kramer [Mon, 2 Mar 2015 11:57:04 +0000 (11:57 +0000)]
Simplify code. NFC.

llvm-svn: 230948

9 years ago[clang-tidy] Organized clang-tidy unit tests. NFC.
Alexander Kornienko [Mon, 2 Mar 2015 11:55:04 +0000 (11:55 +0000)]
[clang-tidy] Organized clang-tidy unit tests. NFC.

  * Moved unit tests for BracesAroundStatementsCheck to
    ReadabilityModuleTest.cpp.
  * Moved EXPECT_NO_CHANGES macro to ClangTidyTest.h to avoid defining it three
    times.

llvm-svn: 230947

9 years ago[clang-tidy] Refactor: Move readability checks to namespace clang::tidy::readability
Alexander Kornienko [Mon, 2 Mar 2015 11:43:00 +0000 (11:43 +0000)]
[clang-tidy] Refactor: Move readability checks to namespace clang::tidy::readability

clang-tidy checks are organized into modules. This refactoring moves the
readability module checks into the namespace clang::tidy::readability

http://reviews.llvm.org/D7997

Patch by Richard Thomson!

llvm-svn: 230946

9 years agoMake it possible to stop the operation thread in NativeProcessLinux
Tamas Berghammer [Mon, 2 Mar 2015 11:04:03 +0000 (11:04 +0000)]
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

9 years agoRename CMIDriver::LocalDebugSessionStartupInjectCommands to CMIDriver::LocalDebugSess...
Ilia K [Mon, 2 Mar 2015 10:58:02 +0000 (10:58 +0000)]
Rename CMIDriver::LocalDebugSessionStartupInjectCommands to CMIDriver::LocalDebugSessionStartupExecuteCommands after r230003

llvm-svn: 230944

9 years ago[clang-tidy] Assert related checkers
Alexander Kornienko [Mon, 2 Mar 2015 10:46:43 +0000 (10:46 +0000)]
[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

9 years agoclang-format: Prefer wrapping a lambda's body over the lambda's return type.
Daniel Jasper [Mon, 2 Mar 2015 10:35:13 +0000 (10:35 +0000)]
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

9 years agoTeach the verifier to enforce that the alignment argument of memory intrinsics must...
Owen Anderson [Mon, 2 Mar 2015 09:35:06 +0000 (09:35 +0000)]
Teach the verifier to enforce that the alignment argument of memory intrinsics must be a power of 2.

llvm-svn: 230941

9 years agoTeach DataLayout that alignments on basic types must be powers of two.
Owen Anderson [Mon, 2 Mar 2015 09:35:03 +0000 (09:35 +0000)]
Teach DataLayout that alignments on basic types must be powers of two.

Fixes assertion failures/crashes on bad datalayout specifications.

llvm-svn: 230940

9 years agoTeach DataLayout that ABI alignments for non-aggregate types must be non-zero.
Owen Anderson [Mon, 2 Mar 2015 09:34:59 +0000 (09:34 +0000)]
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

9 years agoTeach DataLayout that pointer ABI and preferred alignments are required to be powers...
Owen Anderson [Mon, 2 Mar 2015 06:33:51 +0000 (06:33 +0000)]
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

9 years agoUpdate the list of relocations that need to be implemented.
Davide Italiano [Mon, 2 Mar 2015 06:17:38 +0000 (06:17 +0000)]
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

9 years agoTeach DataLayout that zero-byte pointer sizes don't make sense.
Owen Anderson [Mon, 2 Mar 2015 06:00:02 +0000 (06:00 +0000)]
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

9 years agoTeach the LLParser to fail gracefully when it encounters an invalid label name.
Owen Anderson [Mon, 2 Mar 2015 05:25:09 +0000 (05:25 +0000)]
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

9 years agoFix a crash in the LL parser where it failed to validate that the pointer operand...
Owen Anderson [Mon, 2 Mar 2015 05:25:06 +0000 (05:25 +0000)]
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

9 years ago[llvm-pdbdump] Many minor fixes and improvements
Zachary Turner [Mon, 2 Mar 2015 04:39:56 +0000 (04:39 +0000)]
[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

9 years agoRevert r230930, it caused PR22747.
Nico Weber [Mon, 2 Mar 2015 04:37:11 +0000 (04:37 +0000)]
Revert r230930, it caused PR22747.

llvm-svn: 230932

9 years ago[X86] There are only 8 mask registers. Fail disassembly if instruction tries to refer...
Craig Topper [Mon, 2 Mar 2015 03:33:11 +0000 (03:33 +0000)]
[X86] There are only 8 mask registers. Fail disassembly if instruction tries to reference more.

llvm-svn: 230931

9 years agoRefactor DebugLocDWARFExpression so it doesn't require access to the
Adrian Prantl [Mon, 2 Mar 2015 02:38:18 +0000 (02:38 +0000)]
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

9 years agoRevert r230921, "Revert some changes that were made to fix PR20680.", for now.
NAKAMURA Takumi [Mon, 2 Mar 2015 01:14:03 +0000 (01:14 +0000)]
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

9 years agoFix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change.
Nico Weber [Mon, 2 Mar 2015 01:12:28 +0000 (01:12 +0000)]
Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change.

llvm-svn: 230928

9 years agoAdd another missing header that used to be included transitively.
Benjamin Kramer [Mon, 2 Mar 2015 01:08:07 +0000 (01:08 +0000)]
Add another missing header that used to be included transitively.

llvm-svn: 230927

9 years agollvm/examples: Add missing include according to r230907.
NAKAMURA Takumi [Mon, 2 Mar 2015 01:04:34 +0000 (01:04 +0000)]
llvm/examples: Add missing include according to r230907.

llvm-svn: 230926

9 years agoAdd missing includes for make_unique, lld edition.
Benjamin Kramer [Mon, 2 Mar 2015 00:48:06 +0000 (00:48 +0000)]
Add missing includes for make_unique, lld edition.

llvm-svn: 230925

9 years ago[X86] Fix diassembler crash on AVX512 cmpps/cmppd with immediate that doesn't fit...
Craig Topper [Mon, 2 Mar 2015 00:22:29 +0000 (00:22 +0000)]
[X86] Fix diassembler crash on AVX512 cmpps/cmppd with immediate that doesn't fit in 5-bits. Fixes PR22743.

llvm-svn: 230924

9 years ago[AArch64] fix an invalid-iterator-use bug.
Sanjoy Das [Mon, 2 Mar 2015 00:17:18 +0000 (00:17 +0000)]
[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

9 years agoFix a really bad typo in my last commit.
Benjamin Kramer [Sun, 1 Mar 2015 23:56:19 +0000 (23:56 +0000)]
Fix a really bad typo in my last commit.

llvm-svn: 230922

9 years agoRevert some changes that were made to fix PR20680.
Sanjoy Das [Sun, 1 Mar 2015 23:36:26 +0000 (23:36 +0000)]
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

9 years agoArrayRef: Put back std::equal for operator== with a check for the empty ArrayRefs
Benjamin Kramer [Sun, 1 Mar 2015 23:35:20 +0000 (23:35 +0000)]
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

9 years agoLinux - debugging of local processes via lldb-gdbserver
Vince Harron [Sun, 1 Mar 2015 23:21:29 +0000 (23:21 +0000)]
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

9 years agoAnother missing include for MSVC.
Benjamin Kramer [Sun, 1 Mar 2015 22:34:04 +0000 (22:34 +0000)]
Another missing include for MSVC.

llvm-svn: 230918

9 years agoDebugInfo: Give externally defined types a size and alignment where
Peter Collingbourne [Sun, 1 Mar 2015 22:07:04 +0000 (22:07 +0000)]
DebugInfo: Give externally defined types a size and alignment where
possible. Fixes PR22736.

llvm-svn: 230914

9 years agostd::function is part of <functional>, not <utility>
Benjamin Kramer [Sun, 1 Mar 2015 21:49:21 +0000 (21:49 +0000)]
std::function is part of <functional>, not <utility>

llvm-svn: 230913

9 years agoAdd another missing include for MSVC.
Benjamin Kramer [Sun, 1 Mar 2015 21:47:46 +0000 (21:47 +0000)]
Add another missing include for MSVC.

llvm-svn: 230912

9 years agoX86: Replace variadic function with init list. NFC.
Benjamin Kramer [Sun, 1 Mar 2015 21:47:40 +0000 (21:47 +0000)]
X86: Replace variadic function with init list. NFC.

llvm-svn: 230911

9 years agoAdd missing include.
Benjamin Kramer [Sun, 1 Mar 2015 21:36:40 +0000 (21:36 +0000)]
Add missing include.

llvm-svn: 230910

9 years agoAdd missing includes. make_unique proliferated everywhere.
Benjamin Kramer [Sun, 1 Mar 2015 21:28:53 +0000 (21:28 +0000)]
Add missing includes. make_unique proliferated everywhere.

llvm-svn: 230909

9 years ago[PBQP] Address post-commit style comment for r230904. NFC.
Arnaud A. de Grandmaison [Sun, 1 Mar 2015 21:22:50 +0000 (21:22 +0000)]
[PBQP] Address post-commit style comment for r230904. NFC.

Thanks David !

llvm-svn: 230908

9 years agoArrayRef: Remove the equals helper with many arguments.
Benjamin Kramer [Sun, 1 Mar 2015 21:05:05 +0000 (21:05 +0000)]
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

9 years agoAdvertise 32 bit support for PlatformRemoteGDBServer on 64 bit systems.
Chaoren Lin [Sun, 1 Mar 2015 20:48:18 +0000 (20:48 +0000)]
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

9 years agoRevert "PECOFF: Don't parse files in .drectve asynchronously."
Rui Ueyama [Sun, 1 Mar 2015 20:48:14 +0000 (20:48 +0000)]
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

9 years ago[PBQP] Do not add an edge between nodes with totally disjoint allowed registers
Arnaud A. de Grandmaison [Sun, 1 Mar 2015 20:39:34 +0000 (20:39 +0000)]
[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

9 years agoclang-format: Always align */& in multi-var DeclStmts.
Daniel Jasper [Sun, 1 Mar 2015 18:55:26 +0000 (18:55 +0000)]
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

9 years ago[Refactor] Include explicitly what is used
Johannes Doerfert [Sun, 1 Mar 2015 18:51:51 +0000 (18:51 +0000)]
[Refactor] Include explicitly what is used

llvm-svn: 230902

9 years ago[Refactor] Include explicitly what is used
Johannes Doerfert [Sun, 1 Mar 2015 18:45:58 +0000 (18:45 +0000)]
[Refactor] Include explicitly what is used

llvm-svn: 230901

9 years ago[Refactor] Remove Scop * member to simplify JSON class
Johannes Doerfert [Sun, 1 Mar 2015 18:44:57 +0000 (18:44 +0000)]
[Refactor] Remove Scop * member to simplify JSON class

llvm-svn: 230900

9 years ago[Refactor] Simplify ScopPass interface
Johannes Doerfert [Sun, 1 Mar 2015 18:43:50 +0000 (18:43 +0000)]
[Refactor] Simplify ScopPass interface

llvm-svn: 230899

9 years ago[Refactor] Use virtual and override appropriately
Johannes Doerfert [Sun, 1 Mar 2015 18:42:08 +0000 (18:42 +0000)]
[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

9 years ago[Refactor] Add a Scop & as argument to printScop
Johannes Doerfert [Sun, 1 Mar 2015 18:40:25 +0000 (18:40 +0000)]
[Refactor] Add a Scop & as argument to printScop

  This is the first step in the interface simplification.

llvm-svn: 230897

9 years ago[Cleanup] Remove unused passes
Johannes Doerfert [Sun, 1 Mar 2015 18:38:35 +0000 (18:38 +0000)]
[Cleanup] Remove unused passes

llvm-svn: 230896

9 years agoMake VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
Benjamin Kramer [Sun, 1 Mar 2015 18:10:07 +0000 (18:10 +0000)]
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

9 years agoMake some non-constant static variables non-static or fully const.
Benjamin Kramer [Sun, 1 Mar 2015 18:09:56 +0000 (18:09 +0000)]
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

9 years agoSema: Remove stray static
Benjamin Kramer [Sun, 1 Mar 2015 18:09:50 +0000 (18:09 +0000)]
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

9 years agoReverted 230471 - gather scatter handling in table gen.
Elena Demikhovsky [Sun, 1 Mar 2015 08:23:41 +0000 (08:23 +0000)]
Reverted 230471 - gather scatter handling in table gen.

llvm-svn: 230892

9 years agoAVX-512: Added mask and rounding mode for scalar arithmetics
Elena Demikhovsky [Sun, 1 Mar 2015 07:44:04 +0000 (07:44 +0000)]
AVX-512: Added mask and rounding mode for scalar arithmetics
Added more tests for scalar instructions to destinguish between AVX and AVX-512 forms.

llvm-svn: 230891

9 years ago[llvm-pdbdump] Fix GCC build.
Zachary Turner [Sun, 1 Mar 2015 06:59:57 +0000 (06:59 +0000)]
[llvm-pdbdump] Fix GCC build.

llvm-svn: 230890

9 years ago[llvm-pdbdump] Clean up method signatures.
Zachary Turner [Sun, 1 Mar 2015 06:51:29 +0000 (06:51 +0000)]
[llvm-pdbdump] Clean up method signatures.

llvm-svn: 230889

9 years ago[llvm-pdbdump] Add regex-based filtering.
Zachary Turner [Sun, 1 Mar 2015 06:49:49 +0000 (06:49 +0000)]
[llvm-pdbdump] Add regex-based filtering.

llvm-svn: 230888

9 years agoFix attaching to 32 bit inferior with 64 bit llgs.
Chaoren Lin [Sun, 1 Mar 2015 04:31:16 +0000 (04:31 +0000)]
Fix attaching to 32 bit inferior with 64 bit llgs.

Summary: Executable module should use inferior architecture instead of host architecture.

Reviewers: ovyalov, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 230887

9 years agoRevert "PECOFF: Temporarily add a lock to un-break buildbot."
Rui Ueyama [Sun, 1 Mar 2015 04:25:04 +0000 (04:25 +0000)]
Revert "PECOFF: Temporarily add a lock to un-break buildbot."

This reverts commit r230086. I added a lock to guard FileCOFF::doParse(),
which killed parallel file parsing. Now the buildbots got back to green,
I believe the threading issue was resolved, so it's time to remove the
guard to see if it works with the buildbots.

llvm-svn: 230886

9 years agoRevert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."
NAKAMURA Takumi [Sun, 1 Mar 2015 04:16:28 +0000 (04:16 +0000)]
Revert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."

It emits *millions of warnings* during selfhosting LTO build, to choke the buildbot with gigbytes of log.

llvm-svn: 230885

9 years agoavoid infinite looping when folding vector multiplies of constants (PR22698)
Sanjay Patel [Sun, 1 Mar 2015 00:09:35 +0000 (00:09 +0000)]
avoid infinite looping when folding vector multiplies of constants (PR22698)

We were missing a check for the following fold in DAGCombiner:

// fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))

If 'x' is also a constant, then we shouldn't do anything. Otherwise, we could end up swapping the operands back and forth forever.

This should fix:
http://llvm.org/bugs/show_bug.cgi?id=22698

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

llvm-svn: 230884

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Sun, 1 Mar 2015 00:02:03 +0000 (00:02 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 230883

9 years agoDebugInfo: Convert DW_OP_piece => DW_OP_bit_piece
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:57:16 +0000 (23:57 +0000)]
DebugInfo: Convert DW_OP_piece => DW_OP_bit_piece

r228631 stopped using `DW_OP_piece` inside `DIExpression`s in the IR,
but it apparently missed updating these testcases.  Caught by verifier
checks for `MDExpression` while working on moving the new hierarchy into
place.

llvm-svn: 230882

9 years agomake the tested feature (SSE2) explicit
Sanjay Patel [Sat, 28 Feb 2015 23:55:24 +0000 (23:55 +0000)]
make the tested feature (SSE2) explicit

llvm-svn: 230881

9 years agoDebugInfo: Fix invalid file reference in CodeGen/X86/unknown-location.ll
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:52:24 +0000 (23:52 +0000)]
DebugInfo: Fix invalid file reference in CodeGen/X86/unknown-location.ll

There are two types of files in the old (current) debug info schema.

    !0 = !{!"some/filename", !"/path/to/dir"}
    !1 = !{!"0x29", !0} ; [ DW_TAG_file_type ]

!1 has a wrapper class called `DIFile` which inherits from `DIScope` and
is referenced in 'scope' fields.

!0 is called a "file node", and debug info nodes with a 'file' field
point at one of these directly -- although they're built in `DIBuilder`
by sending in a `DIFile` and reaching into it.

In the new hierarchy, I unified these nodes as `MDFile` (which `DIFile`
is a lightweight wrapper for) in r230057.  Moving the new hierarchy into
place (and upgrading testcases) caused CodeGen/X86/unknown-location.ll
to start failing -- apparently "0x29" was previously showing up in the
linetable as a filename, causing:

    .loc 2 4 3

(where 2 points at filename "0x29") instead of:

    .loc 1 4 3

(where 1 points at the actual filename).

Change the testcase to use the old schema correctly.

llvm-svn: 230880

9 years agoDebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:48:02 +0000 (23:48 +0000)]
DebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()

Start using `TempMDNode` in `DIDescriptor::replaceAllUsesWith()`
(effectively `std::unique_ptr<MDNode, MDNode::deleteTemporary>`).

Besides making ownership more explicit, this prepares for when
`DIDescriptor` refers to nodes that are *not* `MDTuple`.  The old logic
for "replacing" a node with itself used `MDNode::get()` to return a new
(uniqued) `MDTuple`, while the new logic just defers to
`MDNode::replaceWithUniqued()` (which also typically saves an allocation
and RAUW traffic by mutating the temporary in place).

llvm-svn: 230879

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Sat, 28 Feb 2015 23:47:09 +0000 (23:47 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 230878

9 years agoOptimize metadata node fields for CHECK-ability
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:21:38 +0000 (23:21 +0000)]
Optimize metadata node fields for CHECK-ability

While gaining practical experience hand-updating CHECK lines (for moving
the new debug info hierarchy into place),  I learnt a few things about
CHECK-ability of the specialized node assembly output.

  - The first part of a `CHECK:` is to identify the "right" node (this
    is especially true if you intend to use the new `CHECK-SAME`
    feature, since the first CHECK needs to identify the node correctly
    before you can split the line).
      - If there's a `tag:`, it should go first.
      - If there's a `name:`, it should go next (followed by the
        `linkageName:`, if any).
      - If there's a `scope:`, it should follow after that.
  - When a node type supports multiple DW_TAGs, but one is implied by
    its name and is overwhelmingly more common, the `tag:` field is
    terribly uninteresting unless it's different.
      - `MDBasicType` is almost always `DW_TAG_base_type`.
      - `MDTemplateValueParameter` is almost always
        `DW_TAG_template_value_parameter`.
  - Printing `name: ""` doesn't improve CHECK-ability, and there are far
    more nodes than I realized that are commonly nameless.
  - There are a few other fields that similarly aren't very interesting
    when they're empty.

This commit updates the `AsmWriter` as suggested above (and makes
necessary changes in `LLParser` for round-tripping).

llvm-svn: 230877

9 years agofix typo; NFC
Sanjay Patel [Sat, 28 Feb 2015 22:25:06 +0000 (22:25 +0000)]
fix typo; NFC

llvm-svn: 230876

9 years agoAsmWriter: Escape string fields in metadata
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 22:20:16 +0000 (22:20 +0000)]
AsmWriter: Escape string fields in metadata

Properly escape string fields in metadata.  I've added a spot-check with
direct coverage for `MDFile::getFilename()`, but we'll get more coverage
once the hierarchy is moved into place (since this comes up in various
checked-in testcases).

I've replicated the `if` logic using the `ShouldSkipEmpty` flag
(although a follow-up commit is going to change how often this flag is
specified); no NFCI other than escaping the string fields.

llvm-svn: 230875

9 years agoRevert r229678 "tsan: fix signal handling during stop-the-world"
Hans Wennborg [Sat, 28 Feb 2015 22:18:11 +0000 (22:18 +0000)]
Revert r229678  "tsan: fix signal handling during stop-the-world"

This was causing Chromium's browser_tests to flakily segfault during
leak check.

llvm-svn: 230874