platform/upstream/llvm.git
9 years agoLower _mm256_broadcastsi128_si256 directly to a vector shuffle.
Juergen Ributzka [Tue, 3 Mar 2015 17:22:53 +0000 (17:22 +0000)]
Lower _mm256_broadcastsi128_si256 directly to a vector shuffle.

Originally we were using the same GCC builtins to lower this AVX2 vector
intrinsic. Instead we will now lower it directly to a vector shuffle.

This will not only allow LLVM to generate better code, but it will also allow us
to remove the GCC intrinsics.

Reviewed by Andrea

This is related to rdar://problem/18742778.

llvm-svn: 231081

9 years ago[SDK modernizer]. Patch fixes driver's lack of
Fariborz Jahanian [Tue, 3 Mar 2015 17:15:38 +0000 (17:15 +0000)]
[SDK modernizer]. Patch fixes driver's lack of
recognition of mernizer's -objcmt-migrate-property-dot-syntax
option with a new test in test/Driver. rdar://19994452

llvm-svn: 231080

9 years agoIR: Add missing API to specialized metadata nodes
Duncan P. N. Exon Smith [Tue, 3 Mar 2015 16:45:34 +0000 (16:45 +0000)]
IR: Add missing API to specialized metadata nodes

Add the final bits of API that `DIBuilder` needs before the new nodes
can be moved into place.

  - Add `MDType::clone()` and `MDType::setFlags()` to support
    `DIBuilder::createTypeWithFlags()`.
  - Add `MDBasicType::get()` overload that just requires a tag and a
    name, as a convenience for `DIBuilder::createUnspecifiedType()`.
  - Add `MDLocalVariable::withInline()` and
    `MDLocalVariable::withoutInline()` to support
    `llvm::createInlinedVariable()` and
    `llvm::cleanseInlinedVariable()`.

(Somehow these got lost inside the "move into place" patch I'm about to
commit -- better to commit separately!)

llvm-svn: 231079

9 years agoCleanup provided by Carlo Bertolli
Andrey Churbanov [Tue, 3 Mar 2015 16:19:57 +0000 (16:19 +0000)]
Cleanup provided by Carlo Bertolli

llvm-svn: 231078

9 years agoAdd better tests for ctype<char>::classic_table
Marshall Clow [Tue, 3 Mar 2015 16:15:26 +0000 (16:15 +0000)]
Add better tests for ctype<char>::classic_table

llvm-svn: 231077

9 years ago[libcxx] Add support for linking libc++ against a static ABI library.
Eric Fiselier [Tue, 3 Mar 2015 15:59:51 +0000 (15:59 +0000)]
[libcxx] Add support for linking libc++ against a static ABI library.

Summary:
This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library.

Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: compnerd, cfe-commits

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

llvm-svn: 231076

9 years ago[libcxxabi] Build both static and shared versions of libc++abi by default.
Eric Fiselier [Tue, 3 Mar 2015 15:59:09 +0000 (15:59 +0000)]
[libcxxabi] Build both static and shared versions of libc++abi by default.

Summary:
This patch builds both static and shared versions of libc++abi by default. It adds/repurposes the following cmake options:
* `LIBCXXABI_ENABLE_SHARED`: Enable/disable building the shared library. (Previously using `OFF` would build the static library instead)
* `LIBCXXABI_ENABLE_STATIC`: Enable/disable building the static library.

This patch also re-purposes the CMake target `cxxabi` to be a meta-target for `cxxabi_shared` and `cxxabi_static`. This could potentially break other builds that depend on `cxxabi` being a library target. We will need to apply a patch to libc++'s CMake before committing this change.

Running the tests is still only supported when the shared version is built. Support for running the tests against the static library will come in another patch.

Reviewers: jroelofs, mclow.lists, danalbert, compnerd

Reviewed By: danalbert, compnerd

Subscribers: cfe-commits

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

llvm-svn: 231075

9 years agoMake llvm/test/Object/archive-format.test CRLF-tolerant.
NAKAMURA Takumi [Tue, 3 Mar 2015 15:54:48 +0000 (15:54 +0000)]
Make llvm/test/Object/archive-format.test CRLF-tolerant.

llvm-svn: 231074

9 years ago[X86][Haswell][SchedModel] Fix patterns for scalar FMA3 variants.
Michael Kuperstein [Tue, 3 Mar 2015 15:47:02 +0000 (15:47 +0000)]
[X86][Haswell][SchedModel] Fix patterns for scalar FMA3 variants.

llvm-svn: 231073

9 years agoFix and enable some tests on Linux (MI)
Ilia K [Tue, 3 Mar 2015 15:32:39 +0000 (15:32 +0000)]
Fix and enable some tests on Linux (MI)

Summary:
Fix and enable some lldb-mi tests on Linux:

Fixed:
# MiExecInterpreterTestCase.test_lldbmi_thread_step_in
# MiExecTestCase.test_lldbmi_exec_step
# MiStackTestCase.test_lldbmi_stack_info_frame tests.

