platform/upstream/llvm.git
8 years agoRemove astyle-options.
Rui Ueyama [Wed, 29 Jul 2015 20:48:02 +0000 (20:48 +0000)]
Remove astyle-options.

We have our own code formatting tool, clang-format.
I believe no one is using "astyle" to format the code.

llvm-svn: 243570

8 years ago[X86][SSE] Vectorize i64 ASHR operations
Simon Pilgrim [Wed, 29 Jul 2015 20:31:45 +0000 (20:31 +0000)]
[X86][SSE] Vectorize i64 ASHR operations

This patch vectorizes the v2i64/v4i64 ASHR shift operations - the last remaining integer vector shifts that are still being transferred to/from the scalar unit to be completed.

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

llvm-svn: 243569

8 years agoCOFF: Ignore /ThrowNew command line option.
Rui Ueyama [Wed, 29 Jul 2015 20:29:15 +0000 (20:29 +0000)]
COFF: Ignore /ThrowNew command line option.

This command line option is added since MSVC 2015. Our wild guess is
that the flag is for LTCG and we can safely ignore that.

llvm-svn: 243568

8 years agoRevert "Add reverse(ContainerTy) range adapter."
Pete Cooper [Wed, 29 Jul 2015 20:29:10 +0000 (20:29 +0000)]
Revert "Add reverse(ContainerTy) range adapter."

This reverts commit r243563.

The GCC buildbots were extremely unhappy about this.  Reverting while
we discuss a better way of doing overload resolution.

llvm-svn: 243567

8 years ago[opaque pointers] Remove use of PointerType::getElementType in favor of GEPOperator...
David Blaikie [Wed, 29 Jul 2015 20:26:23 +0000 (20:26 +0000)]
[opaque pointers] Remove use of PointerType::getElementType in favor of GEPOperator::getSourceElementType

llvm-svn: 243566

8 years agoCOFF: Add /safeseh command line option.
Rui Ueyama [Wed, 29 Jul 2015 20:25:40 +0000 (20:25 +0000)]
COFF: Add /safeseh command line option.

If /safeseh is specified, all input files must be compatible with Safe SEH.

llvm-svn: 243565

8 years ago[asan] XFAIL 1 test on Android.
Evgeniy Stepanov [Wed, 29 Jul 2015 20:17:21 +0000 (20:17 +0000)]
[asan] XFAIL 1 test on Android.

The test uses source file relative paths which does not work when the
test is executed on a remote device.

llvm-svn: 243564

8 years agoAdd reverse(ContainerTy) range adapter.
Pete Cooper [Wed, 29 Jul 2015 20:00:39 +0000 (20:00 +0000)]
Add reverse(ContainerTy) range adapter.

