platform/upstream/llvm.git
9 years agoKeep track of which string table is associated with a symbol table.
Rafael Espindola [Tue, 21 Jul 2015 18:00:39 +0000 (18:00 +0000)]
Keep track of which string table is associated with a symbol table.

This removes the last uses of getStaticSymbolName in lld.

llvm-svn: 242816

9 years agoXfail TestGdbRemoteAbort for Android API <= 16.
Chaoren Lin [Tue, 21 Jul 2015 17:50:52 +0000 (17:50 +0000)]
Xfail TestGdbRemoteAbort for Android API <= 16.

Reviewers: sivachandra

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242815

9 years agoRe-enable static Android build after build master restart.
Chaoren Lin [Tue, 21 Jul 2015 17:50:49 +0000 (17:50 +0000)]
Re-enable static Android build after build master restart.

llvm-svn: 242814

9 years agoUpdate TestLoadUnload to use base Makefile.
Chaoren Lin [Tue, 21 Jul 2015 17:50:16 +0000 (17:50 +0000)]
Update TestLoadUnload to use base Makefile.

Summary:
The current Makefile scheme only allows one dylib to be specified in each make
invocation, so TestLoadUnload had a custom Makefile that's unrelated to the
base Makefile.rules. This change uses recursive make invocations to bypass the
single dylib restriction. See D11202 for more context.

Reviewers: clayborg

Subscribers: chaoren, lldb-commits

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

llvm-svn: 242813

9 years agoFollow up to r242810. NFC.
Chad Rosier [Tue, 21 Jul 2015 17:47:56 +0000 (17:47 +0000)]
Follow up to r242810. NFC.

llvm-svn: 242812

9 years ago[asan] Remove AsanPlatformThreadInit
Reid Kleckner [Tue, 21 Jul 2015 17:42:37 +0000 (17:42 +0000)]
[asan] Remove AsanPlatformThreadInit

Since the CoreFoundation allocator replacement was moved in r173134, all
implementations of this function have been empty.

Reviewers: samsonov

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

llvm-svn: 242811

9 years ago[AArch64] Simplify the passing of arguments. NFC.
Chad Rosier [Tue, 21 Jul 2015 17:42:04 +0000 (17:42 +0000)]
[AArch64] Simplify the passing of arguments. NFC.

This is setup for future work planned for the AArch64 Load/Store Opt pass.

llvm-svn: 242810

9 years agoRe-land 242726 to use RAII to do cleanup
Reid Kleckner [Tue, 21 Jul 2015 17:40:14 +0000 (17:40 +0000)]
Re-land 242726 to use RAII to do cleanup

The LooksLikeCodeInBug11395() codepath was returning without clearing
the ProcessedAllocas cache.

llvm-svn: 242809

9 years ago[RewriteStatepointsForGC] Hoist some code out of a loop
Philip Reames [Tue, 21 Jul 2015 17:18:03 +0000 (17:18 +0000)]
[RewriteStatepointsForGC] Hoist some code out of a loop

llvm-svn: 242808

9 years agoMergeFunc: Transfer the callee's attributes when replacing a direct caller
Arnold Schwaighofer [Tue, 21 Jul 2015 17:07:07 +0000 (17:07 +0000)]
MergeFunc: Transfer the callee's attributes when replacing a direct caller

We insert a bitcast which obfuscates the getCalledFunction for the utility
function which looks up attributes from the called function. Loosing ABI
changing parameter attributes is a bad thing.

rdar://21516488

llvm-svn: 242807

9 years agoMIR Serialization: Serialize the external symbol machine operands.
Alex Lorenz [Tue, 21 Jul 2015 16:59:53 +0000 (16:59 +0000)]
MIR Serialization: Serialize the external symbol machine operands.

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

9 years ago[RewriteStatepointsForGC] Delete trivial code
Philip Reames [Tue, 21 Jul 2015 16:51:17 +0000 (16:51 +0000)]
[RewriteStatepointsForGC] Delete trivial code

A bit more code cleanup: delete some a trivial true assertion and supporting code, remove a redundant cast, and use count in assertions where feasible.

llvm-svn: 242805

9 years agoRemove dead code.
Rafael Espindola [Tue, 21 Jul 2015 16:50:57 +0000 (16:50 +0000)]
Remove dead code.

llvm-svn: 242804

9 years agoIR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.
Alex Lorenz [Tue, 21 Jul 2015 16:50:35 +0000 (16:50 +0000)]
IR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.