Also I enabled the following tests on Linux:
# MiExecTestCase.test_lldbmi_exec_step_instruction
# MiSignalTestCase.test_lldbmi_stopped_when_interrupted

All test pass on OS X and Linux.

Reviewers: abidh, vharron, clayborg

Reviewed By: clayborg

Subscribers: vharron, lldb-commits, clayborg, abidh

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

llvm-svn: 231072

9 years agoImprove MiStackTestCase tests
Ilia K [Tue, 3 Mar 2015 15:17:44 +0000 (15:17 +0000)]
Improve MiStackTestCase tests

Summary:
Improve MiStackTestCase tests.

All tests pass on OS X.

Reviewers: clayborg, abidh

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231071

9 years agoAllow to pass an executable file via lldb-mi arguments (MI)
Ilia K [Tue, 3 Mar 2015 15:14:32 +0000 (15:14 +0000)]
Allow to pass an executable file via lldb-mi arguments (MI)

Summary:
# Allow to pass an executable file via lldb-mi arguments
# Add tests
# Fix (gdb) prompt in CMIDriver::LocalDebugSessionStartupExecuteCommands
# Fix prompt in CMIDriver::InterpretCommandThisDriver: use the lldb-mi prompt instead of a hard-coded value.

All tests pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231070

9 years agoAVX-512: Moved patterns for masked load/store under avx_store, avx_load classes.
Elena Demikhovsky [Tue, 3 Mar 2015 15:03:35 +0000 (15:03 +0000)]
AVX-512: Moved patterns for masked load/store under avx_store, avx_load classes.
No functional changes.

llvm-svn: 231069

9 years agoMake -Wuninitialized warn on pointer-to-member and comma operators.
Manuel Klimek [Tue, 3 Mar 2015 14:54:25 +0000 (14:54 +0000)]
Make -Wuninitialized warn on pointer-to-member and comma operators.

`isTrackedVar` has been updated to also track records.
`DeclRefExpr`s appearing on the left side of a comma operator are
ignored, while those appearing on the right side are classified as
`Use`.

Patch by Enrico Pertoso.

llvm-svn: 231068

9 years agoMake sure we initialize all values in WhitespaceManager::Change.
Manuel Klimek [Tue, 3 Mar 2015 14:21:48 +0000 (14:21 +0000)]
Make sure we initialize all values in WhitespaceManager::Change.

llvm-svn: 231067

9 years agoclang-format: Fix access to uninitialized memory.
Daniel Jasper [Tue, 3 Mar 2015 13:59:49 +0000 (13:59 +0000)]
clang-format: Fix access to uninitialized memory.

With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can continue a preprocessor directive and initialize values
accordingly.

llvm-svn: 231066

9 years agoFix execution of platform shell commands on android
Tamas Berghammer [Tue, 3 Mar 2015 12:14:45 +0000 (12:14 +0000)]
Fix execution of platform shell commands on android

* Add missing functionality to the process launcher
* Fixup PATH environment variable to workaround an OS bug
* Add default shell path to the host info structure

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

llvm-svn: 231065

9 years agoDuring PHI elimination, split critical edges that move copies out of loops.
Daniel Jasper [Tue, 3 Mar 2015 10:23:11 +0000 (10:23 +0000)]
During PHI elimination, split critical edges that move copies out of loops.

This prevents the behavior observed in llvm.org/PR22369. I am not sure
whether I am reading the code correctly, but the early exit based on
isLiveOutPastPHIs() seems to make the wrong assumption that
RegisterCoalescer won't be able to coalesce those copies later.

This change hides the new behavior behind -no-phi-elim-live-out-early-exit
as it currently breaks four tests:
 * Assertion in:
     CodeGen/Hexagon/hwloop-cleanup.ll
 * Worse code in:
     CodeGen/X86/coalescer-commute4.ll
     CodeGen/X86/phys_subreg_coalesce-2.ll
     CodeGen/X86/zlib-longest-match.ll
   The root cause here seems to be that the heuristic that determines
   the visitation order in RegisterCoalescer gets less lucky.

llvm-svn: 231064

9 years agoRevert r231008 (and dependent r231019).
Daniel Jasper [Tue, 3 Mar 2015 10:02:53 +0000 (10:02 +0000)]
Revert r231008 (and dependent r231019).

As Chandler responded on the initial commit, just directly setting the
triple through -Xclang option to the driver creates havoc on other
platforms. The driver test should specifically go into test/Driver and
test the cc1 commandline itself.

llvm-svn: 231063

9 years agoAdd range iterators to Extract/InsertValueInst indices
Daniel Berlin [Tue, 3 Mar 2015 09:31:01 +0000 (09:31 +0000)]
Add range iterators to Extract/InsertValueInst indices

llvm-svn: 231062