For cases where we needed a foreach loop in reverse over a container,
we had to do something like

  for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
                                          TypeInfos.rend())) {

This provides a convenience method which shortens this to

  for (const GlobalValue *GV : reverse(TypeInfos)) {

There are 2 versions of this, with a preference to the rbegin() version.

The first uses rbegin() and rend() to construct an iterator_range.

The second constructs an iterator_range from the begin() and end() methods
wrapped in std::reverse_iterator's.

Reviewed by David Blaikie.

llvm-svn: 243563

8 years ago[ASan] Disable dynamic alloca and UAR detection in presence of returns_twice calls.
Alexey Samsonov [Wed, 29 Jul 2015 19:36:08 +0000 (19:36 +0000)]
[ASan] Disable dynamic alloca and UAR detection in presence of returns_twice calls.

Summary:
returns_twice (most importantly, setjmp) functions are
optimization-hostile: if local variable is promoted to register, and is
changed between setjmp() and longjmp() calls, this update will be
undone. This is the reason why "man setjmp" advises to mark all these
locals as "volatile".

This can not be enough for ASan, though: when it replaces static alloca
with dynamic one, optionally called if UAR mode is enabled, it adds a
whole lot of SSA values, and computations of local variable addresses,
that can involve virtual registers, and cause unexpected behavior, when
these registers are restored from buffer saved in setjmp.

To fix this, just disable dynamic alloca and UAR tricks whenever we see
a returns_twice call in the function.

Reviewers: rnk

Subscribers: llvm-commits, kcc

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

llvm-svn: 243561

8 years agoCOFF: ARM: Fix relocations to thumb code.
Rui Ueyama [Wed, 29 Jul 2015 19:25:00 +0000 (19:25 +0000)]
COFF: ARM: Fix relocations to thumb code.

Windows ARM is the thumb ARM environment, and pointers to thumb code
needs to have its LSB set. When we apply relocations, we need to
adjust the LSB if it points to an executable section.

llvm-svn: 243560

8 years agoCOFF: ARM: Fix DLL import table.
Rui Ueyama [Wed, 29 Jul 2015 19:24:58 +0000 (19:24 +0000)]
COFF: ARM: Fix DLL import table.

The previous test was testing -flavor link. This patch correctly
tests link2 and fixes a bug that we didn't emit import thunks.

llvm-svn: 243559

8 years ago[llvm-objdump] Inverting logic to match the word "predicate". Returning true when...
Colin LeMahieu [Wed, 29 Jul 2015 19:21:13 +0000 (19:21 +0000)]
[llvm-objdump] Inverting logic to match the word "predicate".  Returning true when we want it rather than when we want to discard it.

llvm-svn: 243558

8 years agoCOFF: Fix seh.test.
Rui Ueyama [Wed, 29 Jul 2015 19:17:15 +0000 (19:17 +0000)]
COFF: Fix seh.test.

seh.test was testing -flavor link. This should have been testing
-flavor link2.

llvm-svn: 243557

8 years ago[llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying some...
Colin LeMahieu [Wed, 29 Jul 2015 19:08:10 +0000 (19:08 +0000)]
[llvm-objdump] Merging MachO DumpSections in to FilterSections.  Simplifying some predicate logic.

llvm-svn: 243556

8 years agoRoll forward r242871
Jingyue Wu [Wed, 29 Jul 2015 18:59:09 +0000 (18:59 +0000)]
Roll forward r242871

r242871 missed one place that should be guarded with isPhysicalReg. This patch
fixes that.

llvm-svn: 243555

8 years agoMIR Serialization: Serialize the '.cfi_def_cfa' CFI instruction.
Alex Lorenz [Wed, 29 Jul 2015 18:57:23 +0000 (18:57 +0000)]
MIR Serialization: Serialize the '.cfi_def_cfa' CFI instruction.

llvm-svn: 243554

8 years agoMIR Parser: Parse multiple LHS register machine operands.
Alex Lorenz [Wed, 29 Jul 2015 18:51:21 +0000 (18:51 +0000)]
MIR Parser: Parse multiple LHS register machine operands.

llvm-svn: 243553

8 years agoUse the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.
Douglas Katzman [Wed, 29 Jul 2015 18:39:14 +0000 (18:39 +0000)]
Use the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.

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

llvm-svn: 243552

8 years agoCentralize where we update the source file contents in SourceManager::GetFile() in...
Greg Clayton [Wed, 29 Jul 2015 18:37:25 +0000 (18:37 +0000)]
Centralize where we update the source file contents in SourceManager::GetFile() in case APIs are called that don't update the source.

The following functions were the only functions that updates the source file:

SourceManager::File::DisplaySourceLines()
SourceManager::File::FindLinesMatchingRegex()

But there we API calls that were using the SourceManager::File and asking it questions, like "is line 12 valid" and that might respond incorrectly if the source file had been updated.

<rdar://problem/21269402>

llvm-svn: 243551

8 years agoRevert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
Hans Wennborg [Wed, 29 Jul 2015 18:32:21 +0000 (18:32 +0000)]
Revert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"

This caused clang-format to stop linking on Mac; see PR24306.

llvm-svn: 243550

8 years agomove DAGCombiner's allowableAlignment() helper function into the TLI
Sanjay Patel [Wed, 29 Jul 2015 18:24:18 +0000 (18:24 +0000)]
move DAGCombiner's allowableAlignment() helper function into the TLI

Making allowableAlignment() more accessible was suggested as a predecessor patch
for D10662, so I've pulled it into TargetLowering. This let's us remove 4 instances
of duplicate logic in LegalizeDAG.

There's a subtle functional change in the implementation: the existing
allowableAlignment() code was using getPrefTypeAlignment() when checking
alignment with the DataLayout and assumed that was fast. In this implementation,
we use getABITypeAlignment() and assume that is fast. See the TODO comment or the
discussion in the Phab review for future improvements in this implementation
(don't use the data layout at all).

There are no regression test changes from this difference, and I'm not sure how to
expose it via a test. I think we actually do want to provide the 'Fast' param when
checking this from DAGCombiner::MergeConsecutiveStores(). Ie, we shouldn't merge
stores if the new stores are not going to be fast. But that change will require
fixing allowsMisalignedMemoryAccess() overrides as noted in D10662.

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

llvm-svn: 243549

8 years ago[asan] Remove special case mapping on Android/AArch64.
Evgeniy Stepanov [Wed, 29 Jul 2015 18:22:25 +0000 (18:22 +0000)]
[asan] Remove special case mapping on Android/AArch64.

ASan shadow on Android starts at address 0 for both historic and
performance reasons. This is possible because the platform mandates
-pie, which makes lower memory region always available.

This is not such a good idea on 64-bit platforms because of MAP_32BIT
incompatibility.

This patch changes Android/AArch64 mapping to be the same as that of
Linux/AAarch64.

llvm-svn: 243548

8 years agoCFI: Update tests for various bit vector sizes following lowerbitsets optzns.
Peter Collingbourne [Wed, 29 Jul 2015 18:12:45 +0000 (18:12 +0000)]
CFI: Update tests for various bit vector sizes following lowerbitsets optzns.

Also add a test to ensure that this doesn't regress.

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

llvm-svn: 243547

8 years agoLowerBitSets: Add debugging output.
Peter Collingbourne [Wed, 29 Jul 2015 18:12:36 +0000 (18:12 +0000)]
LowerBitSets: Add debugging output.

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

llvm-svn: 243546

8 years ago[Unroll] Handle SwitchInst properly.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:33 +0000 (18:10 +0000)]
[Unroll] Handle SwitchInst properly.

Previously successor selection was simply wrong.

llvm-svn: 243545

8 years ago[Unroll] Don't crash when simplified branch condition is undef.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:29 +0000 (18:10 +0000)]
[Unroll] Don't crash when simplified branch condition is undef.

llvm-svn: 243544

8 years agoRename test full-unroll-bad-geps.ll to full-unroll-crashers.ll.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:23 +0000 (18:10 +0000)]
Rename test full-unroll-bad-geps.ll to full-unroll-crashers.ll.

No reason to limit it only to GEP-related crashes. More tests are to
come here.

llvm-svn: 243543

8 years agoFix typos in comments. NFC.
Lang Hames [Wed, 29 Jul 2015 18:07:48 +0000 (18:07 +0000)]
Fix typos in comments. NFC.

llvm-svn: 243542

8 years agoAdd a function to make a mutex-protected copy of a breakpoint site's
Jim Ingham [Wed, 29 Jul 2015 17:51:36 +0000 (17:51 +0000)]
Add a function to make a mutex-protected copy of a breakpoint site's
owners list, so the StopInfo machinery can get the list of owners without
some other thread being able to mess up the list by deleting/disabline one of its
locations in the process of doing so.

<rdar://problem/18685197>

llvm-svn: 243541

8 years agoRevert "[PeepholeOptimizer] Look through PHIs to find additional register sources"
Bruno Cardoso Lopes [Wed, 29 Jul 2015 17:46:47 +0000 (17:46 +0000)]
Revert "[PeepholeOptimizer] Look through PHIs to find additional register sources"

Reported to Broke some internal tests: PR24303

This reverts commit r243486.

llvm-svn: 243540

8 years agoAdd an ArgList::AddAllArgs that accepts a vector of OptSpecifier.
Douglas Katzman [Wed, 29 Jul 2015 17:34:41 +0000 (17:34 +0000)]
Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier.

This lifts the somewhat arbitrary restriction on 3 OptSpecifiers.

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

llvm-svn: 243539

8 years agoDisable -Wpessimizing-move and -Wredundant-move in template instantiations.
Richard Trieu [Wed, 29 Jul 2015 17:03:34 +0000 (17:03 +0000)]
Disable -Wpessimizing-move and -Wredundant-move in template instantiations.

Dependent types can throw off the analysis for these warnings, possibly giving
conflicting warnings and fix-its.  Disabling the warning in template
instantiations will prevent this problem, and will still catch the
non-dependent cases in templates.

llvm-svn: 243538

8 years agoAArch64: use AddressingModes.h accessors for compare shifts
Tim Northover [Wed, 29 Jul 2015 16:39:56 +0000 (16:39 +0000)]
AArch64: use AddressingModes.h accessors for compare shifts

No functional change because "lsl #12" is actually encoded as 12, but one less
bug if someone ever decides to change that for the giggles.

llvm-svn: 243536

8 years agoCOFF: Fix SECREL and SECTION relocations.
Rui Ueyama [Wed, 29 Jul 2015 16:30:45 +0000 (16:30 +0000)]
COFF: Fix SECREL and SECTION relocations.

SECREL should sets the 32-bit offset of the target from the beginning
of *target's* output section. Previously, the offset from the beginning
of source's output section was used instead.

SECTION means the target section's index, and not the source section's
index. This patch fixes that issue too.

llvm-svn: 243535

8 years agoELF2: Use DenseMap instead of std::map for a symbol table.
Rui Ueyama [Wed, 29 Jul 2015 16:30:40 +0000 (16:30 +0000)]
ELF2: Use DenseMap instead of std::map for a symbol table.

We use DenseMap for COFF too.

llvm-svn: 243534

8 years agoCOFF: Remove unused command line option.
Rui Ueyama [Wed, 29 Jul 2015 16:30:34 +0000 (16:30 +0000)]
COFF: Remove unused command line option.

llvm-svn: 243533

8 years agoCOFF: Set load config table entry on non-x86.
Rui Ueyama [Wed, 29 Jul 2015 16:30:31 +0000 (16:30 +0000)]
COFF: Set load config table entry on non-x86.

llvm-svn: 243532

8 years agotest-release.sh: Add option for building the OpenMP run-time
Hans Wennborg [Wed, 29 Jul 2015 16:29:06 +0000 (16:29 +0000)]
test-release.sh: Add option for building the OpenMP run-time

This isn't part of the official release process, but provides a convenient way
to build binaries for those who want to experiment with it. Hopefully the run-
time can be part of the regular build and release process for 3.8.

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

llvm-svn: 243531

8 years agoFix a self-move bug in inplace_merge. Thanks to Ted and Dexon for the report and...
Marshall Clow [Wed, 29 Jul 2015 16:25:45 +0000 (16:25 +0000)]
Fix a self-move bug in inplace_merge. Thanks to Ted and Dexon for the report and the suggested fix.

llvm-svn: 243530

8 years agoDelete unused <dbghelp.h> include
Reid Kleckner [Wed, 29 Jul 2015 16:19:40 +0000 (16:19 +0000)]
Delete unused <dbghelp.h> include

llvm-svn: 243529

8 years agoReverting r243386 because it has serious post-commit concerns that have not been...
Aaron Ballman [Wed, 29 Jul 2015 15:57:49 +0000 (15:57 +0000)]
Reverting r243386 because it has serious post-commit concerns that have not been addressed. Also reverts r243389, which relied on this commit.

llvm-svn: 243527

8 years ago[llvm-objdump] Added -j flag to filter sections that are operated on.
Colin LeMahieu [Wed, 29 Jul 2015 15:45:39 +0000 (15:45 +0000)]
[llvm-objdump] Added -j flag to filter sections that are operated on.

llvm-svn: 243526

8 years agoIn case of an existing GlobalVariable, the comdat is created using the name of the
Yaron Keren [Wed, 29 Jul 2015 15:42:28 +0000 (15:42 +0000)]
In case of an existing GlobalVariable, the comdat is created using the name of the
new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat
creation after GV replacement solves this. Patch + testcase.

Reviewed by Reid Kleckner.

http://reviews.llvm.org/D11594

llvm-svn: 243525

8 years agoMake this test target x86_64-pc-windows-gnu as well.
Yaron Keren [Wed, 29 Jul 2015 15:28:02 +0000 (15:28 +0000)]
Make this test target x86_64-pc-windows-gnu as well.

llvm-svn: 243523

8 years agoTemporarily revert r242871
Jingyue Wu [Wed, 29 Jul 2015 15:26:11 +0000 (15:26 +0000)]
Temporarily revert r242871

PR24299

llvm-svn: 243522

8 years agoFix read/write context in EmulateInstructionARM strd/ldrd
Tamas Berghammer [Wed, 29 Jul 2015 15:15:42 +0000 (15:15 +0000)]
Fix read/write context in EmulateInstructionARM strd/ldrd

llvm-svn: 243521

8 years agoRemove non-utf-8 characters from EmulateInstructionARM
Tamas Berghammer [Wed, 29 Jul 2015 15:14:37 +0000 (15:14 +0000)]
Remove non-utf-8 characters from EmulateInstructionARM

llvm-svn: 243520

8 years ago[PPC] Fix PR24216: Don't generate splat for misaligned shuffle mask
Bill Schmidt [Wed, 29 Jul 2015 14:31:57 +0000 (14:31 +0000)]
[PPC] Fix PR24216: Don't generate splat for misaligned shuffle mask

Given certain shuffle-vector masks, LLVM emits splat instructions
which splat the wrong bytes from the source register.  The issue is
that the function PPC::isSplatShuffleMask() in PPCISelLowering.cpp
does not ensure that the splat pattern found is requesting bytes that
are aligned on an EltSize boundary.  This patch detects this situation
as not a valid splat mask, resulting in a permute being generated
instead of a splat.

Patch and test case by Tyler Kenney, cleaned up a bit by me.

This is a simple bug fix that would be good to incorporate into 3.7.

llvm-svn: 243519

8 years ago[AArch64] Pass subtarget feature "+strict-align".
Akira Hatanaka [Wed, 29 Jul 2015 14:25:58 +0000 (14:25 +0000)]
[AArch64] Pass subtarget feature "+strict-align".

This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.

rdar://problem/21529937

llvm-svn: 243518

8 years agoRemove unnecessary variable.
Yaron Keren [Wed, 29 Jul 2015 14:21:47 +0000 (14:21 +0000)]
Remove unnecessary variable.

llvm-svn: 243517

8 years ago[AArch64] Define subtarget feature strict-align.
Akira Hatanaka [Wed, 29 Jul 2015 14:17:26 +0000 (14:17 +0000)]
[AArch64] Define subtarget feature strict-align.

This commit defines subtarget feature strict-align and uses it instead of
cl::opt -aarch64-strict-align to decide whether strict alignment should be
forced.

rdar://problem/21529937

llvm-svn: 243516

8 years agoDo not detect scops that are delinearized to arrays with "undef" size
Tobias Grosser [Wed, 29 Jul 2015 13:52:05 +0000 (13:52 +0000)]
Do not detect scops that are delinearized to arrays with "undef" size

Such codes are not interesting to optimize and most likely never appear in the
normal compilation flow. However, they show up during test case reduction with
bugpoint and trigger -- without this change -- an assert in
polly::MemoryAccess::foldAccess(). It is better to detect them in
ScopDetection itself and just bail out.

Contributed-by: Utpal Bora <cs14mtech11017@iith.ac.in>
Reviewers: grosser

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243515

8 years ago[X86][AVX512BW] add convert i16 to i8 and unpack intrinsics
Asaf Badouh [Wed, 29 Jul 2015 12:34:20 +0000 (12:34 +0000)]
[X86][AVX512BW] add convert i16 to i8 and unpack intrinsics

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

llvm-svn: 243514

8 years ago[LLGS] Spawned process handling cleanup
Pavel Labath [Wed, 29 Jul 2015 12:33:31 +0000 (12:33 +0000)]
[LLGS] Spawned process handling cleanup

Summary:
This commit moves the m_spawned_pids member from the common LLGS/Platform class to the plaform
specific part. This enables us to remove LLGS code, which was attempting to manage the
m_spawned_pids contents, but at the same time making sure, there is only one debugged process. If
we ever want to do multi-process debugging, we will probably want to replace this with a set of
NativeProcessProtocolSP anyway. The only functional change is that support for
qKillSpawnedProcess packet is removed from LLGS, but this was not used there anyway (we have the
k packet for that).

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 243513

8 years ago[X86][AVX512BW] Replace attributes with __DEFAULT_FN_ATTRS
Asaf Badouh [Wed, 29 Jul 2015 12:22:19 +0000 (12:22 +0000)]
[X86][AVX512BW] Replace attributes with __DEFAULT_FN_ATTRS

llvm-svn: 243512

8 years agoWhen debugserver fails to attach to a process on a Darwin
Jason Molenda [Wed, 29 Jul 2015 01:42:16 +0000 (01:42 +0000)]
When debugserver fails to attach to a process on a Darwin
system, make a couple of additional checks to see if the
attach was denied via the System Integrity Protection that
is new in Mac OS X 10.11.  If so, return a special E87
error code to indicate this to lldb.

Up in lldb, if we receive the E87 error code, be specific
about why the attach failed.

Also detect the more common case of general attach failure
and print a better error message than "lost connection".

I believe this code will all build on Mac OS X 10.10 systems.
It may not compile or run on earlier versions of the OS.
None of this should build on other non-darwin systems.

llvm-svn: 243511

8 years ago[lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.
Dawn Perchik [Wed, 29 Jul 2015 01:01:14 +0000 (01:01 +0000)]
[lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.

llvm-svn: 243510

8 years ago[ELF2] Emit correct section types.
Michael J. Spencer [Wed, 29 Jul 2015 00:52:17 +0000 (00:52 +0000)]
[ELF2] Emit correct section types.

llvm-svn: 243509

8 years agoFirst part of an attempt to indicate to the user when they are
Jason Molenda [Wed, 29 Jul 2015 00:42:47 +0000 (00:42 +0000)]
First part of an attempt to indicate to the user when they are
debugging optimized code.  Adds new methods on Function/SBFunction
to query whether a given function is optimized.  Adds a new
function.is-optimized format entity and changes the default
frame-format to append "[opt]" if the function was built with
optimization.

The only indication that a binary was built with optimization
that we have right now is the presence of the DW_AT_APPLE_optimized
attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit.
The absence of this flag may mean that the compile_unit was not
compiled with optimization, or it may mean that the producer
does not generate this attribute.

Currently this only works for dSYM debugging.  When we create
the CompileUnit with dwarf-in-.o-file debugging we don't have
the attribute value yet so it's not set.  I need to find the
flag value when we do start to read the .o file DWARF and
set the CompileUnit's status at that point - but haven't
done it yet.

I'm also going to add a mechanism for issuing warnings to users
such that they're only issued once in a debug session and
there is away for users to suppress these warnings altogether
via .lldbinit file settings.  But I want to get this changeset
committed now that it's at a useful state.

<rdar://problem/19281172>

llvm-svn: 243508

8 years agoLock the owners mutex in the BreakpointSite before updating the hit
Jim Ingham [Wed, 29 Jul 2015 00:40:36 +0000 (00:40 +0000)]
Lock the owners mutex in the BreakpointSite before updating the hit
counts.  If you delete a breakpoint belonging to a site just as you are
processing a hit on that site, you could cause the BreakpointSite loop to
access a now deleted location.

<rdar://problem/19310323>

llvm-svn: 243507

8 years ago[ELF2] Emit section table.
Michael J. Spencer [Wed, 29 Jul 2015 00:30:10 +0000 (00:30 +0000)]
[ELF2] Emit section table.

llvm-svn: 243506

8 years agoMake function comments consistently imperative.
Bjarke Hammersholt Roune [Wed, 29 Jul 2015 00:29:08 +0000 (00:29 +0000)]
Make function comments consistently imperative.

(tiny edit, mostly a test that my new commit access works)

llvm-svn: 243505

8 years ago[lldb-mi] XFAIL new test added in r243484.
Dawn Perchik [Wed, 29 Jul 2015 00:22:53 +0000 (00:22 +0000)]
[lldb-mi] XFAIL new test added in r243484.

llvm-svn: 243504

8 years ago[libcxx] Cleanup CMake configuration and integrate with LLVM
Eric Fiselier [Wed, 29 Jul 2015 00:03:51 +0000 (00:03 +0000)]
[libcxx] Cleanup CMake configuration and integrate with LLVM

Summary:
This patch contains the following changes:

1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. Cleanup ugly configuration code in CMakeLists.txt by using `add_flags`, `add_flags_if`, and `add_flags_if_supported` macros.

The goals for this patch are:

1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs).
5. Move towards allowing  libc++ to use other LLVM utilities such as `not` and `FileCheck`.

Reviewers: mclow.lists, jroelofs, danalbert

Subscribers: cfe-commits

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

llvm-svn: 243503

8 years ago[Statepoints] Let patchable statepoints have a symbolic call target.
Sanjoy Das [Tue, 28 Jul 2015 23:50:30 +0000 (23:50 +0000)]
[Statepoints] Let patchable statepoints have a symbolic call target.

Summary:
As added initially, statepoints required their call targets to be a
constant pointer null if ``numPatchBytes`` was non-zero.  This turns out
to be a problem ergonomically, since there is no way to mark patchable
statepoints as calling a (readable) symbolic value.

This change remove the restriction of requiring ``null`` call targets
for patchable statepoints, and changes PlaceSafepoints to maintain the
symbolic call target through its transformation.

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits

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

llvm-svn: 243502

8 years agoFix broken ArrayRef conversion from r243497.
Alex Lorenz [Tue, 28 Jul 2015 23:34:27 +0000 (23:34 +0000)]
Fix broken ArrayRef conversion from r243497.

llvm-svn: 243501

8 years agoignore duplicate divisor uses when transforming into reciprocal multiplies (PR24141)
Sanjay Patel [Tue, 28 Jul 2015 23:28:22 +0000 (23:28 +0000)]
ignore duplicate divisor uses when transforming into reciprocal multiplies (PR24141)

PR24141: https://llvm.org/bugs/show_bug.cgi?id=24141
contains a test case where we have duplicate entries in a node's uses() list.

After r241826, we use CombineTo() to delete dead nodes when combining the uses into
reciprocal multiplies, but this fails if we encounter the just-deleted node again in
the list.

The solution in this patch is to not add duplicate entries to the list of users that
we will subsequently iterate over. For the test case, this avoids triggering the
combine divisors logic entirely because there really is only one user of the divisor.

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

llvm-svn: 243500

8 years agoRemove sanitizer XFAILs on a test.
Eric Fiselier [Tue, 28 Jul 2015 23:27:03 +0000 (23:27 +0000)]
Remove sanitizer XFAILs on a test.

llvm-svn: 243499

8 years agofix TLI's combineRepeatedFPDivisors interface to return the minimum user threshold
Sanjay Patel [Tue, 28 Jul 2015 23:05:48 +0000 (23:05 +0000)]
fix TLI's combineRepeatedFPDivisors interface to return the minimum user threshold

This fix was suggested as part of D11345 and is part of fixing PR24141.

With this change, we can avoid walking the uses of a divisor node if the target
doesn't want the combineRepeatedFPDivisors transform in the first place.

There is no NFC-intended other than that.

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

llvm-svn: 243498

8 years agoMIR Serialization: Serialize the target index machine operands.
Alex Lorenz [Tue, 28 Jul 2015 23:02:45 +0000 (23:02 +0000)]
MIR Serialization: Serialize the target index machine operands.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 243497

8 years ago[ELF2] Devirtualize SymbolBody.
Michael J. Spencer [Tue, 28 Jul 2015 22:58:25 +0000 (22:58 +0000)]
[ELF2] Devirtualize SymbolBody.

llvm-svn: 243496

8 years agoCOFF: _tls_used is __tls_used on x86.
Rui Ueyama [Tue, 28 Jul 2015 22:56:02 +0000 (22:56 +0000)]
COFF: _tls_used is __tls_used on x86.

llvm-svn: 243495

8 years ago[asan] Support per-application flags in the Android setup script.
Evgeniy Stepanov [Tue, 28 Jul 2015 22:45:24 +0000 (22:45 +0000)]
[asan] Support per-application flags in the Android setup script.

llvm-svn: 243494

8 years ago[ARM] Define subtarget feature strict-align.
Akira Hatanaka [Tue, 28 Jul 2015 22:44:28 +0000 (22:44 +0000)]
[ARM] Define subtarget feature strict-align.

This commit defines subtarget feature strict-align and uses it instead of
cl::opt -arm-strict-align to decide whether strict alignment should be
forced. Also, remove the logic that was checking the OS and architecture
as clang is now responsible for setting strict-align based on the command
line options specified and the target architecute and OS.

rdar://problem/21529937

http://reviews.llvm.org/D11470

llvm-svn: 243493

8 years agoAArch64: be careful of large immediates when optimising cmps.
Tim Northover [Tue, 28 Jul 2015 22:42:32 +0000 (22:42 +0000)]
AArch64: be careful of large immediates when optimising cmps.

llvm-svn: 243492

8 years agoMove an extra switch to clang-tools-extra/test/clang-tidy/misc-unused-parameters...
NAKAMURA Takumi [Tue, 28 Jul 2015 22:41:04 +0000 (22:41 +0000)]
Move an extra switch to clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp from check_clang_tidy.sh.

It also rolls back r242984 and r242985.

llvm-svn: 243491

8 years agoCOFF: Fix export symbol names for x86.
Rui Ueyama [Tue, 28 Jul 2015 22:34:24 +0000 (22:34 +0000)]
COFF: Fix export symbol names for x86.

I don't fully understand the rationale behind the name mangling
scheme used for the DLL export table and the import library.
Why only leading "_" is dropped for the import library while
both "_" and "@" are dropped from DLL symbol table? But this seems
to be what MSVC linker does.

llvm-svn: 243490

8 years ago[ARM] Pass subtarget feature "+strict-align".
Akira Hatanaka [Tue, 28 Jul 2015 22:26:45 +0000 (22:26 +0000)]
[ARM] Pass subtarget feature "+strict-align".

This commit changes the driver to save subtarget feature "+strict-align" to the
IR instead of using backend option "arm-strict-align". This is needed for LTO.

Also, move the logic in ARM backend that was deciding whether strict alignment
should be forced to the front-end.

rdar://problem/21529937

http://reviews.llvm.org/D11472

llvm-svn: 243489

8 years agoFix comment in TestExprOptions to match change of language from ObjC to ObjC++.
Dawn Perchik [Tue, 28 Jul 2015 22:19:42 +0000 (22:19 +0000)]
Fix comment in TestExprOptions to match change of language from ObjC to ObjC++.

llvm-svn: 243488

8 years ago[tests] Use llvm-readobj instead of macho-dump.
Davide Italiano [Tue, 28 Jul 2015 21:58:08 +0000 (21:58 +0000)]
[tests] Use llvm-readobj instead of macho-dump.

llvm-svn: 243487

8 years ago[PeepholeOptimizer] Look through PHIs to find additional register sources
Bruno Cardoso Lopes [Tue, 28 Jul 2015 21:45:50 +0000 (21:45 +0000)]
[PeepholeOptimizer] Look through PHIs to find additional register sources

Reapply 243271 with more fixes; although we are not handling multiple
sources with coalescable copies, we were not properly skipping this
case.

- Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
instructions.
- Add findNextSourceAndRewritePHI method to lookup into multiple sources
returnted by the ValueTracker and rewrite PHIs with new sources.

With these changes we can find more register sources and rewrite more
copies to allow coaslescing of bitcast instructions. Hence, we eliminate
unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
other archs by marking "isBitcast" on target specific instructions. The
x86 example follows:

A:
  psllq %mm1, %mm0
  movd  %mm0, %r9
  jmp C

B:
  por %mm1, %mm0
  movd  %mm0, %r9
  jmp C

C:
  movd  %r9, %mm0
  pshufw  $238, %mm0, %mm0

Becomes:

A:
  psllq %mm1, %mm0
  jmp C

B:
  por %mm1, %mm0
  jmp C

C:
  pshufw  $238, %mm0, %mm0

Differential Revision: http://reviews.llvm.org/D11197
rdar://problem/20404526

llvm-svn: 243486

8 years ago[mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.
Vasileios Kalintiris [Tue, 28 Jul 2015 21:43:31 +0000 (21:43 +0000)]
[mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.

Summary:
Currently, we support only the MIPS O32 ABI calling convention for call
lowering. With this change we avoid using the O32 calling convetion for
lowering calls marked as using the fast calling convention.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 243485

8 years ago[lldb-mi] Fix setting of breakpoints using file:func syntax.
Dawn Perchik [Tue, 28 Jul 2015 21:40:57 +0000 (21:40 +0000)]
[lldb-mi] Fix setting of breakpoints using file:func syntax.

Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11499

llvm-svn: 243484

8 years agoCleanup a few stale comments in FormattersContainer.h
Enrico Granata [Tue, 28 Jul 2015 21:28:33 +0000 (21:28 +0000)]
Cleanup a few stale comments in FormattersContainer.h

llvm-svn: 243483

8 years agoMake ClangASTType::RemoveFastQualifiers() actually do something useful
Enrico Granata [Tue, 28 Jul 2015 21:24:39 +0000 (21:24 +0000)]
Make ClangASTType::RemoveFastQualifiers() actually do something useful

llvm-svn: 243482

8 years ago[sanitizer] Fix Mac build.
Evgeniy Stepanov [Tue, 28 Jul 2015 21:01:42 +0000 (21:01 +0000)]
[sanitizer] Fix Mac build.

llvm-svn: 243480

8 years agoSilence unused argument warning for --cuda-host-only.
Artem Belevich [Tue, 28 Jul 2015 21:01:30 +0000 (21:01 +0000)]
Silence unused argument warning for --cuda-host-only.

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

llvm-svn: 243479

8 years ago--cuda-host-only should not disable linking phase.
Artem Belevich [Tue, 28 Jul 2015 21:01:21 +0000 (21:01 +0000)]
--cuda-host-only should not disable linking phase.

Host-only cuda compilation does produce valid host object
file and in some cases users do want to proceed on to the linking phase.
The change removes special case that stopped compilation pipeline at
the Assembly phase. Device-side compilation is still stopped early
by the types::getCompilationPhases().

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

llvm-svn: 243478

8 years agoUse an iterative method instead of recursion for printing macro backtraces.
Richard Trieu [Tue, 28 Jul 2015 20:53:46 +0000 (20:53 +0000)]
Use an iterative method instead of recursion for printing macro backtraces.

Store the locations for a macro expansion in a vector, then iterate over them
instead of using recursion.  This simplifies the logic around the backtrace
limit and gives easier access to the source locations.  No functionality change.

Patch by Zhengkai Wu.

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

llvm-svn: 243477

8 years ago[RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to Ben
Lang Hames [Tue, 28 Jul 2015 20:51:53 +0000 (20:51 +0000)]
[RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to Ben
Kramer for catching this.

llvm-svn: 243476

8 years agoFix typo.
Chih-Hung Hsieh [Tue, 28 Jul 2015 20:38:29 +0000 (20:38 +0000)]
Fix typo.

llvm-svn: 243475

8 years agoLimit this test only on linux.
Chih-Hung Hsieh [Tue, 28 Jul 2015 20:31:10 +0000 (20:31 +0000)]
Limit this test only on linux.

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

llvm-svn: 243474

8 years ago[asan] Read process name from /proc/self/cmdline on Linux.
Evgeniy Stepanov [Tue, 28 Jul 2015 20:27:51 +0000 (20:27 +0000)]
[asan] Read process name from /proc/self/cmdline on Linux.

Rename getBinaryBasename() to getProcessName() and, on Linux,
read it from /proc/self/cmdline instead of /proc/self/exe. The former
can be modified by the process. The main motivation is Android, where
application processes re-write cmdline to a package name. This lets
us setup per-application ASAN_OPTIONS through include=/some/path/%b.

llvm-svn: 243473

8 years agoFix a bug where the std::list synthetic child provider would not clean its cache...
Enrico Granata [Tue, 28 Jul 2015 20:19:45 +0000 (20:19 +0000)]
Fix a bug where the std::list synthetic child provider would not clean its cache correctly on update, causing stale children to be returned in some circumstances

Fixes rdar://20560680

llvm-svn: 243472

8 years ago[Unroll] Add debug dumps to loop-unroll analyzer.
Michael Zolotukhin [Tue, 28 Jul 2015 20:07:29 +0000 (20:07 +0000)]
[Unroll] Add debug dumps to loop-unroll analyzer.

llvm-svn: 243471

8 years agoAdd commentary explaining PPC access to return address
Bill Schmidt [Tue, 28 Jul 2015 20:05:06 +0000 (20:05 +0000)]
Add commentary explaining PPC access to return address

llvm-svn: 243470

8 years ago[mips][FastISel] Fix generated code for IR's select instruction.
Vasileios Kalintiris [Tue, 28 Jul 2015 19:57:25 +0000 (19:57 +0000)]
[mips][FastISel] Fix generated code for IR's select instruction.

Summary:
Generate correct code for the select instruction by zero-extending
it's boolean/condition operand to GPR-width. This is necessary because
the conditional-move instructions operate on the whole register.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 243469

8 years agoFreeBSDThread::GetRegisterContext is only for FreeBSD targets
Ed Maste [Tue, 28 Jul 2015 19:47:00 +0000 (19:47 +0000)]
FreeBSDThread::GetRegisterContext is only for FreeBSD targets

The removal of in-process Linux debug support left a switch statement
with llvm::Triple::FreeBSD as the only case. Simplify by replacing it
with a now-equivalent assertion.

llvm-svn: 243468

8 years agoPowerPC's ABIs differ from those of other architectures in that the
Bill Schmidt [Tue, 28 Jul 2015 19:41:49 +0000 (19:41 +0000)]
PowerPC's ABIs differ from those of other architectures in that the
callee-saved return address is stored in the caller's stack frame, not
the callee's.  This patch adjusts the logic to find the LR in the
correct place for PowerPC.

Patch joint with Bill Seurer.

llvm-svn: 243467

8 years ago[Unroll] Don't analyze blocks outside the loop.
Michael Zolotukhin [Tue, 28 Jul 2015 19:21:21 +0000 (19:21 +0000)]
[Unroll] Don't analyze blocks outside the loop.

llvm-svn: 243466