platform/upstream/llvm.git
10 years agoDriver: remove a stray s that propagated in cross-windows
Saleem Abdulrasool [Tue, 28 Oct 2014 03:15:02 +0000 (03:15 +0000)]
Driver: remove a stray s that propagated in cross-windows

The option is '--allow-multiple-definition' not '--allow-multiple-definitions'.

llvm-svn: 220760

10 years agoMinimize the scope of some variables, NFC.
David Blaikie [Tue, 28 Oct 2014 02:57:26 +0000 (02:57 +0000)]
Minimize the scope of some variables, NFC.

llvm-svn: 220759

10 years agoX86: Implement the vectorcall calling convention
Reid Kleckner [Tue, 28 Oct 2014 01:29:26 +0000 (01:29 +0000)]
X86: Implement the vectorcall calling convention

This is a Microsoft calling convention that supports both x86 and x86_64
subtargets. It passes vector and floating point arguments in XMM0-XMM5,
and passes them indirectly once they are consumed.

Homogenous vector aggregates of up to four elements can be passed in
sequential vector registers, but this part is not implemented in LLVM
and will be handled in Clang.

On 32-bit x86, it is similar to fastcall in that it uses ecx:edx as
integer register parameters and is callee cleanup. On x86_64, it
delegates to the normal win64 calling convention.

Reviewers: majnemer

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

llvm-svn: 220745

10 years agoAArch64: enable Cortex-A57 FP balancing on Cortex-A53.
Tim Northover [Tue, 28 Oct 2014 01:24:32 +0000 (01:24 +0000)]
AArch64: enable Cortex-A57 FP balancing on Cortex-A53.

Benchmarks have shown that it's harmless to the performance there, and having a
unified set of passes between the two cores where possible helps big.LITTLE
deployment.

Patch by Z. Zheng.

llvm-svn: 220744

10 years agoAdd a test for setting and hitting the C++ Exception throw breakpoint.
Jim Ingham [Tue, 28 Oct 2014 00:53:20 +0000 (00:53 +0000)]
Add a test for setting and hitting the C++ Exception throw breakpoint.

llvm-svn: 220743

10 years agoUpdate for LLVM API change.
Rafael Espindola [Tue, 28 Oct 2014 00:29:51 +0000 (00:29 +0000)]
Update for LLVM API change.

llvm-svn: 220742

10 years agoRemove the PreserveSource linker mode.
Rafael Espindola [Tue, 28 Oct 2014 00:24:16 +0000 (00:24 +0000)]
Remove the PreserveSource linker mode.

I noticed that it was untested, and forcing it on caused some tests to fail:

    LLVM :: Linker/metadata-a.ll
    LLVM :: Linker/prefixdata.ll
    LLVM :: Linker/type-unique-odr-a.ll
    LLVM :: Linker/type-unique-simple-a.ll
    LLVM :: Linker/type-unique-simple2-a.ll
    LLVM :: Linker/type-unique-simple2.ll
    LLVM :: Linker/type-unique-type-array-a.ll
    LLVM :: Linker/unnamed-addr1-a.ll
    LLVM :: Linker/visibility1.ll

If it is to be resurrected, it has to be fixed and we should probably have a
-preserve-source command line option in llvm-mc and run tests with and without
it.

llvm-svn: 220741

10 years agoImprove on the diagnostic in my last patch and change warning
Fariborz Jahanian [Mon, 27 Oct 2014 23:41:04 +0000 (23:41 +0000)]
Improve on the diagnostic in my last patch and change warning
to error. rdar://18768214.

llvm-svn: 220740

10 years agoAArch64InstrInfo.h: Fix a warning introduced in clang r220703. [-Winconsistent-missin...
NAKAMURA Takumi [Mon, 27 Oct 2014 23:29:27 +0000 (23:29 +0000)]
AArch64InstrInfo.h: Fix a warning introduced in clang r220703. [-Winconsistent-missing-override]

llvm-svn: 220739

10 years agoRemove unused variable.
Richard Smith [Mon, 27 Oct 2014 23:25:15 +0000 (23:25 +0000)]
Remove unused variable.

llvm-svn: 220738

10 years ago[AVX512] Add vpermil variable version
Adam Nemet [Mon, 27 Oct 2014 23:08:40 +0000 (23:08 +0000)]
[AVX512] Add vpermil variable version

This is implemented via a multiclass that derives from the vperm imm
multiclass.

Fixes <rdar://problem/18426089>

llvm-svn: 220737

10 years ago[AVX512] Clean up avx512_perm_imm to use X86VectorVTInfo
Adam Nemet [Mon, 27 Oct 2014 23:08:37 +0000 (23:08 +0000)]
[AVX512] Clean up avx512_perm_imm to use X86VectorVTInfo

No functionality change.  No change in X86.td.expanded except that we only set
the CD8 attributes for the memory variants.  (This shouldn't be used unless we
have a memory operand.)

llvm-svn: 220736

10 years ago[AVX512] Derive vpermil* from avx512_perm_imm
Adam Nemet [Mon, 27 Oct 2014 23:08:34 +0000 (23:08 +0000)]
[AVX512] Derive vpermil* from avx512_perm_imm

This used to derive from avx512_pshuf_imm which is confusing.

NFC.  Compared X86.td.expanded.

llvm-svn: 220735

10 years ago[AVX512] Fix copy-and-paste bugs in vpermil
Adam Nemet [Mon, 27 Oct 2014 23:08:31 +0000 (23:08 +0000)]
[AVX512] Fix copy-and-paste bugs in vpermil

1) i512mem -> f512mem (this is the packed FP input being permuted)
2) element size is 64 bits in EVEX_CD8 for PD.