9 years agoSymbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfo
Kuba Brecka [Tue, 3 Mar 2015 09:18:44 +0000 (09:18 +0000)]
Symbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfo

Reviewed at http://reviews.llvm.org/D8020

llvm-svn: 231061

9 years ago[ASTUnit] Fix crash when trying to load a module file via ASTUnit::LoadFromASTFile.
Argyrios Kyrtzidis [Tue, 3 Mar 2015 08:04:19 +0000 (08:04 +0000)]
[ASTUnit] Fix crash when trying to load a module file via ASTUnit::LoadFromASTFile.

rdar://19997358

llvm-svn: 231060

9 years agoSwitch up whitespace with better whitespace.
Nick Lewycky [Tue, 3 Mar 2015 07:59:45 +0000 (07:59 +0000)]
Switch up whitespace with better whitespace.

llvm-svn: 231059

9 years agoRevert the non-cleanup part of r230769 because it introduced a non-determinism found...
Nick Lewycky [Tue, 3 Mar 2015 07:57:45 +0000 (07:57 +0000)]
Revert the non-cleanup part of r230769 because it introduced a non-determinism found only in the names of symbols.

llvm-svn: 231058

9 years ago[ELF] Implement R_X86_64_PC16 relocation.
Davide Italiano [Tue, 3 Mar 2015 07:38:20 +0000 (07:38 +0000)]
[ELF] Implement R_X86_64_PC16 relocation.

Yet another chapter in the story. We're getting there, finally.
Note for the future: the tests for relocation have a lot of duplication
and probably can be unified in a single file. Let's reevaluate this once
the support will be complete (hopefully, soon).

llvm-svn: 231057

9 years agoCleanup after r230934 per Dave's suggestions.
Owen Anderson [Tue, 3 Mar 2015 05:39:27 +0000 (05:39 +0000)]
Cleanup after r230934 per Dave's suggestions.

llvm-svn: 231056

9 years ago[X86] Remove some unused code from disassembler.
Craig Topper [Tue, 3 Mar 2015 05:24:03 +0000 (05:24 +0000)]
[X86] Remove some unused code from disassembler.

llvm-svn: 231055

9 years agoSema: Caught exception objects should be unqualified
David Majnemer [Tue, 3 Mar 2015 04:38:34 +0000 (04:38 +0000)]
Sema: Caught exception objects should be unqualified

The exception object should be unqualified.  Using a qualified exception
object results in the wrong copy constructor getting called when the
catch handler executes.

llvm-svn: 231054

9 years agoRemove obsolete FIXME. override on definitions is fine.
Nico Weber [Tue, 3 Mar 2015 03:31:15 +0000 (03:31 +0000)]
Remove obsolete FIXME. override on definitions is fine.

llvm-svn: 231053

9 years ago[asan] Since x32 has 32-bit pointers, it should use the same code sequence as ia32...
Kostya Serebryany [Tue, 3 Mar 2015 02:45:21 +0000 (02:45 +0000)]
[asan] Since x32 has 32-bit pointers, it should use the same code sequence as ia32 for AddressSanitizer asm_flags test. Patch by H.J. Lu

llvm-svn: 231052

9 years agoRevert "[ADT] fail-fast iterators for DenseMap"
Sanjoy Das [Tue, 3 Mar 2015 01:59:38 +0000 (01:59 +0000)]
Revert "[ADT] fail-fast iterators for DenseMap"

This reverts commit r231035.  It breaks clang.

llvm-svn: 231050

9 years agoSema: Properly initialize the thrown exception object
David Majnemer [Tue, 3 Mar 2015 01:50:05 +0000 (01:50 +0000)]
Sema: Properly initialize the thrown exception object

We would create the exception object with the wrong qualifiers, ensuring
that the wrong copy constructor would get called.

llvm-svn: 231049

9 years agoFix a crasher where we might have a N_UNDF symbol with no name and this could cause...
Greg Clayton [Tue, 3 Mar 2015 01:40:46 +0000 (01:40 +0000)]
Fix a crasher where we might have a N_UNDF symbol with no name and this could cause ObjectFileMachO::ParseSymtab() to crash.

<rdar://problem/19989491>

llvm-svn: 231048

9 years agoAdd explicit type to empty std::set initializer to fix the libc++ build.
Peter Collingbourne [Tue, 3 Mar 2015 01:39:13 +0000 (01:39 +0000)]
Add explicit type to empty std::set initializer to fix the libc++ build.

llvm-svn: 231047

9 years ago[X86] Special-case 2x CMOV when custom-inserting.
Ahmed Bougacha [Tue, 3 Mar 2015 01:21:16 +0000 (01:21 +0000)]
[X86] Special-case 2x CMOV when custom-inserting.

This lets us avoid a few copies that are otherwise hard to get rid of.
The way this is done is, the custom-inserter looks at the following
instruction for another CMOV, and replaces both at the same time.
A previous version used a new CMOV2 opcode, but the custom inserter
is expected to be able to return a different basic block anyway, which
means it's OK - though far from ideal - to alter that block's contents.
Explicitly document that, in case it ever makes a difference.
Alternatives welcome!