This commit extracts the code that prints out a name of an LLVM value without a
prefix from a function 'PrintLLVMName' into a publicly accessible function named
'printLLVMNameWithoutPrefix'.

This change would be useful for MIR serialization, as it would allow the MIR
printer to reuse this function to print out the names of the external symbol
machine operands.

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

9 years agoRemove always false parameter.
Rafael Espindola [Tue, 21 Jul 2015 16:42:01 +0000 (16:42 +0000)]
Remove always false parameter.

llvm-svn: 242802

9 years agoUse range loop. NFC.
Rafael Espindola [Tue, 21 Jul 2015 16:40:14 +0000 (16:40 +0000)]
Use range loop. NFC.

llvm-svn: 242801

9 years agoUpdate the documentation for "novtable" to match r242730.
Bob Wilson [Tue, 21 Jul 2015 16:40:03 +0000 (16:40 +0000)]
Update the documentation for "novtable" to match r242730.

llvm-svn: 242800

9 years agoReverting r242787, attempt 2.
Kuba Brecka [Tue, 21 Jul 2015 16:31:35 +0000 (16:31 +0000)]
Reverting r242787, attempt 2.

llvm-svn: 242799

9 years agoReplace the last uses of ELF::getSymbolName in llvm-readobj.
Rafael Espindola [Tue, 21 Jul 2015 16:26:21 +0000 (16:26 +0000)]
Replace the last uses of ELF::getSymbolName in llvm-readobj.

llvm-svn: 242798

9 years agoAdd missing parentheses to appease -Wlogical-op-parentheses.
Daniel Jasper [Tue, 21 Jul 2015 16:18:51 +0000 (16:18 +0000)]
Add missing parentheses to appease -Wlogical-op-parentheses.
Add missing case to appease -Wswitch.

llvm-svn: 242797

9 years agofix formatting; NFC
Sanjay Patel [Tue, 21 Jul 2015 16:09:58 +0000 (16:09 +0000)]
fix formatting; NFC

llvm-svn: 242796

9 years agoUse helper function. NFC.
Rafael Espindola [Tue, 21 Jul 2015 16:05:53 +0000 (16:05 +0000)]
Use helper function. NFC.

llvm-svn: 242795

9 years agollvm-readobj: use the associated string table to print symbols. NFI.
Rafael Espindola [Tue, 21 Jul 2015 16:02:10 +0000 (16:02 +0000)]
llvm-readobj: use the associated string table to print symbols. NFI.

This just removes some cases that require ELFFile to eagerly parse the ELF
file.

llvm-svn: 242794