(A good illustration why X86VectorVTInfo is useful)

llvm-svn: 220734

10 years agoUse the newer/simple API for passing a diagnostic handler to the IR linker.
Rafael Espindola [Mon, 27 Oct 2014 23:02:34 +0000 (23:02 +0000)]
Use the newer/simple API for passing a diagnostic handler to the IR linker.

llvm-svn: 220733

10 years agoMake it easier to pass a custom diagnostic handler to the IR linker.
Rafael Espindola [Mon, 27 Oct 2014 23:02:10 +0000 (23:02 +0000)]
Make it easier to pass a custom diagnostic handler to the IR linker.

llvm-svn: 220732

10 years ago[modules] Load .pcm files specified by -fmodule-file lazily.
Richard Smith [Mon, 27 Oct 2014 23:01:16 +0000 (23:01 +0000)]
[modules] Load .pcm files specified by -fmodule-file lazily.

llvm-svn: 220731

10 years agoTMP: fix readN & writeN to not encourage UB
Tim Northover [Mon, 27 Oct 2014 22:48:35 +0000 (22:48 +0000)]
TMP: fix readN & writeN to not encourage UB

llvm-svn: 220730

10 years agoTest that the single-threaded lit feature is available iff the corresponding guard...
Jonathan Roelofs [Mon, 27 Oct 2014 22:39:19 +0000 (22:39 +0000)]
Test that the single-threaded lit feature is available iff the corresponding guard is #defined

http://reviews.llvm.org/D6006

llvm-svn: 220729

10 years agoFix a stackmap bug introduced in r220710.
Pete Cooper [Mon, 27 Oct 2014 22:38:45 +0000 (22:38 +0000)]
Fix a stackmap bug introduced in r220710.

For a call to not return in to the stackmap shadow, the shadow must end with the call.

To do this, we must insert any required nops *before* the call, and not after it.

llvm-svn: 220728

10 years agoObjective-C ARC [qoi]. Issue diagnostic if __bridge casting
Fariborz Jahanian [Mon, 27 Oct 2014 22:33:06 +0000 (22:33 +0000)]
Objective-C ARC [qoi]. Issue diagnostic if __bridge casting
to C type a collection literal. rdar://18768214

llvm-svn: 220727

10 years agoFrontend: Don't include stdin in the dependency list for an object file
David Majnemer [Mon, 27 Oct 2014 22:31:50 +0000 (22:31 +0000)]
Frontend: Don't include stdin in the dependency list for an object file

GCC doesn't do this and it semes weird to include a file that we can't
open.

This fixes PR21362.

llvm-svn: 220726

10 years agoTry to appease the C++ gods
Hans Wennborg [Mon, 27 Oct 2014 22:28:50 +0000 (22:28 +0000)]
Try to appease the C++ gods

Looks like some builds were not happy with the potentially-throwing move
constructor that was added in r220723, and reached for the implicitly
deleted copy constructor instead.

llvm-svn: 220725

10 years agoAdd special case handling of linux target triples that do not contain `-gnu`.
Eric Fiselier [Mon, 27 Oct 2014 22:14:25 +0000 (22:14 +0000)]
Add special case handling of linux target triples that do not contain `-gnu`.

For targets that end it `redhat-linux` and `suse-linux` manually add the `-gnu`
section of the target since `linux-gnu` is needed in the testsuite.

This patch also moves the removal of minor and patchlevel numbers from OSX
triples to be handled when deducing the triple instead of when adding available
features.

llvm-svn: 220724

10 years agoGive TypoExprState a move constructor and assignment operator to appease MSVC build
Hans Wennborg [Mon, 27 Oct 2014 21:50:49 +0000 (21:50 +0000)]
Give TypoExprState a move constructor and assignment operator to appease MSVC build

llvm-svn: 220723

10 years agoAdd test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is defined.
Eric Fiselier [Mon, 27 Oct 2014 21:38:23 +0000 (21:38 +0000)]
Add test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is defined.