Follow-up to r231045.

rdar://19767934
Closes http://reviews.llvm.org/D8019

llvm-svn: 231046

9 years ago[X86] Combine (cmov (and/or (setcc) (setcc))) into (cmov (cmov)).
Ahmed Bougacha [Tue, 3 Mar 2015 01:09:14 +0000 (01:09 +0000)]
[X86] Combine (cmov (and/or (setcc) (setcc))) into (cmov (cmov)).

Fold and/or of setcc's to double CMOV:

(CMOV F, T, ((cc1 | cc2) != 0)) -> (CMOV (CMOV F, T, cc1), T, cc2)
(CMOV F, T, ((cc1 & cc2) != 0)) -> (CMOV (CMOV T, F, !cc1), F, !cc2)

When we can't use the CMOV instruction, it might increase branch
mispredicts.  When we can, or when there is no mispredict, this
improves throughput and reduces register pressure.

These can't be catched by generic combines, because the pattern can
appear when legalizing some instructions (such as fcmp une).

rdar://19767934
http://reviews.llvm.org/D7634

llvm-svn: 231045

9 years agoFix cppeh breakage due to racing commits
Reid Kleckner [Tue, 3 Mar 2015 01:04:39 +0000 (01:04 +0000)]
Fix cppeh breakage due to racing commits

llvm-svn: 231044

9 years agoLowerBitSets: Use byte arrays instead of bit sets to represent in-memory bit sets.
Peter Collingbourne [Tue, 3 Mar 2015 00:49:28 +0000 (00:49 +0000)]
LowerBitSets: Use byte arrays instead of bit sets to represent in-memory bit sets.

By loading from indexed offsets into a byte array and applying a mask, a
program can test bits from the bit set with a relatively short instruction
sequence. For example, suppose we have 15 bit sets to lay out:

A (16 bits), B (15 bits), C (14 bits), D (13 bits), E (12 bits),
F (11 bits), G (10 bits), H (9 bits), I (7 bits), J (6 bits), K (5 bits),
L (4 bits), M (3 bits), N (2 bits), O (1 bit)

These bits can be laid out in a 16-byte array like this:

      Byte Offset
    0123456789ABCDEF
Bit
  7 HHHHHHHHHIIIIIII
  6 GGGGGGGGGGJJJJJJ
  5 FFFFFFFFFFFKKKKK
  4 EEEEEEEEEEEELLLL
  3 DDDDDDDDDDDDDMMM
  2 CCCCCCCCCCCCCCNN
  1 BBBBBBBBBBBBBBBO
  0 AAAAAAAAAAAAAAAA

For example, to test bit X of A, we evaluate ((bits[X] & 1) != 0), or to
test bit X of I, we evaluate ((bits[9 + X] & 0x80) != 0). This can be done
in 1-2 machine instructions on x86, or 4-6 instructions on ARM.

This uses the LPT multiprocessor scheduling algorithm to lay out the bits
efficiently.

Saves ~450KB of instructions in a recent build of Chromium.

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

llvm-svn: 231043

9 years agoRemap arguments and non-alloca values used by outlined C++ exception handlers.
Andrew Kaylor [Tue, 3 Mar 2015 00:41:03 +0000 (00:41 +0000)]
Remap arguments and non-alloca values used by outlined C++ exception handlers.

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

llvm-svn: 231042

9 years agoLoopIdiom: Give globals for memset_pattern16 private linkage.
Benjamin Kramer [Tue, 3 Mar 2015 00:17:09 +0000 (00:17 +0000)]
LoopIdiom: Give globals for memset_pattern16 private linkage.

There's really no reason to have them have entries in the symbol table
anymore. Old versions of ld64 had some bugs in this area but those have
been fixed long ago.

llvm-svn: 231041

9 years ago[Sanitizers] Remove duplication in sanitizer group definition. NFC.
Alexey Samsonov [Tue, 3 Mar 2015 00:14:32 +0000 (00:14 +0000)]
[Sanitizers] Remove duplication in sanitizer group definition. NFC.

There is no need to list sanitizers in both "UndefinedTrap" and
"Undefined" groups - it turns out using one group in a defintion
of another group "just works".

llvm-svn: 231040

9 years agoFix typo in my last commit.
Matthias Braun [Tue, 3 Mar 2015 00:12:08 +0000 (00:12 +0000)]
Fix typo in my last commit.

llvm-svn: 231039

9 years agoWinEH: Run opt -instnamer over some cppeh tests and update CHECKs
Reid Kleckner [Tue, 3 Mar 2015 00:05:35 +0000 (00:05 +0000)]
WinEH: Run opt -instnamer over some cppeh tests and update CHECKs

In the future, we should run the output of clang through instnamer to
make it easier to manually edit test cases.

No functionality change.