9 years ago[CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly speci...
Chris Bieneman [Tue, 21 Jul 2015 15:53:09 +0000 (15:53 +0000)]
[CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.

One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

llvm-svn: 242793

9 years agoRevert 242726, it broke ASan on OS X.
Nico Weber [Tue, 21 Jul 2015 15:48:53 +0000 (15:48 +0000)]
Revert 242726, it broke ASan on OS X.

llvm-svn: 242792

9 years agoReverting r242787 ("[asan] Fix the freopen interceptor to allow NULL instead of a...
Kuba Brecka [Tue, 21 Jul 2015 15:27:40 +0000 (15:27 +0000)]
Reverting r242787 ("[asan] Fix the freopen interceptor to allow NULL instead of a filename") to investigate buildbot failure.

llvm-svn: 242791

9 years ago[X86][AVX512F] add FP arithmetic intrinsics
Asaf Badouh [Tue, 21 Jul 2015 15:27:28 +0000 (15:27 +0000)]
[X86][AVX512F] add FP arithmetic intrinsics
add/div/mul/sub include rounding versions

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

llvm-svn: 242790

9 years agoRemove unused variable.
Rafael Espindola [Tue, 21 Jul 2015 14:45:56 +0000 (14:45 +0000)]
Remove unused variable.

llvm-svn: 242789

9 years agoUpdate the status of the TS'es
Marshall Clow [Tue, 21 Jul 2015 14:29:31 +0000 (14:29 +0000)]
Update the status of the TS'es

llvm-svn: 242788

9 years ago[asan] Fix the freopen interceptor to allow NULL instead of a filename
Kuba Brecka [Tue, 21 Jul 2015 14:23:27 +0000 (14:23 +0000)]
[asan] Fix the freopen interceptor to allow NULL instead of a filename

According to man freopen, passing NULL instead of a filename is valid, however the current implementation of the interceptor assumes this parameter is non-NULL. Let's fix that and add a test case.

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

llvm-svn: 242787

9 years agoSimplify printing the soname. NFC.
Rafael Espindola [Tue, 21 Jul 2015 13:48:41 +0000 (13:48 +0000)]
Simplify printing the soname. NFC.

llvm-svn: 242786

9 years agoCommit for http://reviews.llvm.org/D10765
Michael Wong [Tue, 21 Jul 2015 13:44:28 +0000 (13:44 +0000)]
Commit for http://reviews.llvm.org/D10765
for OpenMP 4 target data directive parsing and sema.
This commit is on behalf of Kelvin Li.

llvm-svn: 242785

9 years agoAdd missing c++ marker to .h file.
Rafael Espindola [Tue, 21 Jul 2015 13:42:38 +0000 (13:42 +0000)]
Add missing c++ marker to .h file.

llvm-svn: 242784

9 years ago[NativeProcessLinux] Integrate MainLoop
Pavel Labath [Tue, 21 Jul 2015 13:20:32 +0000 (13:20 +0000)]
[NativeProcessLinux] Integrate MainLoop

Summary:
This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with
the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of
thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been
reduced by about 40%). It also makes the code simpler, IMHO.

Reviewers: ovyalov, clayborg, tberghammer, chaoren

Subscribers: lldb-commits

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

This is a resubmission of r242305 after it was reverted due to bad interactions with the stdio
thread.

llvm-svn: 242783

9 years ago[LLGS] Get rid of the stdio forwarding thread
Pavel Labath [Tue, 21 Jul 2015 13:20:25 +0000 (13:20 +0000)]
[LLGS] Get rid of the stdio forwarding thread

Summary:
This commit removes the stdio forwarding thread in lldb-server in favor of a MainLoop callback.
As in some situations we need to forcibly flush the stream ( => Read() is called from multiple
places) and we still have multiple threads, I have had to additionally protect the communication
instance with a mutex.

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 242782

9 years ago[lldb-mi] Correct file names in first line comments.
Bruce Mitchener [Tue, 21 Jul 2015 13:09:39 +0000 (13:09 +0000)]
[lldb-mi] Correct file names in first line comments.

llvm-svn: 242781

9 years agoUpdate ISL to isl-0.15-61-gcea776f
Michael Kruse [Tue, 21 Jul 2015 12:56:36 +0000 (12:56 +0000)]
Update ISL to isl-0.15-61-gcea776f

The motivation is to fix a wrong use of the inline qualifier. This
fixes the Polly build using Visual Studio 2015 RC.

llvm-svn: 242780

9 years agoUnify FOLDER property of Polly targets
Michael Kruse [Tue, 21 Jul 2015 12:40:01 +0000 (12:40 +0000)]
Unify FOLDER property of Polly targets

Put all Polly targets into a single "Polly" category (i.e.
solution folder). Previously there was no recognizable scheme and most
categories contained just one or two targets or targets didn't belong
to any category.

Reviewers: grosser
llvm-svn: 242779

9 years ago[lldb-mi] Fix Windows build, missing assert.h include.
Bruce Mitchener [Tue, 21 Jul 2015 12:39:58 +0000 (12:39 +0000)]
[lldb-mi] Fix Windows build, missing assert.h include.

Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 242778

9 years agoRemove header project from Visual Studio builds
Michael Kruse [Tue, 21 Jul 2015 12:33:15 +0000 (12:33 +0000)]
Remove header project from Visual Studio builds

Remove the polly_headers_do_not_build project. Visual Studio is capable
of finding the headers itself, although they are not listed explicitly.
For explicit listing, the headers should be added to the relevant
target.

Reviewers: grosser
llvm-svn: 242777

9 years agoRemove module LLVMPolly from Windows build
Michael Kruse [Tue, 21 Jul 2015 12:29:02 +0000 (12:29 +0000)]
Remove module LLVMPolly from Windows build

Loadable modules are not supported on Windows.

Reviewers: grosser
llvm-svn: 242776

9 years agoRemove gcc-specific flags from Visual Studio build
Michael Kruse [Tue, 21 Jul 2015 12:22:36 +0000 (12:22 +0000)]
Remove gcc-specific flags from Visual Studio build

Remove the flags -fno-exceptions -fno-rtti and add the equivalent for
compiling with MSVC.

Reviewers: grosser
llvm-svn: 242775

9 years agoRemoving attribute documentation headings that are not required and do not add clarit...
Aaron Ballman [Tue, 21 Jul 2015 12:20:53 +0000 (12:20 +0000)]
Removing attribute documentation headings that are not required and do not add clarity; NFC.

llvm-svn: 242774

9 years agoRemove /Za flag from Visual Studio compilation
Michael Kruse [Tue, 21 Jul 2015 12:16:00 +0000 (12:16 +0000)]
Remove /Za flag from Visual Studio compilation

According to Stephan T. Lavavej it is broken. See
http://comments.gmane.org/gmane.comp.compilers.clang.devel/21638

Reviewers: grosser
llvm-svn: 242773

9 years agoAdd a test for stdint.h like ISL's configure does
Michael Kruse [Tue, 21 Jul 2015 12:09:41 +0000 (12:09 +0000)]
Add a test for stdint.h like ISL's configure does

Reviewers: grosser
llvm-svn: 242772

9 years agoRemove gitconfig.h.cmake
Michael Kruse [Tue, 21 Jul 2015 12:06:27 +0000 (12:06 +0000)]
Remove gitconfig.h.cmake

It is just one line which can be better generated in the CMakeLists.txt
itself, just as ISL's configure does.

Reviewers: grosser
llvm-svn: 242771

9 years agoAdd configure-time test for latest ISL
Michael Kruse [Tue, 21 Jul 2015 12:01:14 +0000 (12:01 +0000)]
Add configure-time test for latest ISL

Query the isl_config.h macros recently added to ISL. One of it looks for
the ffs (find first set), whose functionality is available in Visual
Studio with _BitScanForward. Also add isl_ffs.c to the source files
which contains the implementation of ffs using _BitScanForward.

Reviewers: grosser
llvm-svn: 242770

9 years ago[lldb-mi] Simplify MICmnMIResultRecord implementation.
Bruce Mitchener [Tue, 21 Jul 2015 11:30:39 +0000 (11:30 +0000)]
[lldb-mi] Simplify MICmnMIResultRecord implementation.

Summary:
* Remove extraneous members that were just storing temporary
  values.
* ResultClass_e parameters don't need to be const as they are
  scalars.
* Switch from a map with CMIUtilString values to using a mapping
  function. This uses a switch statement which will generate
  a warning if a new result class is added.
* Make BuildRecordResult a static function rather than a private
  member function so that we can construct the result text
  correctly and avoid having extra stuff in the header.
* Don't need (void) parameter lists in C++.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242769

9 years ago[lldb-mi] Remove unused portions of MIDataTypes.h.
Bruce Mitchener [Tue, 21 Jul 2015 11:27:40 +0000 (11:27 +0000)]
[lldb-mi] Remove unused portions of MIDataTypes.h.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242768

9 years agoRevert "Add Pipe::WriteWithTimeout method"
Pavel Labath [Tue, 21 Jul 2015 11:04:52 +0000 (11:04 +0000)]
Revert "Add Pipe::WriteWithTimeout method"

I have observed an increased flakyness in the buildbots. I suspect something was relying on the
fact that Pipe::Write had an implicit timeout of 1s, which this commit has removed. Reverting
while I investigate.

llvm-svn: 242767

9 years agoFix mingw toolchain to honor sysroot on Linux and add tests.
Yaron Keren [Tue, 21 Jul 2015 11:01:00 +0000 (11:01 +0000)]
Fix mingw toolchain to honor sysroot on Linux and add tests.

It should now support three mingw distributions running on Windows
and three Linux distributions. The include directories for each are
listed in the comments.

llvm-svn: 242766

9 years agoFix incorrect documentation directives and some parameters
Pavel Labath [Tue, 21 Jul 2015 09:37:43 +0000 (09:37 +0000)]
Fix incorrect documentation directives and some parameters

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

Patch by Eugene Zelenko.

llvm-svn: 242765

9 years agoAdd Pipe::WriteWithTimeout method
Pavel Labath [Tue, 21 Jul 2015 09:23:34 +0000 (09:23 +0000)]
Add Pipe::WriteWithTimeout method

Summary:
This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing
ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously,
zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data
avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe
consistent with the Communication/Connection classes. For blocking operatios with infinite
timeout, I introduce a special constant for this purpose.

Reviewers: ovyalov, zturner

Subscribers: lldb-commits

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

llvm-svn: 242764

9 years agoConstfold trunc,rint,nearbyint,ceil and floor using APFloat
Karthik Bhat [Tue, 21 Jul 2015 08:52:23 +0000 (08:52 +0000)]
Constfold trunc,rint,nearbyint,ceil and floor using APFloat
A patch by Chakshu Grover!
This patch allows constfolding of trunc,rint,nearbyint,ceil and floor intrinsics using APFloat class.
Differential Revision: http://reviews.llvm.org/D11144

llvm-svn: 242763

9 years ago[lldb-mi] size_t rather than MIuint for arg counts.
Bruce Mitchener [Tue, 21 Jul 2015 08:07:27 +0000 (08:07 +0000)]
[lldb-mi] size_t rather than MIuint for arg counts.

Summary: [lldb-mi] size_t rather than MIuint for arg counts.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242762

9 years agoAVX512 : Implemented VPMADDUBSW and VPMADDWD instruction ,
Igor Breger [Tue, 21 Jul 2015 07:11:28 +0000 (07:11 +0000)]
AVX512 : Implemented VPMADDUBSW and VPMADDWD instruction ,
Added tests for intrinsics and encoding.

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

llvm-svn: 242761

9 years ago[Mips] Fix addend writing for R_MIPS_REL32 relocation
Simon Atanasyan [Tue, 21 Jul 2015 05:54:30 +0000 (05:54 +0000)]
[Mips] Fix addend writing for R_MIPS_REL32 relocation

llvm-svn: 242760

9 years ago[Mips] Handle R_MIPS_JALR relocation to omptimize jalr/jr instructions
Simon Atanasyan [Tue, 21 Jul 2015 05:54:22 +0000 (05:54 +0000)]
[Mips] Handle R_MIPS_JALR relocation to omptimize jalr/jr instructions

llvm-svn: 242759

9 years ago[LIT] Fix discovery.py test once again
Eric Fiselier [Tue, 21 Jul 2015 04:25:13 +0000 (04:25 +0000)]
[LIT] Fix discovery.py test once again

llvm-svn: 242758

9 years agoResolve DW_AT_comp_dir path if it contains a symlink
Oleksiy Vyalov [Tue, 21 Jul 2015 02:09:42 +0000 (02:09 +0000)]
Resolve DW_AT_comp_dir path if it contains a symlink

http://reviews.llvm.org/D11357

llvm-svn: 242757

9 years ago[ARM] Define subtarget feature "reserve-r9", which is used to decide
Akira Hatanaka [Tue, 21 Jul 2015 01:42:02 +0000 (01:42 +0000)]
[ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This recommits r242737, which broke bots because the number of subtarget
features went over the limit of 64.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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

llvm-svn: 242756

9 years ago[ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
Akira Hatanaka [Tue, 21 Jul 2015 01:41:08 +0000 (01:41 +0000)]
[ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".

This recommits r242736, which had to be reverted because the llvm-side
change that was committed in r242737 caused the number of subtarget
features to go over the limit of 64.

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 242755

9 years agoBump the size of FeatureBitset up to 96-bits.
Akira Hatanaka [Tue, 21 Jul 2015 01:39:22 +0000 (01:39 +0000)]
Bump the size of FeatureBitset up to 96-bits.

This should avoid exceeding the maximum size when I add another subtarget
feature to ARM's subtarget.

llvm-svn: 242754

9 years agoFix FileSpec::IsSymlink implementation.
Oleksiy Vyalov [Tue, 21 Jul 2015 01:28:22 +0000 (01:28 +0000)]
Fix FileSpec::IsSymlink implementation.

http://reviews.llvm.org/D11356

llvm-svn: 242753

9 years agoDon't do a walk over the dynamic table just to find DT_SONAME.
Rafael Espindola [Tue, 21 Jul 2015 01:01:29 +0000 (01:01 +0000)]
Don't do a walk over the dynamic table just to find DT_SONAME.

llvm-svn: 242752

9 years ago[RewriteStatepointsForGC] Minor code cleanup [NFC]
Philip Reames [Tue, 21 Jul 2015 00:49:55 +0000 (00:49 +0000)]
[RewriteStatepointsForGC] Minor code cleanup [NFC]

We can use builders to simplify part of the code and we only check for the existance of the metadata value; this enables us to delete some redundant code.

llvm-svn: 242751

9 years ago[llgo] build llgoi by default
Andrew Wilkins [Tue, 21 Jul 2015 00:47:18 +0000 (00:47 +0000)]
[llgo] build llgoi by default

Summary:
As llgoi is installed, it must be built or the install
target will fail; there is no implicit dependency.
Adding llgoi to "ALL" makes building llgo as part of an
entire LLVM distribution a bit friendlier: you can then
just do the typical "make && make install".

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242750

9 years ago[cmake] pass GO_EXECUTABLE to llgo-go
Andrew Wilkins [Tue, 21 Jul 2015 00:46:23 +0000 (00:46 +0000)]
[cmake] pass GO_EXECUTABLE to llgo-go

Summary:
When calling llgo-go from the llvm_add_go_executable
cmake function, specify $GO_EXECUTABLE as the go
command to call. Without this, llgo-go searches $PATH
which may be inconsistent with $GO_EXECUTABLE.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242749

9 years ago[CMake] Fixing inconsistency caused by copy-pasta.
Chris Bieneman [Tue, 21 Jul 2015 00:44:47 +0000 (00:44 +0000)]
[CMake] Fixing inconsistency caused by copy-pasta.

This will actually fix the PR 24194.

llvm-svn: 242748

9 years agoAMDGPU: Set isMoveImm on s_movk_i32
Matt Arsenault [Tue, 21 Jul 2015 00:40:08 +0000 (00:40 +0000)]
AMDGPU: Set isMoveImm on s_movk_i32

llvm-svn: 242747

9 years ago[CMake] Fixing a problem with external projects that aren't getting enabled properly.
Chris Bieneman [Tue, 21 Jul 2015 00:39:53 +0000 (00:39 +0000)]
[CMake] Fixing a problem with external projects that aren't getting enabled properly.

This should address PR 24194, and some builedbot failures.

llvm-svn: 242746

9 years agoThe session dictionary attached to a Python interpeter holds variables the user creat...
Enrico Granata [Tue, 21 Jul 2015 00:38:25 +0000 (00:38 +0000)]
The session dictionary attached to a Python interpeter holds variables the user creates in the script interpreter
This can include objects that have complex state and need to be torn down intelligently (e.g. our SB* objects)

This will fail if the Python interpreter does not hold a valid thread state. So, acquire one, delete the session dictionary, and then let go of it on destruction

This fixes rdar://20960843

llvm-svn: 242745

9 years agoFix crash-on-invalid: don't look ahead past an unknown token, it might be EOF.
Richard Smith [Tue, 21 Jul 2015 00:23:34 +0000 (00:23 +0000)]
Fix crash-on-invalid: don't look ahead past an unknown token, it might be EOF.

llvm-svn: 242744

9 years agoARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code
Matthias Braun [Tue, 21 Jul 2015 00:19:01 +0000 (00:19 +0000)]
ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code

Re-apply of r241928 which had to be reverted because of the r241926
revert.

This commit factors out common code from MergeBaseUpdateLoadStore() and
MergeBaseUpdateLSMultiple() and introduces a new function
MergeBaseUpdateLSDouble() which merges adds/subs preceding/following a
strd/ldrd instruction into an strd/ldrd instruction with writeback where
possible.

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

llvm-svn: 242743

9 years agoARMLoadStoreOptimizer: Create LDRD/STRD on thumb2
Matthias Braun [Tue, 21 Jul 2015 00:18:59 +0000 (00:18 +0000)]
ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2

Re-apply r241926 with an additional check that r13 and r15 are not used
for LDRD/STRD. See http://llvm.org/PR24190. This also already includes
the fix from r241951.

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

llvm-svn: 242742

9 years agoRevert r242736.
Akira Hatanaka [Mon, 20 Jul 2015 23:53:02 +0000 (23:53 +0000)]
Revert r242736.

r242737 caused builds to fail with the following error message, so I'm
reverting the clang side change too:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

llvm-svn: 242741

9 years agoRevert r242737.
Akira Hatanaka [Mon, 20 Jul 2015 23:51:12 +0000 (23:51 +0000)]
Revert r242737.

This caused builds to fail with the following error message:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

llvm-svn: 242740

9 years agoclang-format: Fix crasher when a UTF8 character is found in an escape
Daniel Jasper [Mon, 20 Jul 2015 23:28:07 +0000 (23:28 +0000)]
clang-format: Fix crasher when a UTF8 character is found in an escape
sequence. Discovered by the fuzzer.

llvm-svn: 242738

9 years ago[ARM] Define subtarget feature "reserve-r9", which is used to decide
Akira Hatanaka [Mon, 20 Jul 2015 23:21:30 +0000 (23:21 +0000)]
[ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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

llvm-svn: 242737

9 years ago[ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
Akira Hatanaka [Mon, 20 Jul 2015 23:20:53 +0000 (23:20 +0000)]
[ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 242736

9 years agoRevert "ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2"
Matthias Braun [Mon, 20 Jul 2015 23:17:20 +0000 (23:17 +0000)]
Revert "ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2"

This reverts commit r241926. This caused http://llvm.org/PR24190

llvm-svn: 242735

9 years agoRevert "ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code"
Matthias Braun [Mon, 20 Jul 2015 23:17:16 +0000 (23:17 +0000)]
Revert "ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code"

This reverts commit r241928. This caused http://llvm.org/PR24190

llvm-svn: 242734

9 years agoRevert "ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920"
Matthias Braun [Mon, 20 Jul 2015 23:17:14 +0000 (23:17 +0000)]
Revert "ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920"

This reverts commit r241951. It caused http://llvm.org/PR24190

llvm-svn: 242733

9 years agoAArch64: Restrict macroop fusion heuristics to cyclone.
Matthias Braun [Mon, 20 Jul 2015 23:11:42 +0000 (23:11 +0000)]
AArch64: Restrict macroop fusion heuristics to cyclone.

Even though this is just some hinting for the scheduler it doesn't make
sense to do that unless you know the target can perform the fusion.

llvm-svn: 242732

9 years agoRefactor TableGen backend for ClangAttrEmitter to avoid duplication.
Bob Wilson [Mon, 20 Jul 2015 22:57:36 +0000 (22:57 +0000)]
Refactor TableGen backend for ClangAttrEmitter to avoid duplication.

GenerateHasAttrSpellingStringSwitch and GenerateTargetRequirements had
duplicated code to check the conditions for target-specific attributes.
Refactor the duplicated code into a separate function. NFC.

llvm-svn: 242731

9 years agoIgnore the "novtable" declspec when not using the Microsoft C++ ABI.
Bob Wilson [Mon, 20 Jul 2015 22:57:31 +0000 (22:57 +0000)]
Ignore the "novtable" declspec when not using the Microsoft C++ ABI.

Clang used to silently ignore __declspec(novtable). It is implemented
now, but leaving the vtable uninitialized does not work when using the
Itanium ABI, where the class layout for complex class hierarchies is
stored in the vtable. It might be possible to honor the novtable
attribute in some simple cases and either report an error or ignore
it in more complex situations, but it’s not clear if that would be
worthwhile. There is also value in having a simple and predictable
behavior, so this changes clang to simply ignore novtable when not using
the Microsoft C++ ABI.

llvm-svn: 242730

9 years agoCorrectly get the arguments and environment, even for processes that have a large...
Greg Clayton [Mon, 20 Jul 2015 22:52:13 +0000 (22:52 +0000)]
Correctly get the arguments and environment, even for processes that have a large amount or arguments and/or environment variables.

We previously passed in a 8192 byte buffer but this wasn't large enough. We now calculate the size we need and then add 128 to it and get the environment. If we pass exactly the number of bytes it says is needs, the sysctl() returns junk. Adding 1 seemed to do the trick, but to err on the side of caution, I added a few bytes more.

<rdar://problem/21883842>

llvm-svn: 242729

9 years ago[MS Compat] Add support for __declspec(noalias)
David Majnemer [Mon, 20 Jul 2015 22:51:52 +0000 (22:51 +0000)]
[MS Compat] Add support for __declspec(noalias)

The attribute '__declspec(noalias)' communicates that the function only
accesses memory pointed to by its pointer-typed arguments.

llvm-svn: 242728

9 years agoTargets: commonize some stack realignment code
JF Bastien [Mon, 20 Jul 2015 22:51:32 +0000 (22:51 +0000)]
Targets: commonize some stack realignment code

This patch does the following:
* Fix FIXME on `needsStackRealignment`: it is now shared between multiple targets, implemented in `TargetRegisterInfo`, and isn't `virtual` anymore. This will break out-of-tree targets, silently if they used `virtual` and with a build error if they used `override`.
* Factor out `canRealignStack` as a `virtual` function on `TargetRegisterInfo`, by default only looks for the `no-realign-stack` function attribute.

Multiple targets duplicated the same `needsStackRealignment` code:
 - Aarch64.
 - ARM.
 - Mips almost: had extra `DEBUG` diagnostic, which the default implementation now has.
 - PowerPC.
 - WebAssembly.
 - x86 almost: has an extra `-force-align-stack` option, which the default implementation now has.

The default implementation of `needsStackRealignment` used to just return `false`. My current patch changes the behavior by simply using the above shared behavior. This affects:
 - AMDGPU
 - BPF
 - CppBackend
 - MSP430
 - NVPTX
 - Sparc
 - SystemZ
 - XCore
 - Out-of-tree targets
This is a breaking change! `make check` passes.

The only implementation of the `virtual` function (besides the slight different in x86) was Hexagon (which did `MF.getFrameInfo()->getMaxAlignment() > 8`), and potentially some out-of-tree targets. Hexagon now uses the default implementation.

`needsStackRealignment` was being overwritten in `<Target>GenRegisterInfo.inc`, to return `false` as the default also did. That was odd and is now gone.

Reviewers: sunfish

Subscribers: aemerson, llvm-commits, jfb

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

llvm-svn: 242727

9 years agoDon't try to instrument allocas used by outlined SEH funclets
Reid Kleckner [Mon, 20 Jul 2015 22:49:44 +0000 (22:49 +0000)]
Don't try to instrument allocas used by outlined SEH funclets

Summary:
Arguments to llvm.localescape must be static allocas. They must be at
some statically known offset from the frame or stack pointer so that
other functions can access them with localrecover.

If we ever want to instrument these, we can use more indirection to
recover the addresses of these local variables. We can do it during
clang irgen or with the asan module pass.

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 242726

9 years agoRemove duplicated code.
Rafael Espindola [Mon, 20 Jul 2015 22:41:44 +0000 (22:41 +0000)]
Remove duplicated code.

Both ELFObjectFile and ELFFile had an implementation of getLoadName.

llvm-svn: 242725

9 years agoAArch64: Add aditional Cyclone macroop fusion opportunities
Matthias Braun [Mon, 20 Jul 2015 22:34:47 +0000 (22:34 +0000)]
AArch64: Add aditional Cyclone macroop fusion opportunities

Related to rdar://19205407

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

llvm-svn: 242724

9 years agoMachineScheduler: Restrict macroop fusion to data-dependent instructions.
Matthias Braun [Mon, 20 Jul 2015 22:34:44 +0000 (22:34 +0000)]
MachineScheduler: Restrict macroop fusion to data-dependent instructions.

Before creating a schedule edge to encourage MacroOpFusion check that:
- The predecessor actually writes a register that the branch reads.
- The predecessor has no successors in the ScheduleDAG so we can
  schedule it in front of the branch.

This avoids skewing the scheduling heuristic in cases where macroop
fusion cannot happen.

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

llvm-svn: 242723

9 years agoAvoid early pipefail exits due to grep failures in stage comparisons.
Dimitry Andric [Mon, 20 Jul 2015 22:24:40 +0000 (22:24 +0000)]
Avoid early pipefail exits due to grep failures in stage comparisons.

If objects or executables did not contain any RPATH, grep would return
nonzero, and the whole stage comparison loop would unexpectedly exit.
Fix this by checking the grep result explicitly.

llvm-svn: 242722

9 years agoSince BSD cmp(1) does not support the --ignore-initial option, use the
Dimitry Andric [Mon, 20 Jul 2015 22:07:27 +0000 (22:07 +0000)]
Since BSD cmp(1) does not support the --ignore-initial option, use the
more portable 3rd and 4th arguments to skip the first 16 bytes during
the comparison of Phase2 and Phase3 objects.

llvm-svn: 242721

9 years agoAdd 'const' to a few more functions in MachineFrameInfo
Krzysztof Parzyszek [Mon, 20 Jul 2015 22:05:38 +0000 (22:05 +0000)]
Add 'const' to a few more functions in MachineFrameInfo

Reviewer: Eric Christopher
http://reviews.llvm.org/D11372

llvm-svn: 242720

9 years agoFix comment typo (test commit). NFC
Geoff Berry [Mon, 20 Jul 2015 22:03:52 +0000 (22:03 +0000)]
Fix comment typo (test commit). NFC

llvm-svn: 242719

9 years ago[CUDA] Moved device-side triple calculation to buildCudaActions().
Artem Belevich [Mon, 20 Jul 2015 21:59:31 +0000 (21:59 +0000)]
[CUDA] Moved device-side triple calculation to buildCudaActions().

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

llvm-svn: 242718

9 years agoFix whitespace in Android.cmake.
Chaoren Lin [Mon, 20 Jul 2015 21:46:23 +0000 (21:46 +0000)]
Fix whitespace in Android.cmake.

llvm-svn: 242717

9 years ago[Android] Only enable evil libdl.a hack when building statically.
Chaoren Lin [Mon, 20 Jul 2015 21:46:20 +0000 (21:46 +0000)]
[Android] Only enable evil libdl.a hack when building statically.

llvm-svn: 242716