llvm-svn: 220722

10 years ago[ScalarEvolution] Guard dump() with #if
Jingyue Wu [Mon, 27 Oct 2014 21:14:41 +0000 (21:14 +0000)]
[ScalarEvolution] Guard dump() with #if

to be consistent with its definition in ScalarEvolution.cpp

llvm-svn: 220721

10 years agoMake sure OTHER_CFLAGS and OTHER_LDFLAGS are inherited from the Xcode project so...
Greg Clayton [Mon, 27 Oct 2014 21:14:34 +0000 (21:14 +0000)]
Make sure OTHER_CFLAGS and OTHER_LDFLAGS are inherited from the Xcode project so you can easily add to the flags of all targets.

llvm-svn: 220720

10 years agoFix segfault in hasDeclContext for nodes that have no decl context.
Samuel Benzaquen [Mon, 27 Oct 2014 20:58:44 +0000 (20:58 +0000)]
Fix segfault in hasDeclContext for nodes that have no decl context.

Summary:
Some declarations do not have a declaration context, like TranslationUnitDecl.
Fix hasDeclContext() to not segfault on these nodes.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 220719

10 years agoThis looks like the actual path under which the builder looks for LLDB headers, so...
Enrico Granata [Mon, 27 Oct 2014 20:31:12 +0000 (20:31 +0000)]
This looks like the actual path under which the builder looks for LLDB headers, so use this path instead

llvm-svn: 220718

10 years agoFix bug where sys::Wait could wait on wrong pid.
Rafael Espindola [Mon, 27 Oct 2014 20:30:04 +0000 (20:30 +0000)]
Fix bug where sys::Wait could wait on wrong pid.

Setting ChildPid to -1 would cause waitpid to wait for any child process.

Patch by Daniel Reynaud!

llvm-svn: 220717

10 years ago[libcxx] use clang's __char16_t and __char32_t definitions on Linux in C++03 mode.
Eric Fiselier [Mon, 27 Oct 2014 20:29:05 +0000 (20:29 +0000)]
[libcxx] use clang's __char16_t and __char32_t definitions on Linux in C++03 mode.

Summary: This fixes ODR violations in C++03 mode in test/localization/locale.stdcvt. The special case for linux was introduced in 2010 before clang always defined __char16_t and __char32_t.

Reviewers: mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

llvm-svn: 220716

10 years agoFix use of operator comma in is_permutation and delete comma operator for test iterators.
Eric Fiselier [Mon, 27 Oct 2014 20:26:25 +0000 (20:26 +0000)]
Fix use of operator comma in is_permutation and delete comma operator for test iterators.

The comma operators in the test iterators give better error messages when they
are deleted as opposed to not defined. Delete these functions when possible.

llvm-svn: 220715

10 years agoFrontend: Define __EXCEPTIONS if -fexceptions is passed
David Majnemer [Mon, 27 Oct 2014 20:02:19 +0000 (20:02 +0000)]
Frontend: Define __EXCEPTIONS if -fexceptions is passed

GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions
is passed.  We should do the same.

This fixes PR21358.

llvm-svn: 220714

10 years ago[FastISel][AArch64] Emit immediate version of icmp (subs) for null pointer check.
Juergen Ributzka [Mon, 27 Oct 2014 19:58:36 +0000 (19:58 +0000)]
[FastISel][AArch64] Emit immediate version of icmp (subs) for null pointer check.

This is a minor change to use the immediate version when the operand is a null
value. This should get rid of an unnecessary 'mov' instruction in debug
builds and align the code more with the one generated by SelectionDAG.

This fixes rdar://problem/18785125.

llvm-svn: 220713

10 years ago[FastISel][AArch64] Optimize compare-and-branch for i1 to use 'tbz'.
Juergen Ributzka [Mon, 27 Oct 2014 19:46:23 +0000 (19:46 +0000)]
[FastISel][AArch64] Optimize compare-and-branch for i1 to use 'tbz'.

Minor enhancement to use 'tbz' for i1 compare-and-branch to get rid of an 'and'
instruction.

This fixes rdar://problem/18784953.

llvm-svn: 220712

10 years agoFix polly formatting after recent clang-format behavior change.
Daniel Jasper [Mon, 27 Oct 2014 19:45:31 +0000 (19:45 +0000)]
Fix polly formatting after recent clang-format behavior change.

llvm-svn: 220711

10 years agoStackmap shadows should consider call returns a branch target.
Pete Cooper [Mon, 27 Oct 2014 19:40:35 +0000 (19:40 +0000)]
Stackmap shadows should consider call returns a branch target.

To avoid emitting too many nops, a stackmap shadow can include emitted instructions in the shadow, but these must not include branch targets.

A return from a call should count as a branch target as patching over the instructions after the call would lead to incorrect behaviour for threads currently making that call, when they return.