llvm-svn: 231037

9 years ago[SDK modernizer] Patch to fix type of the typed enums when
Fariborz Jahanian [Mon, 2 Mar 2015 23:58:02 +0000 (23:58 +0000)]
[SDK modernizer] Patch to fix type of the typed enums when
migrating to NS_ENUM typedef. rdar://19994496

llvm-svn: 231036

9 years ago[ADT] fail-fast iterators for DenseMap
Sanjoy Das [Mon, 2 Mar 2015 23:29:37 +0000 (23:29 +0000)]
[ADT] fail-fast iterators for DenseMap

Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Reviewers: dexonsmith, dberlin, ruiu, chandlerc

Reviewed By: chandlerc

Subscribers: yaron.keren, chandlerc, llvm-commits

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

llvm-svn: 231035

9 years agoTLI: Factor out sanitizeFunctionName. NFC.
Michael Zolotukhin [Mon, 2 Mar 2015 23:24:40 +0000 (23:24 +0000)]
TLI: Factor out sanitizeFunctionName. NFC.

llvm-svn: 231034

9 years agoMake ArchiveLibraryFile::~ArchiveLibraryFile virtual.
Rui Ueyama [Mon, 2 Mar 2015 23:03:33 +0000 (23:03 +0000)]
Make ArchiveLibraryFile::~ArchiveLibraryFile virtual.

"virtual" was present at a wrong place. FileArchive is a subclass of
ArchiveLibraryFile, and a FileArchive can be deleted through a
pointer of ArchiveLibraryFile. We want to make the destructor of the
base class virtual.

llvm-svn: 231033

9 years agoSymbolizer refactoring: Make LibbacktraceSymbolizer adopt the SymbolizerTool interface
Kuba Brecka [Mon, 2 Mar 2015 22:56:25 +0000 (22:56 +0000)]
Symbolizer refactoring: Make LibbacktraceSymbolizer adopt the SymbolizerTool interface

Reviewed at http://reviews.llvm.org/D7971

llvm-svn: 231032

9 years agoRemove shell requirement from test/Modules/explicit-build-relpath.cpp
Reid Kleckner [Mon, 2 Mar 2015 22:55:01 +0000 (22:55 +0000)]
Remove shell requirement from test/Modules/explicit-build-relpath.cpp

It only relies on 'cd', which the internal shell has now.

llvm-svn: 231031

9 years agoRevert bad change from r231029
Reid Kleckner [Mon, 2 Mar 2015 22:50:09 +0000 (22:50 +0000)]
Revert bad change from r231029

llvm-svn: 231030

9 years agoRemove shell requirements from tests that use 'cd'
Reid Kleckner [Mon, 2 Mar 2015 22:42:58 +0000 (22:42 +0000)]
Remove shell requirements from tests that use 'cd'

Modules and Tooling tests in particular tend to want to change the cwd,
so we were missing test coverage in this area on Windows. It should now
be easier to write such portable tests.

llvm-svn: 231029

9 years agoIndexedMap: Document why SmallVector<T, 0> is preferable here.
Benjamin Kramer [Mon, 2 Mar 2015 22:20:22 +0000 (22:20 +0000)]
IndexedMap: Document why SmallVector<T, 0> is preferable here.

llvm-svn: 231028

9 years agoSymbolizer refactoring: ExtractToken and friends
Kuba Brecka [Mon, 2 Mar 2015 22:15:14 +0000 (22:15 +0000)]
Symbolizer refactoring: ExtractToken and friends

Reviewed at http://reviews.llvm.org/D7867

llvm-svn: 231027

9 years agoclang-cl: Correctly ignore /openmp- (PR22748)
Hans Wennborg [Mon, 2 Mar 2015 22:09:05 +0000 (22:09 +0000)]
clang-cl: Correctly ignore /openmp- (PR22748)

llvm-svn: 231026

9 years ago[Sanitizer] Run test/sanitizer_common lit tests on all supported architectures.
Alexey Samsonov [Mon, 2 Mar 2015 22:03:52 +0000 (22:03 +0000)]
[Sanitizer] Run test/sanitizer_common lit tests on all supported architectures.

llvm-svn: 231025

9 years agoRevert "Revert "For the dwarf expression code get the subtarget off of the current""
Adrian Prantl [Mon, 2 Mar 2015 22:02:36 +0000 (22:02 +0000)]
Revert "Revert "For the dwarf expression code get the subtarget off of the current""

This reapplies r230990 without modifications.

llvm-svn: 231024

9 years agoRefactor DebugLocDWARFExpression so it doesn't require access to the
Adrian Prantl [Mon, 2 Mar 2015 22:02:33 +0000 (22:02 +0000)]
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.

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

This reapplies 230930 without the assertion in DebugLocEntry::finalize()
because not all Machine registers can be lowered into DWARF register
numbers and floating point constants cannot be expressed.

llvm-svn: 231023

9 years agocmake: Use MSVC atomics with clang-cl
Reid Kleckner [Mon, 2 Mar 2015 22:00:23 +0000 (22:00 +0000)]
cmake: Use MSVC atomics with clang-cl

llvm-svn: 231022

9 years agoSupport: Use const pointers for reads.
Jan Vesely [Mon, 2 Mar 2015 21:50:28 +0000 (21:50 +0000)]
Support: Use const pointers for reads.

Fixes tons of const-cast warnings.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Rui Ueyama <ruiu@google.com>
llvm-svn: 231021

9 years agoFix test case.
Sanjoy Das [Mon, 2 Mar 2015 21:47:47 +0000 (21:47 +0000)]
Fix test case.

r230921 broke backend-optimization-failure.cpp: after
r230921, LLVM no longer emits an expression to compute 'Length - 1'
and this perturbs LoopSimplify enough to emit the warning on line 10
instead of line 9.  This is a review request to fix the test case once
I re-land r230921.

llvm-svn: 231020

9 years agoAttempt to fix buildbot.
Fariborz Jahanian [Mon, 2 Mar 2015 21:46:17 +0000 (21:46 +0000)]
Attempt to fix buildbot.

llvm-svn: 231019

9 years agoRevert some changes that were made to fix PR20680.
Sanjoy Das [Mon, 2 Mar 2015 21:41:07 +0000 (21:41 +0000)]
Revert some changes that were made to fix PR20680.

This re-lands change r230921.  r230921 was reverted because it broke a
clang test; a checkin fixing the clang test will be commited shortly.

Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533.  SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow.  There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.

Revert "IndVarSimplify: Allow LFTR to fire more often"

This reverts commit 1ade0f0faa98877b688e0b9da58e876052c1e04e (SVN: 222213).

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

This reverts commit c0f2b8b528d8a37b0a1522aae90af649d6357eb5 (SVN: 217102).

Reviewers: majnemer, atrick, spatel

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

llvm-svn: 231018

9 years agolit: Add 'cd' support to the internal shell and port some tests
Reid Kleckner [Mon, 2 Mar 2015 21:33:18 +0000 (21:33 +0000)]
lit: Add 'cd' support to the internal shell and port some tests

The internal shell was already threading around a 'cwd' parameter. We
just have to make it mutable so that we can update it as the test script
executes.

If the shell ever grows support for environment variable substitution,
we could also implement support for export.

llvm-svn: 231017

9 years agoUse read{16,32,64}{le,be}() instead of *reinterpret_cast<u{little,big}{16,32,64}_t>().
Rui Ueyama [Mon, 2 Mar 2015 21:19:12 +0000 (21:19 +0000)]
Use read{16,32,64}{le,be}() instead of *reinterpret_cast<u{little,big}{16,32,64}_t>().

llvm-svn: 231016

9 years agoSmallVector: Allow initialization and assignment from initializer_list.
Benjamin Kramer [Mon, 2 Mar 2015 21:16:04 +0000 (21:16 +0000)]
SmallVector: Allow initialization and assignment from initializer_list.

Modeled after std::vector.

llvm-svn: 231015

9 years agoSymbolizer refactoring: Move internals to separate files
Kuba Brecka [Mon, 2 Mar 2015 21:15:09 +0000 (21:15 +0000)]
Symbolizer refactoring: Move internals to separate files

Reviewed at http://reviews.llvm.org/D7972

llvm-svn: 231014

9 years agoAllow compiler-rt build on Bitrig
Renato Golin [Mon, 2 Mar 2015 21:02:43 +0000 (21:02 +0000)]
Allow compiler-rt build on Bitrig

This is the only patch Bitrig uses for compiler-rt. It adds support
for Bitrig/arm in the clear cache code.

Patch by Patrick Wildt.

llvm-svn: 231012

9 years agoTLI: Use lambda. NFC.
Michael Zolotukhin [Mon, 2 Mar 2015 20:50:08 +0000 (20:50 +0000)]
TLI: Use lambda. NFC.

llvm-svn: 231011

9 years ago[CMake] Refactor LLDB main CMake file.
Zachary Turner [Mon, 2 Mar 2015 20:45:26 +0000 (20:45 +0000)]
[CMake] Refactor LLDB main CMake file.

The existing state of affairs was getting a little unwieldy.

All of LLDB's utility functions and initial configuration was in
the root CMake file.  I split this up into 3 separate files and
moved them to relevant subfolders under cmake/modules.

Also, I deleted the add_lldb_definitions() function.  It seemed
to be somewhat useless and did not serve any real purpose that
I was able to figure out.

llvm-svn: 231010

9 years agoImprove robustness of dependency-generation-crash.c test.
Matthias Braun [Mon, 2 Mar 2015 20:44:09 +0000 (20:44 +0000)]
Improve robustness of dependency-generation-crash.c test.