llvm-svn: 220710

10 years ago[FastISel][AArch64] Use 'cbz' also for null values (pointers).
Juergen Ributzka [Mon, 27 Oct 2014 19:38:05 +0000 (19:38 +0000)]
[FastISel][AArch64] Use 'cbz' also for null values (pointers).

The pattern matching for a 'ConstantInt' value was too restrictive. Checking for
a 'Constant' with a bull value is sufficient for using an 'cbz/cbnz' instruction.

This fixes rdar://problem/18784732.

llvm-svn: 220709

10 years agoDo not insert asan paddings after fields that have flexible arrays.
Kostya Serebryany [Mon, 27 Oct 2014 19:34:10 +0000 (19:34 +0000)]
Do not insert asan paddings after fields that have flexible arrays.

Summary:
We should avoid a tail padding not only if the last field
has zero size but also if the last field is a struct with a flexible array.

If/when http://reviews.llvm.org/D5478 is committed,
this will also handle the case of structs with zero-sized arrays.

Reviewers: majnemer, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 220708

10 years ago[libcxx] Remove use of uniform initialization from regex tests so that they compile...
Eric Fiselier [Mon, 27 Oct 2014 19:29:32 +0000 (19:29 +0000)]
[libcxx] Remove use of uniform initialization from regex tests so that they compile in C++03.

Reviewers: danalbert, jroelofs, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 220707

10 years ago[libcxx] Fix use of operator comma where the types can be user defined
Eric Fiselier [Mon, 27 Oct 2014 19:28:20 +0000 (19:28 +0000)]
[libcxx] Fix use of operator comma where the types can be user defined

Summary:
An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected.
Modify all the test iterators to define operator comma.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 220706

10 years agoStub out 'close' call on m_master_fd for Windows.
Hafiz Abid Qadeer [Mon, 27 Oct 2014 19:27:00 +0000 (19:27 +0000)]
Stub out 'close' call on m_master_fd for Windows.

PseudoTerminal.cpp uses a dummy implementation of posix_openpt for Windows. This
implementation just returns 0. So m_master_fd is 0. But destructor calls 'close'
on m_master_fd. This 'close' calls seems un-necessary as m_master_fd was never
opened in first place and calling 'close' on 0 can have other un-intended
consequences.

I am committing it as obvious as it is only a one-liner. Long term, we may want
to refactor this class.

llvm-svn: 220705

10 years ago[FastISel][AArch64] Don't fold the 'and' instruction into the 'tbz/tbnz' instruction...
Juergen Ributzka [Mon, 27 Oct 2014 19:16:48 +0000 (19:16 +0000)]
[FastISel][AArch64] Don't fold the 'and' instruction into the 'tbz/tbnz' instruction if it is in a different basic block.

This fixes a bug where the input register was not defined for the 'tbz/tbnz'
instruction. This happened, because we folded the 'and' instruction from a
different basic block.

This fixes rdar://problem/18784013.

llvm-svn: 220704

10 years agoc++11 patch to issue warning on missing 'override' on
Fariborz Jahanian [Mon, 27 Oct 2014 19:11:51 +0000 (19:11 +0000)]
c++11 patch to issue warning on missing 'override' on
overriding methods. Patch review by Richard Smith.
rdar://18295240

llvm-svn: 220703

10 years agoPR #21321 talked about implementation-defined behavior of realloc. I poo-poohed it...
Marshall Clow [Mon, 27 Oct 2014 19:08:10 +0000 (19:08 +0000)]
PR #21321 talked about implementation-defined behavior of realloc. I poo-poohed it, and was wrong. Fix the call in <locale>. Review the others, refactored some duplicated code, and found overflow bugs (and __event_cap_ was never getting updated, either).

llvm-svn: 220702

10 years ago[FastISel][AArch64] Fix load/store with frame indices.
Juergen Ributzka [Mon, 27 Oct 2014 18:21:58 +0000 (18:21 +0000)]
[FastISel][AArch64] Fix load/store with frame indices.

At higher optimization levels the LLVM IR may contain more complex patterns for
loads/stores from/to frame indices. The 'computeAddress' function wasn't able to
handle this and triggered an assertion.

This fix extends the possible addressing modes for frame indices.

This fixes rdar://problem/18783298.

llvm-svn: 220700

10 years ago[asan] experimental tracing for indirect calls, llvm part.
Kostya Serebryany [Mon, 27 Oct 2014 18:13:56 +0000 (18:13 +0000)]
[asan] experimental tracing for indirect calls, llvm part.

llvm-svn: 220699

10 years agoWire up LookupMemberExpr to use the new TypoExpr.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:46 +0000 (18:07 +0000)]
Wire up LookupMemberExpr to use the new TypoExpr.

This includes adding the new TypoExpr-based lazy typo correction to
LookupMemberExprInRecord as an alternative to the existing eager typo
correction.