The test wants to provoke a failure when opening the output file.
Using chmod 0 on the output file does not work reliably on all
filesystems or when running the test as root.
Change the test to use a nonexistant directory instead.

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

llvm-svn: 231009

9 years ago[SDK modernizer]. Patch fixes driver's lack of
Fariborz Jahanian [Mon, 2 Mar 2015 20:43:32 +0000 (20:43 +0000)]
[SDK modernizer]. Patch fixes driver's lack of
recognition of mernizer's -objcmt-migrate-property-dot-syntax
option. rdar://19994452

llvm-svn: 231008

9 years agoMake ToVectorTy static.
Michael Zolotukhin [Mon, 2 Mar 2015 20:43:24 +0000 (20:43 +0000)]
Make ToVectorTy static.

llvm-svn: 231007

9 years agoFix a copy-paste bug.
Michael Zolotukhin [Mon, 2 Mar 2015 20:37:10 +0000 (20:37 +0000)]
Fix a copy-paste bug.

llvm-svn: 231006

9 years agoRemove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.
Rui Ueyama [Mon, 2 Mar 2015 20:31:43 +0000 (20:31 +0000)]
Remove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.

llvm-svn: 231005

9 years agoRevert "Refactor DebugLocDWARFExpression so it doesn't require access to the"
Adrian Prantl [Mon, 2 Mar 2015 20:01:54 +0000 (20:01 +0000)]
Revert "Refactor DebugLocDWARFExpression so it doesn't require access to the"

This reverts commit 230975 to investigate buildbot breakage.

llvm-svn: 231004

9 years agoRevert "For the dwarf expression code get the subtarget off of the current"
Adrian Prantl [Mon, 2 Mar 2015 20:01:47 +0000 (20:01 +0000)]
Revert "For the dwarf expression code get the subtarget off of the current"

This reverts commit 230990 because also reverting 230975.

llvm-svn: 231003

9 years agoSupport: Add {read,write}{16,32,64}{le,be} functions.
Rui Ueyama [Mon, 2 Mar 2015 20:00:15 +0000 (20:00 +0000)]
Support: Add {read,write}{16,32,64}{le,be} functions.

Add convenient functions for endian-aware reads/writes.

llvm-svn: 231002

9 years agoRemove useless .debug_macinfo section setup.
Paul Robinson [Mon, 2 Mar 2015 19:52:42 +0000 (19:52 +0000)]
Remove useless .debug_macinfo section setup.

llvm-svn: 231001

9 years ago[ASan/Win] Work around PR22545: call LLVM global_dtors in the MD atexit()
Timur Iskhodzhanov [Mon, 2 Mar 2015 19:41:09 +0000 (19:41 +0000)]
[ASan/Win] Work around PR22545: call LLVM global_dtors in the MD atexit()

llvm-svn: 231000

9 years ago[MSan] Remove explicit -m64 from RUN lines.
Alexey Samsonov [Mon, 2 Mar 2015 19:34:27 +0000 (19:34 +0000)]
[MSan] Remove explicit -m64 from RUN lines.

Target-specific flags should usually be configured by CMake/lit.

llvm-svn: 230999

9 years agoChange SystemZ large tests to use the existing long_tests property
David Blaikie [Mon, 2 Mar 2015 19:34:11 +0000 (19:34 +0000)]
Change SystemZ large tests to use the existing long_tests property

(this is already used in Clang for a couple of tests)

Reviewers: uweigand

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

llvm-svn: 230998

9 years ago[DFSan] Remove explicit -m64 from RUN lines.
Alexey Samsonov [Mon, 2 Mar 2015 19:34:06 +0000 (19:34 +0000)]
[DFSan] Remove explicit -m64 from RUN lines.

Target-specific flags should usually be configured by CMake/lit.

llvm-svn: 230997

9 years ago[Sanitizer] Restrict open_memstream to x86_64. Fixes PR22714.
Alexey Samsonov [Mon, 2 Mar 2015 19:34:02 +0000 (19:34 +0000)]
[Sanitizer] Restrict open_memstream to x86_64. Fixes PR22714.

llvm-svn: 230996

9 years ago[PerformanceTips] Document various items folks have suggested
Philip Reames [Mon, 2 Mar 2015 19:19:04 +0000 (19:19 +0000)]
[PerformanceTips] Document various items folks have suggested

This could stand to be expanded - patches welcome! - but let's at least write them down so they don't get forgotten.

llvm-svn: 230995

9 years agoAdd -fexceptions for targets which need it
Filipe Cabecinhas [Mon, 2 Mar 2015 19:12:51 +0000 (19:12 +0000)]
Add -fexceptions for targets which need it

llvm-svn: 230994

9 years agoApplying D7950 to four near copies of the file.
Chaoren Lin [Mon, 2 Mar 2015 19:12:18 +0000 (19:12 +0000)]
Applying D7950 to four near copies of the file.

Summary:
Using std::thread/random instead of pthread/rand.
Two of them also suffered from the synchronization problem in D7916.