llvm-svn: 220698

10 years agoAdd a callback for recovering using a typo correction.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:42 +0000 (18:07 +0000)]
Add a callback for recovering using a typo correction.

Also keep track of the stack of Exprs visited during the tree transform
so the callback can be passed the parent of the TypoExpr.

llvm-svn: 220697

10 years agoAdd simple way for a CorrectionCandidateCallback to reject exact
Kaelyn Takata [Mon, 27 Oct 2014 18:07:40 +0000 (18:07 +0000)]
Add simple way for a CorrectionCandidateCallback to reject exact
matches of the typo.

Also be more proactive about checking a correction's visibility so that
a correction requiring a module import can be distinguished from the
original typo even if it looks identical. Otherwise the correction will
be excluded and the diagnostic about needing the module import won't be
emitted.

Note that no change was made to checkCorrectionVisibility other than
moving where it is at in SemaLookup.cpp.

llvm-svn: 220696

10 years agoStart adding the infrastructure for handling TypoExprs.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:37 +0000 (18:07 +0000)]
Start adding the infrastructure for handling TypoExprs.

Part of the infrastructure is a map from a TypoExpr to the Sema-specific
state needed to correct it, along with helpers to ease dealing with the
state.

The the typo count is propagated up the stack of
ExpressionEvaluationContextRecords when one is popped off of to
avoid accidentally dropping TypoExprs on the floor. For example,
the attempted correction of g() in test/CXX/class/class.mem/p5-0x.cpp
happens with an ExpressionEvaluationContextRecord that is popped off
the stack prior to ActOnFinishFullExpr being called and the tree
transform for TypoExprs being run.

llvm-svn: 220695

10 years agoHave TypoCorrectionConsumer remember the TypoCorrections it returned.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:34 +0000 (18:07 +0000)]
Have TypoCorrectionConsumer remember the TypoCorrections it returned.

Two additional methods are provided: one to return the current
correction (the last correction returned by getNextCorrection), and one
to "reset" the state so that getNextCorrection will return the previous
corrections before returning any new corrections.

Also ensure that all TypoCorrections have valid source ranges.

llvm-svn: 220694

10 years agoPass around CorrectionCandidateCallbacks as unique_ptrs so
Kaelyn Takata [Mon, 27 Oct 2014 18:07:29 +0000 (18:07 +0000)]
Pass around CorrectionCandidateCallbacks as unique_ptrs so
TypoCorrectionConsumer can keep the callback around as long as needed.

llvm-svn: 220693

10 years agoAdd the initial TypoExpr AST node for delayed typo correction.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:20 +0000 (18:07 +0000)]
Add the initial TypoExpr AST node for delayed typo correction.

llvm-svn: 220692

10 years agoMove TypoCorrectionConsumer into a header.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:13 +0000 (18:07 +0000)]
Move TypoCorrectionConsumer into a header.

This makes it available outside of SemaLookup.cpp, as
needed for the forthcoming TypoExpr AST node which will
keep a TypoCorrectionConsumer that provides the possible
typo corrections for that TypoExpr.

llvm-svn: 220691

10 years ago[PBQP] Remove a spurious 'typename' keyword. This was causing an error on MSVC.
Lang Hames [Mon, 27 Oct 2014 17:59:51 +0000 (17:59 +0000)]
[PBQP] Remove a spurious 'typename' keyword. This was causing an error on MSVC.

llvm-svn: 220690

10 years ago[PBQP] Clarify ambiguous-looking typedef.
Lang Hames [Mon, 27 Oct 2014 17:52:05 +0000 (17:52 +0000)]
[PBQP] Clarify ambiguous-looking typedef.

This was causing an error on the hexagon bots.

llvm-svn: 220689

10 years ago[PBQP] Unique allowed-sets for nodes in the PBQP graph and use pairs of these
Lang Hames [Mon, 27 Oct 2014 17:44:25 +0000 (17:44 +0000)]
[PBQP] Unique allowed-sets for nodes in the PBQP graph and use pairs of these
sets as keys into a cache of interference matrice values in the Interference
constraint adder.

Creating interference matrices was one of the large remaining time-sinks in
PBQP. Caching them reduces the total compile time (when using PBQP) on the
nightly test suite by ~10%.

llvm-svn: 220688

10 years agoAdd MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVect...
Michael Gottesman [Mon, 27 Oct 2014 17:20:53 +0000 (17:20 +0000)]
Add MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVector::end().

These just delegate to the underlying vector type in the MapVector.

Also just add in some sanity unittests.

llvm-svn: 220687

10 years agoclang-format: Don't break after very short return types.
Daniel Jasper [Mon, 27 Oct 2014 17:13:59 +0000 (17:13 +0000)]
clang-format: Don't break after very short return types.

Before:
  void
  SomeFunction(int parameter);

After:
  void SomeFunction(
      int parameter);

(Unless AlwaysBreakAfterDefinitionReturnType after type is set).

llvm-svn: 220686

10 years agoclang-format: improve vim integration docs
Saleem Abdulrasool [Mon, 27 Oct 2014 17:13:33 +0000 (17:13 +0000)]
clang-format: improve vim integration docs

Improve the documentation for vim integration of clang-format.  Prefer the use
of <c-o> to do the normal mode command execution to avoid side-effects of the
escape and re-insertion (cursor movement).  Tweak the macros to use a double
return to avoid having to manually return control to the editor from the
subprocess.

llvm-svn: 220685

10 years agoclang-format: Fix bad merging of lines in nested blocks.
Daniel Jasper [Mon, 27 Oct 2014 16:31:46 +0000 (16:31 +0000)]
clang-format: Fix bad merging of lines in nested blocks.

Before:
  SomeFunction([]() {
  #define A a
    return 43; });

After:
  SomeFunction([]() {
  #define A a
    return 43;
  });

llvm-svn: 220684

10 years agoUnbreak the darwin build.
Adrian Prantl [Mon, 27 Oct 2014 16:20:59 +0000 (16:20 +0000)]
Unbreak the darwin build.
Patch by Ismail Pazarbasi!

llvm-svn: 220683

10 years agoSpeed up clang-tidy when profiling in on.
Samuel Benzaquen [Mon, 27 Oct 2014 15:22:59 +0000 (15:22 +0000)]
Speed up clang-tidy when profiling in on.

Summary:
Speed up clang-tidy when profiling in on.
It makes profiling runs twice as fast by reusing the time samples between the
different actions.
It also joins together the sampling of different matchers of the same check.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 220682

10 years agoSkip ObjC test on FreeBSD that does not build
Ed Maste [Mon, 27 Oct 2014 15:01:59 +0000 (15:01 +0000)]
Skip ObjC test on FreeBSD that does not build

llvm-svn: 220681

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 13:51:25 +0000 (13:51 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
http://reviews.llvm.org/D5999

llvm-svn: 220680

10 years agoclang-format: [Proto] Change formatting text-formatted options.
Daniel Jasper [Mon, 27 Oct 2014 13:25:59 +0000 (13:25 +0000)]
clang-format: [Proto] Change formatting text-formatted options.

Before:
  optional Type type = 1 [(mutate_options) = {vital : true
                                              abc : false}];

After:
  optional Type type = 1 [(mutate_options) = {
    vital : true
    abc : false
  }];

llvm-svn: 220679

10 years agoPrune CRLF.
NAKAMURA Takumi [Mon, 27 Oct 2014 12:37:26 +0000 (12:37 +0000)]
Prune CRLF.

llvm-svn: 220678

10 years agoRevert rL220675 due to failures on check-clang
Viktor Kutuzov [Mon, 27 Oct 2014 12:33:10 +0000 (12:33 +0000)]
Revert rL220675 due to failures on check-clang

llvm-svn: 220677

10 years ago[Tsan] Enable thread sanitizer tests on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:28:53 +0000 (11:28 +0000)]
[Tsan] Enable thread sanitizer tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D5995

llvm-svn: 220676

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:26:01 +0000 (11:26 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
Differential Revision: http://reviews.llvm.org/D5994

llvm-svn: 220675

10 years ago[Tsan] Fix references to renamed variables in DPrintf()
Viktor Kutuzov [Mon, 27 Oct 2014 11:22:24 +0000 (11:22 +0000)]
[Tsan] Fix references to renamed variables in DPrintf()
Differential Revision: http://reviews.llvm.org/D5993

llvm-svn: 220674

10 years ago[Tsan] Make calloc() to not track allocated space unless thread is completely initialized
Viktor Kutuzov [Mon, 27 Oct 2014 11:19:08 +0000 (11:19 +0000)]
[Tsan] Make calloc() to not track allocated space unless thread is completely initialized
Differential Revision: http://reviews.llvm.org/D5992

llvm-svn: 220673

10 years ago[Tsan] Fix guessing data range on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:14:24 +0000 (11:14 +0000)]
[Tsan] Fix guessing data range on FreeBSD
Differential Revision: http://reviews.llvm.org/D5990

llvm-svn: 220672

10 years ago[ARM] Select VMAXNM and VMINNM regardless of operand order
Oliver Stannard [Mon, 27 Oct 2014 09:23:02 +0000 (09:23 +0000)]
[ARM] Select VMAXNM and VMINNM regardless of operand order

Currently, the ARM backend will select the VMAXNM and VMINNM for these C
expressions:
  (a < b) ? a : b
  (a > b) ? a : b
but not these expressions:
  (a > b) ? b : a
  (a < b) ? b : a

This patch allows all of these expressions to be matched.