Reviewers: clayborg, zturner, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230993

9 years agoAdd -fexceptions for targets where it isn't the default.
Filipe Cabecinhas [Mon, 2 Mar 2015 19:11:53 +0000 (19:11 +0000)]
Add -fexceptions for targets where it isn't the default.

It still tests that objc++-cpp-output turns on -fcxx-exceptions and
-fobjc-exceptions by being a c++ and objc(++) file.

llvm-svn: 230992

9 years agoAdd r230655 back with a fix.
Rafael Espindola [Mon, 2 Mar 2015 19:08:03 +0000 (19:08 +0000)]
Add r230655 back with a fix.

The issue is that now we have a diag handler during optimizations
and get forward every optimization remark, flooding stdout.

The same filtering should probably be done with or without a
custom handler, but for now just ignore remarks.

Original message:

gold-plugin: "Upgrade" debug info and handle its warnings.

The gold plugin never calls MaterializeModule, so any old debug info
was not deleted and could cause crashes.

Now that it is being "upgraded", the plugin also has to handle warnings
and create Modules with a nice id (it shows in the warning).

llvm-svn: 230991

9 years agoFor the dwarf expression code get the subtarget off of the current
Eric Christopher [Mon, 2 Mar 2015 19:01:47 +0000 (19:01 +0000)]
For the dwarf expression code get the subtarget off of the current
MachineFunction.

llvm-svn: 230990

9 years agoAdd clang support for Objective-C application extensions.
Bob Wilson [Mon, 2 Mar 2015 19:01:14 +0000 (19:01 +0000)]
Add clang support for Objective-C application extensions.

This adds the -fapplication-extension option, along with the
ios_app_extension and macosx_app_extension availability attributes.
Patch by Ted Kremenek

llvm-svn: 230989

9 years agoRestore LLVMLinkModules C API until it is properly deprecated.
Juergen Ributzka [Mon, 2 Mar 2015 18:59:38 +0000 (18:59 +0000)]
Restore LLVMLinkModules C API until it is properly deprecated.

Add the enum "LLVMLinkerMode" back for backwards-compatibility and add the
linker mode parameter back to the "LLVMLinkModules" function. The paramter is
ignored and has no effect.

Patch provided by: Filip Pizlo
Reviewed by: Rafael and Sean

llvm-svn: 230988

9 years agoR600: Use c++11 style for loop
Jan Vesely [Mon, 2 Mar 2015 18:56:52 +0000 (18:56 +0000)]
R600: Use c++11 style for loop

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 230987

9 years ago[Sanitizer] Fix StripPathPrefix function and improve test case.
Alexey Samsonov [Mon, 2 Mar 2015 18:55:46 +0000 (18:55 +0000)]
[Sanitizer] Fix StripPathPrefix function and improve test case.

llvm-svn: 230986

9 years agoRevert r230979, should apply to all X86 ELF.
Paul Robinson [Mon, 2 Mar 2015 18:50:18 +0000 (18:50 +0000)]
Revert r230979, should apply to all X86 ELF.

llvm-svn: 230985

9 years agoAdd -frtti and -fexceptions to tests that assume these are on.
Filipe Cabecinhas [Mon, 2 Mar 2015 18:49:37 +0000 (18:49 +0000)]
Add -frtti and -fexceptions to tests that assume these are on.

Summary:
We now have targets that don't enable rtti/exceptions by default, and the
ASTMatchers tests are assuming that these features are on (e.g: They use
dynamic_cast or try).

Reviewers: klimek, thakis, djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 230984

9 years ago[Windows] Fix getcwd() on Windows.
Zachary Turner [Mon, 2 Mar 2015 18:33:50 +0000 (18:33 +0000)]
[Windows] Fix getcwd() on Windows.

Windows doesn't define getcwd(), so this test executable failed
to compile.

Patch by Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D7962

llvm-svn: 230983

9 years agoclang-tidy: Update test as underlying problem apparently was fixed.
Daniel Jasper [Mon, 2 Mar 2015 18:07:00 +0000 (18:07 +0000)]
clang-tidy: Update test as underlying problem apparently was fixed.

llvm-svn: 230982

9 years agoMaking the SO version major.minor instead of just major because ABI and API change...
Chris Bieneman [Mon, 2 Mar 2015 17:50:13 +0000 (17:50 +0000)]
Making the SO version major.minor instead of just major because ABI and API change between minor versions.

llvm-svn: 230981

9 years agoasan: fix windows build after commit 230978
Dmitry Vyukov [Mon, 2 Mar 2015 17:45:18 +0000 (17:45 +0000)]
asan: fix windows build after commit 230978

llvm-svn: 230980

9 years ago[PS4] Correct relocation for DWARF TLS references.
Paul Robinson [Mon, 2 Mar 2015 17:44:52 +0000 (17:44 +0000)]
[PS4] Correct relocation for DWARF TLS references.

llvm-svn: 230979