llvm-svn: 220671

10 years ago[asan-asm-instrumentation] Added comment describing how asm instrumentation works.
Yuri Gorshenin [Mon, 27 Oct 2014 08:38:54 +0000 (08:38 +0000)]
[asan-asm-instrumentation] Added comment describing how asm instrumentation works.

Summary: [asan-asm-instrumentation] Added comment describing how asm instrumentation works.

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 220670

10 years agoRe-commit r220667.
Rui Ueyama [Mon, 27 Oct 2014 08:16:18 +0000 (08:16 +0000)]
Re-commit r220667.

C++ source given to check_cxx_source_compile should have define "main".

llvm-svn: 220669

10 years agoFix unicode chars into ascii in comment lines.
NAKAMURA Takumi [Mon, 27 Oct 2014 08:08:18 +0000 (08:08 +0000)]
Fix unicode chars into ascii in comment lines.

llvm-svn: 220668

10 years agoRevert "Include stddef.h before including cxxabi.h" to un-break buildbot
Rui Ueyama [Mon, 27 Oct 2014 08:03:21 +0000 (08:03 +0000)]
Revert "Include stddef.h before including cxxabi.h" to un-break buildbot

This reverts commit r220665.

llvm-svn: 220667

10 years agoRemove #ifdef __FreeBSD
Rui Ueyama [Mon, 27 Oct 2014 07:44:40 +0000 (07:44 +0000)]
Remove #ifdef __FreeBSD

r220665 makes configure or CMake to set HAVE_CXXABI_H on FreeBSD 10.0.
We don't need this ugly ifdef condition anymore.

llvm-svn: 220666

10 years agoInclude stddef.h before including cxxabi.h
Rui Ueyama [Mon, 27 Oct 2014 07:37:57 +0000 (07:37 +0000)]
Include stddef.h before including cxxabi.h

On FreeBSD 10.0, size_t needs to be defined before including cxxabi.h.
Currenty HAVE_CXXABI_H is not defined on FreeBSD because of that reason.
This patch teaches cmake and configure how to include it.

http://reviews.llvm.org/D5940

llvm-svn: 220665

10 years agoInstCombine: Fix a combine assuming that icmp operands were integers
David Majnemer [Mon, 27 Oct 2014 05:47:49 +0000 (05:47 +0000)]
InstCombine: Fix a combine assuming that icmp operands were integers

An icmp may have pointer arguments, it isn't limited to integers or
vectors of integers.

This fixes PR21388.

llvm-svn: 220664

10 years ago[Sanitizer] Return code that calculates hash for stacktrace back to StackDepot implem...
Alexey Samsonov [Mon, 27 Oct 2014 03:10:27 +0000 (03:10 +0000)]
[Sanitizer] Return code that calculates hash for stacktrace back to StackDepot implementation

llvm-svn: 220663

10 years agoLinkModules.cpp: don't repeat names in comments.
Rafael Espindola [Mon, 27 Oct 2014 02:35:46 +0000 (02:35 +0000)]
LinkModules.cpp: don't repeat names in comments.

llvm-svn: 220662

10 years agoFix the TestCreateAfterAttach test for llgs-local on ptracer lock-down.
Todd Fiala [Mon, 27 Oct 2014 00:58:27 +0000 (00:58 +0000)]
Fix the TestCreateAfterAttach test for llgs-local on ptracer lock-down.

llvm-svn: 220661

10 years agoFix TestProcessAttach for Linux ptracer lock-down and llgs-local.
Todd Fiala [Mon, 27 Oct 2014 00:31:05 +0000 (00:31 +0000)]
Fix TestProcessAttach for Linux ptracer lock-down and llgs-local.

llvm-svn: 220660

10 years agoFix 80-column and other odd formatting.
Eric Christopher [Sun, 26 Oct 2014 23:40:33 +0000 (23:40 +0000)]
Fix 80-column and other odd formatting.

llvm-svn: 220659

10 years agoRemove some unnecessary casts.
David Blaikie [Sun, 26 Oct 2014 23:37:04 +0000 (23:37 +0000)]
Remove some unnecessary casts.

llvm-svn: 220658

10 years agoMake VFS and FileManager match the current MemoryBuffer API.
Benjamin Kramer [Sun, 26 Oct 2014 22:44:13 +0000 (22:44 +0000)]
Make VFS and FileManager match the current MemoryBuffer API.

This eliminates converting back and forth between the 3 formats and
gives us a more homogeneous interface.

llvm-svn: 220657

10 years agoFix up TestRegisters for Linux ptracer lock-down.
Todd Fiala [Sun, 26 Oct 2014 22:25:33 +0000 (22:25 +0000)]
Fix up TestRegisters for Linux ptracer lock-down.

All of these test fixups are prep work for when llgs is
running with llgs for local process debugging, where these
tests fail without the ptracer lock-down suppression.

llvm-svn: 220656

10 years ago[PBQP] Tidying up as per Dave Blaikie's suggesions for r220642.
Lang Hames [Sun, 26 Oct 2014 22:12:02 +0000 (22:12 +0000)]
[PBQP] Tidying up as per Dave Blaikie's suggesions for r220642.

llvm-svn: 220655

10 years agoFix TestAttachResume test so it doesn't hang on Linux with ptrace lockdown.
Todd Fiala [Sun, 26 Oct 2014 22:08:56 +0000 (22:08 +0000)]
Fix TestAttachResume test so it doesn't hang on Linux with ptrace lockdown.

Similar to previous fix, this augments the test inferior to
immediately indicate it may be ptraced by any Linux process
when the appropriate symbols are defined.

This seems to indicate we need to fix our lldb attach logic to
catch when an attach fails, and trigger an appropriate error
instead of the current behavior of hanging indefinitely.

llvm-svn: 220654

10 years ago[PBQP] Explicitly define copy/move operations for NodeMetadata to keep VS happy.
Lang Hames [Sun, 26 Oct 2014 21:55:54 +0000 (21:55 +0000)]
[PBQP] Explicitly define copy/move operations for NodeMetadata to keep VS happy.

Hopefully this fixes the bug that was introduced in r220642, and not-quite-fixed
in r220649.

llvm-svn: 220653

10 years agoAdd an option to the LTO code generator to disable vectorization during LTO
Arnold Schwaighofer [Sun, 26 Oct 2014 21:50:58 +0000 (21:50 +0000)]
Add an option to the LTO code generator to disable vectorization during LTO

We used to always vectorize (slp and loop vectorize) in the LTO pass pipeline.

r220345 changed it so that we used the PassManager's fields 'LoopVectorize' and
'SLPVectorize' out of the desire to be able to disable vectorization using the
cl::opt flags 'vectorize-loops'/'slp-vectorize' which the before mentioned
fields default to.
Unfortunately, this turns off vectorization because those fields
default to false.
This commit adds flags to the LTO library to disable lto vectorization which
reconciles the desire to optionally disable vectorization during LTO and
the desired behavior of defaulting to enabled vectorization.

We really want tools to set PassManager flags directly to enable/disable
vectorization and not go the route via cl::opt flags *in*
PassManagerBuilder.cpp.

llvm-svn: 220652

10 years agoAdded a missing call to 'Reset'.
Hafiz Abid Qadeer [Sun, 26 Oct 2014 21:38:43 +0000 (21:38 +0000)]
Added a missing call to 'Reset'.
HostThreadWindows::Join() did not call the Reset as is done by
the HostThreadPosix::Join(). As a result, future call to
IsJoinable() can fail.

Committed as obvious.

llvm-svn: 220651

10 years agoFix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.
Todd Fiala [Sun, 26 Oct 2014 21:37:46 +0000 (21:37 +0000)]
Fix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.

Similar to a recent test I fixed for gdb-remote attach scenarios, this
fix is for Linux kernels, such as Ubuntu's stock setup on 11.04-ish and
later, where ptrace starts requiring a ptracer to be an ancestor of the
inferior to be ptraced.  This change checks for Linux and the ptrace-related
flags.  If they're found, it tries to switch on the "allow any ptracer" mode
for the inferior as the first statements in the program.  It's a best-effort
solution - if the prctl call fails, the failure is ignored, and probably will
lead to the test failing.

The ptrace security behavior can be modified system-wide, but is outside the
scope of the test to address.  Hence I went with this particular solution.

llvm-svn: 220650

10 years ago[PBQP] Re-commit r220642 with a workaround for quirky Visual Studio behavior.
Lang Hames [Sun, 26 Oct 2014 20:57:16 +0000 (20:57 +0000)]
[PBQP] Re-commit r220642 with a workaround for quirky Visual Studio behavior.

Apparently unique_ptr'ifying NodeMetadata exposed an issue in VS where it
occasionally tries to synthesize copy constructors instead of moves. Hopefully
explicitly deleting the copy constructor and defining the move constructor will
fix this.

llvm-svn: 220649

10 years ago[OCaml] Expose existing documentation in ocamldoc.
Peter Zotov [Sun, 26 Oct 2014 20:45:22 +0000 (20:45 +0000)]
[OCaml] Expose existing documentation in ocamldoc.

Patch by Gabriel Radanne <drupyog@zoho.com>.

llvm-svn: 220648

10 years agoChange the comment on the closing #endif to match the condition on the corresponding...
Marshall Clow [Sun, 26 Oct 2014 20:29:38 +0000 (20:29 +0000)]
Change the comment on the closing #endif to match the condition on the corresponding #ifdef. Thanks to K-ballo for the catch. No functionality change.

llvm-svn: 220647