platform/upstream/llvm.git
10 years agoXCore target: add section information.
Robert Lytton [Tue, 11 Feb 2014 10:34:51 +0000 (10:34 +0000)]
XCore target: add section information.

Xcore target ABI requires const data that is externally visible
to be handled differently if it has C-language linkage rather than
C++ language linkage.

llvm-svn: 201142

10 years agoXCore target: Pass through "-fverbose-asm" flag to xcc assembler.
Robert Lytton [Tue, 11 Feb 2014 10:34:45 +0000 (10:34 +0000)]
XCore target: Pass through "-fverbose-asm" flag to xcc assembler.

llvm-svn: 201141

10 years agoAVX: fixed a bug in LowerVECTOR_SHUFFLE
Elena Demikhovsky [Tue, 11 Feb 2014 10:21:53 +0000 (10:21 +0000)]
AVX: fixed a bug in LowerVECTOR_SHUFFLE

llvm-svn: 201140

10 years agoclang-format: Support lambdas with namespace-qualified return types.
Daniel Jasper [Tue, 11 Feb 2014 10:16:55 +0000 (10:16 +0000)]
clang-format: Support lambdas with namespace-qualified return types.

E.g.:
  Foo([]()->std::vector<int> { return { 2 }; }());

llvm-svn: 201139

10 years agoclang-format: Fix alignment of comments inside statements.
Daniel Jasper [Tue, 11 Feb 2014 10:08:11 +0000 (10:08 +0000)]
clang-format: Fix alignment of comments inside statements.

Before:
  auto result = SomeObject
                // Calling someFunction on SomeObject
                    .someFunction();

After:
  auto result = SomeObject
                    // Calling someFunction on SomeObject
                    .someFunction();

llvm-svn: 201138

10 years agoAAPCS: Do not split structs after CPRC allocated on stack
Oliver Stannard [Tue, 11 Feb 2014 09:25:50 +0000 (09:25 +0000)]
AAPCS: Do not split structs after CPRC allocated on stack

According to the AAPCS, we can split structs between GPRs and the stack,
except for when an argument has already been allocated on the stack. This
can occur when a large number of floating-point arguments fill up the VFP
registers, and are alllocated on the stack before the general-purpose argument
registers are full.

llvm-svn: 201137

10 years agoRemove TimeValue::toPosixTime() -- it is buggy, semantics are unclear, and its
Dmitri Gribenko [Tue, 11 Feb 2014 09:11:18 +0000 (09:11 +0000)]
Remove TimeValue::toPosixTime() -- it is buggy, semantics are unclear, and its
only current user should be using toEpochTime() instead.

llvm-svn: 201136

10 years agoFix self-hosted -Werror build: delete comma at the end of enumerator list
Alexey Samsonov [Tue, 11 Feb 2014 08:07:54 +0000 (08:07 +0000)]
Fix self-hosted -Werror build: delete comma at the end of enumerator list

llvm-svn: 201135

10 years agoAVX-512: Optimized BUILD_VECTOR pattern;
Elena Demikhovsky [Tue, 11 Feb 2014 07:25:59 +0000 (07:25 +0000)]
AVX-512: Optimized BUILD_VECTOR pattern;
fixed encoding of VEXTRACTPS instruction.

llvm-svn: 201134

10 years ago[Mips] Use the 'CHECK-NEXT' where we need to check a test output exactly
Simon Atanasyan [Tue, 11 Feb 2014 07:17:09 +0000 (07:17 +0000)]
[Mips] Use the 'CHECK-NEXT' where we need to check a test output exactly
line by line.

llvm-svn: 201133

10 years ago[CodeGenPrepare] Test case for the promotions that bypass the
Quentin Colombet [Tue, 11 Feb 2014 06:55:43 +0000 (06:55 +0000)]
[CodeGenPrepare] Test case for the promotions that bypass the
profitability check due to some other checks in the addressing
mode matcher. I.e., test case for commit r201121.

<rdar://problem/16020230>

llvm-svn: 201132

10 years ago[Mips] Simplify the code. Replace redundant 'switch' operator by the single 'if'...
Simon Atanasyan [Tue, 11 Feb 2014 06:36:16 +0000 (06:36 +0000)]
[Mips] Simplify the code. Replace redundant 'switch' operator by the single 'if' one.

llvm-svn: 201131

10 years agoFix PCH deserialization bug with local static symbols being treated as local extern.
Ted Kremenek [Tue, 11 Feb 2014 06:29:29 +0000 (06:29 +0000)]
Fix PCH deserialization bug with local static symbols being treated as local extern.

This triggered a miscompilation of code using Boost's function_template.hpp
when it was included inside a PCH file.  A local static within
that header would be treated as local extern, resulting in the wrong
mangling.  This only occurred during PCH deserialization.

Fixes <rdar://problem/15975816> and <rdar://problem/15926311>.

llvm-svn: 201130

10 years ago[Mips] Handle R_MIPS_COPY relocation.
Simon Atanasyan [Tue, 11 Feb 2014 05:34:02 +0000 (05:34 +0000)]
[Mips] Handle R_MIPS_COPY relocation.

llvm-svn: 201129

10 years ago[Mips] Add "data" symbols to the test input file. No functional changes.
Simon Atanasyan [Tue, 11 Feb 2014 05:33:53 +0000 (05:33 +0000)]
[Mips] Add "data" symbols to the test input file. No functional changes.

llvm-svn: 201128

10 years agoIn RuntimeDyldImpl::emitSection, make Allocate (section size to be allocated) a
Lang Hames [Tue, 11 Feb 2014 05:28:24 +0000 (05:28 +0000)]
In RuntimeDyldImpl::emitSection, make Allocate (section size to be allocated) a
uintptr_t. An unsigned could overflow for large sections.

No test case - anything big enough to overflow an unsigned is going to take an
appreciable time to zero when the test passes.

The choice of uintptr_t was made to match the RTDyldMemoryManager APIs, but
these should probably be hardcoded to uint64_ts: It is legitimate to JIT for
64-bit targets from a 32-bit host/compiler.

llvm-svn: 201127

10 years agoChanged attributes of all gather intrinsics from IntrReadMem to IntrReadArgMem as...
Craig Topper [Tue, 11 Feb 2014 04:05:33 +0000 (04:05 +0000)]
Changed attributes of all gather intrinsics from IntrReadMem to IntrReadArgMem as they access only memory based on argument. Patch by Robert Khasanov.

llvm-svn: 201126

10 years agoUsing the helper API for random number generation.
Aaron Ballman [Tue, 11 Feb 2014 03:40:14 +0000 (03:40 +0000)]
Using the helper API for random number generation.

llvm-svn: 201125

10 years agoHopefully fixing the MinGW 32 build, which was broken by r200767. Not using rand_s...
Aaron Ballman [Tue, 11 Feb 2014 02:47:33 +0000 (02:47 +0000)]
Hopefully fixing the MinGW 32 build, which was broken by r200767. Not using rand_s() since MinGW does not have an implementation for it, but instead using the underlying CryptGenRandom APIs.

llvm-svn: 201124

10 years ago[analyzer] Inline C++ operator new when c++-inline-allocators is turned on.
Jordan Rose [Tue, 11 Feb 2014 02:21:06 +0000 (02:21 +0000)]
[analyzer] Inline C++ operator new when c++-inline-allocators is turned on.

This will let us stage in the modeling of operator new. The -analyzer-config
opton 'c++-inline-allocators' is currently off by default.

Patch by Karthik Bhat!

llvm-svn: 201122

10 years ago[CodeGenPrepare] Undo changes that happened for the profitability check.
Quentin Colombet [Tue, 11 Feb 2014 01:59:02 +0000 (01:59 +0000)]
[CodeGenPrepare] Undo changes that happened for the profitability check.

The addressing mode matcher checks at some point the profitability of folding an
instruction into the addressing mode. When the instruction to be folded has
several uses, it checks that the instruction can be folded in each use.
To do so, it creates a new matcher for each use and check if the instruction is
in the list of the matched instructions of this new matcher.

The new matchers may promote some instructions and this has to be undone to keep
the state of the original matcher consistent.

A test case will follow.

<rdar://problem/16020230>

llvm-svn: 201121

10 years ago[stackprotector] Add command line option -fstack-protector-strong
Josh Magee [Tue, 11 Feb 2014 01:35:14 +0000 (01:35 +0000)]
[stackprotector] Add command line option -fstack-protector-strong

This option has the following effects:
 * It adds the sspstrong IR attribute to each function within the CU.
 * It defines the macro __SSP_STRONG__ with the value of 2.

Differential Revision: http://llvm-reviews.chandlerc.com/D2717

llvm-svn: 201120

10 years agoDebugInfo: Use existing symbol rather than creating it again.
David Blaikie [Tue, 11 Feb 2014 01:23:52 +0000 (01:23 +0000)]
DebugInfo: Use existing symbol rather than creating it again.

llvm-svn: 201119

10 years agoChange RNBRemote::HandlePacket_m() to store the packet on the heap
Jason Molenda [Tue, 11 Feb 2014 00:48:29 +0000 (00:48 +0000)]
Change RNBRemote::HandlePacket_m() to store the packet on the heap
instead of on the stack.  Handles larger packet read requests better.

llvm-svn: 201118

10 years agoAdjust the calls to __introspection_dispatch_thread_get_item_info to
Jason Molenda [Tue, 11 Feb 2014 00:36:18 +0000 (00:36 +0000)]
Adjust the calls to __introspection_dispatch_thread_get_item_info to
use a system-wide unique thread ID instead of a pthread_t to identify
the thread we want debug info for.  Also, free some more memory regions
that needed to be freed.

llvm-svn: 201117

10 years agoMove the *PassPrinter into their own module.
Eli Bendersky [Mon, 10 Feb 2014 23:34:23 +0000 (23:34 +0000)]
Move the *PassPrinter into their own module.

These are self-contained in functionality so it makes sense to separate them,
as opt.cpp has grown quite big already.

Following Eric's suggestions, if this code is ever deemed useful outside of
tools/opt, it will make sense to move it to one of the LLVM libraries like IR.

llvm-svn: 201116

10 years ago[Stackmaps] Cleanup code. No functional change intended.
Juergen Ributzka [Mon, 10 Feb 2014 23:30:26 +0000 (23:30 +0000)]
[Stackmaps] Cleanup code. No functional change intended.

llvm-svn: 201115

10 years agoLTO API: add lto_module_create_from_memory_with_path.
Manman Ren [Mon, 10 Feb 2014 23:26:14 +0000 (23:26 +0000)]
LTO API: add lto_module_create_from_memory_with_path.

This function adds an extra path argument to lto_module_create_from_memory.
The path argument will be passed to makeBuffer to make sure the MemoryBuffer
has a name and the created module has a module identifier.

This is mainly for emitting warning messages from the linker. When we emit
warning message on a module, we can use the module identifier.

rdar://15985737

llvm-svn: 201114

10 years agoMark the methods in the Mangler const.
Rafael Espindola [Mon, 10 Feb 2014 21:25:13 +0000 (21:25 +0000)]
Mark the methods in the Mangler const.

A const ObjectFile needs to be able to provide its name. For an IRObjectFile,
that means being able to call the mangler. Since each IRObjectFile can have
a different mangling, it is natural for them to contain a Mangler which is
therefore also const.

llvm-svn: 201113

10 years ago[AArch64] Fixed vget/vset_lane_f16 implementation
Ana Pazos [Mon, 10 Feb 2014 21:20:53 +0000 (21:20 +0000)]
[AArch64] Fixed vget/vset_lane_f16 implementation

Replaced cast and vreinterepret operations with
code to reinterpret bitwise the types float16_t and
int16_t.

llvm-svn: 201112

10 years agocmake: Do not export targets when installing toolchain only
Reid Kleckner [Mon, 10 Feb 2014 20:44:57 +0000 (20:44 +0000)]
cmake: Do not export targets when installing toolchain only

Patch by Brad King!

llvm-svn: 201111

10 years agoFix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.
Rafael Espindola [Mon, 10 Feb 2014 20:38:38 +0000 (20:38 +0000)]
Fix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.

llvm-svn: 201110

10 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 10 Feb 2014 20:24:27 +0000 (20:24 +0000)]
Update for llvm api change.

llvm-svn: 201109

10 years agoChange the begin and end methods in ObjectFile to match the style guide.
Rafael Espindola [Mon, 10 Feb 2014 20:24:04 +0000 (20:24 +0000)]
Change the begin and end methods in ObjectFile to match the style guide.

llvm-svn: 201108

10 years agoR600: Implement isTruncateFree
Matt Arsenault [Mon, 10 Feb 2014 19:57:42 +0000 (19:57 +0000)]
R600: Implement isTruncateFree

Truncation is just accessing a subregister for any multiple of
the register size, so it's free.

llvm-svn: 201107

10 years agoTests for DR351-370, plus update DR status page to match the latest core issue list.
Richard Smith [Mon, 10 Feb 2014 19:53:17 +0000 (19:53 +0000)]
Tests for DR351-370, plus update DR status page to match the latest core issue list.

llvm-svn: 201106

10 years agoMS ABI: Add support for #pragma pointers_to_members
David Majnemer [Mon, 10 Feb 2014 19:50:15 +0000 (19:50 +0000)]
MS ABI: Add support for #pragma pointers_to_members

Introduce a notion of a 'current representation method' for
pointers-to-members.

When starting out, this is set to 'best case' (representation method is
chosen by examining the class, selecting the smallest representation
that would work given the class definition or lack thereof).

This pragma allows the translation unit to dictate exactly what
representation to use, similar to how the inheritance model keywords
operate.

N.B.  PCH support is forthcoming.

Differential Revision: http://llvm-reviews.chandlerc.com/D2723

llvm-svn: 201105

10 years ago[LPM] A terribly simple fix to a terribly complex bug: PR18773.
Chandler Carruth [Mon, 10 Feb 2014 19:39:35 +0000 (19:39 +0000)]
[LPM] A terribly simple fix to a terribly complex bug: PR18773.

The crux of the issue is that LCSSA doesn't preserve stateful alias
analyses. Before r200067, LICM didn't cause LCSSA to run in the LTO pass
manager, where LICM runs essentially without any of the other loop
passes. As a consequence the globalmodref-aa pass run before that loop
pass manager was able to survive the loop pass manager and be used by
DSE to eliminate stores in the function called from the loop body in
Adobe-C++/loop_unroll (and similar patterns in other benchmarks).

When LICM was taught to preserve LCSSA it had to require it as well.
This caused it to be run in the loop pass manager and because it did not
preserve AA, the stateful AA was lost. Most of LLVM's AA isn't stateful
and so this didn't manifest in most cases. Also, in most cases LCSSA was
already running, and so there was no interesting change.

The real kicker is that LCSSA by its definition (injecting PHI nodes
only) trivially preserves AA! All we need to do is mark it, and then
everything goes back to working as intended. It probably was blocking
some other weird cases of stateful AA but the only one I have is
a 1000-line IR test case from loop_unroll, so I don't really have a good
test case here.

Hopefully this fixes the regressions on performance that have been seen
since that revision.

llvm-svn: 201104

10 years ago<rdar://problem/15996848>
Han Ming Ong [Mon, 10 Feb 2014 19:23:28 +0000 (19:23 +0000)]
<rdar://problem/15996848>

Made sure we pass along the file action paths for stdin/stdout/stderr to the XPC service.
[Reviewed by Greg Clayton]

llvm-svn: 201103

10 years agoBasic: Clean up malformed pragma diagnostics
David Majnemer [Mon, 10 Feb 2014 19:06:37 +0000 (19:06 +0000)]
Basic: Clean up malformed pragma diagnostics

Create a new diagnostic, -Wignored-pragmas and use it to handle any
case where a pragma would have a side effect but is ignored.

llvm-svn: 201102

10 years agoFix for PR17606 - result_of (and INVOKE) works incorrectly for member function pointe...
Marshall Clow [Mon, 10 Feb 2014 17:40:28 +0000 (17:40 +0000)]
Fix for PR17606 - result_of (and INVOKE) works incorrectly for member function pointers with ref qualifiers. Also a drive-by fix for common_type in C++03 mode. Thanks to Michel Morin for the bug report and the proposed fix.

llvm-svn: 201101

10 years agoPR18777: This PR is already fixed; add regtest.
Richard Smith [Mon, 10 Feb 2014 17:21:40 +0000 (17:21 +0000)]
PR18777: This PR is already fixed; add regtest.

llvm-svn: 201100

10 years agoSema: Remove useless MSStructPragmaOn update in Sema::~Sema
David Majnemer [Mon, 10 Feb 2014 17:17:03 +0000 (17:17 +0000)]
Sema: Remove useless MSStructPragmaOn update in Sema::~Sema

No functional change, this code was just superfluous.

llvm-svn: 201099

10 years agoCopy the ThreadLocalMode in GlobalVariable::copyAttributesFrom
Hans Wennborg [Mon, 10 Feb 2014 17:13:56 +0000 (17:13 +0000)]
Copy the ThreadLocalMode in GlobalVariable::copyAttributesFrom

This fixes the oversight from r159077.

llvm-svn: 201098

10 years agoR600/SI: Initialize M0 and emit S_WQM_B64 whenever DS instructions are used
Tom Stellard [Mon, 10 Feb 2014 16:58:30 +0000 (16:58 +0000)]
R600/SI: Initialize M0 and emit S_WQM_B64 whenever DS instructions are used

DS instructions that access local memory can only uses addresses that
are less than or equal to the value of M0.  When M0 is uninitialized,
then we experience undefined behavior.

This patch also changes the behavior to emit S_WQM_B64 on pixel shaders
no matter what kind of DS instruction is used.

llvm-svn: 201097

10 years agoR600/SI: Only use S_WQM_B64 in pixel shaders
Tom Stellard [Mon, 10 Feb 2014 16:58:27 +0000 (16:58 +0000)]
R600/SI: Only use S_WQM_B64 in pixel shaders

This doesn't change any functionality, since we only have two shader
types (compute and pixel) that use local memory.  We're just changing
the logic to match the documentation.

llvm-svn: 201096

10 years agoRemove some prototype code accidentally committed in r201043
David Blaikie [Mon, 10 Feb 2014 16:49:07 +0000 (16:49 +0000)]
Remove some prototype code accidentally committed in r201043

Thanks to Chandler for the catch.

llvm-svn: 201095

10 years agoARM: move vshll NEON implementation to common code
Tim Northover [Mon, 10 Feb 2014 16:20:36 +0000 (16:20 +0000)]
ARM: move vshll NEON implementation to common code

Now that both ARM backends use the same implementation for vshll operations,
the code can be shared. This is also a necessary LLVM/Clang interface update.

llvm-svn: 201094

10 years agoARM: use natural LLVM IR for vshll instructions
Tim Northover [Mon, 10 Feb 2014 16:20:29 +0000 (16:20 +0000)]
ARM: use natural LLVM IR for vshll instructions

Similarly to the vshrn instructions, these are simple zext/sext + trunc
operations. Using normal LLVM IR should allow for better code, and more sharing
with the AArch64 backend.

llvm-svn: 201093

10 years agoHost: unconstify editline paramters
Saleem Abdulrasool [Mon, 10 Feb 2014 16:10:42 +0000 (16:10 +0000)]
Host: unconstify editline paramters

Although the interface to el_push should be a constant parameter (as it is on
Darwin), certain Linux distributions currently ship a header which does not
provide proper const correctness.  This causes compilation failures on Linux.
Strip the constness on the parameter, which whilst incorrect, is mostly
harmless.  The parameter will not be changed by the interface and so it is
acceptable to do this.  When distributions have updated to a more correct
declaration, it would be nice to revert this change.

Addresses PR18784.

llvm-svn: 201092

10 years ago[AArch64] Handle aliases of conditional branches without b.pred form.
Chad Rosier [Mon, 10 Feb 2014 15:43:11 +0000 (15:43 +0000)]
[AArch64] Handle aliases of conditional branches without b.pred form.

llvm-svn: 201091

10 years agoARM: r12 is callee-saved for interrupt handlers
Oliver Stannard [Mon, 10 Feb 2014 14:24:23 +0000 (14:24 +0000)]
ARM: r12 is callee-saved for interrupt handlers

For A- and R-class processors, r12 is not normally callee-saved, but is for
interrupt handlers. See AAPCS, 5.3.1.1, "Use of IP by the linker".

llvm-svn: 201089

10 years agoMake succ_iterator a real random access iterator and clean up a couple of users.
Benjamin Kramer [Mon, 10 Feb 2014 14:17:42 +0000 (14:17 +0000)]
Make succ_iterator a real random access iterator and clean up a couple of users.

llvm-svn: 201088

10 years agoGlobalsModRef: Unify and clean up duplicated pointer analysis code.
Benjamin Kramer [Mon, 10 Feb 2014 14:17:30 +0000 (14:17 +0000)]
GlobalsModRef: Unify and clean up duplicated pointer analysis code.

llvm-svn: 201087

10 years agoARM: implement vshrn NEON intrinsic in terms of shr/trunc
Tim Northover [Mon, 10 Feb 2014 14:04:12 +0000 (14:04 +0000)]
ARM: implement vshrn NEON intrinsic in terms of shr/trunc

Now the backend supports the natural LLVM IR, we can shamelessly steal the
AArch64 front-end code to implement the vshrn intrinsic on 32-bit ARM.

llvm-svn: 201086

10 years agoARM: use LLVM IR to represent the vshrn operation
Tim Northover [Mon, 10 Feb 2014 14:04:07 +0000 (14:04 +0000)]
ARM: use LLVM IR to represent the vshrn operation

vshrn is just the combination of a right shift and a truncate (and the limits
on the immediate value actually mean the signedness of the shift doesn't
matter). Using that representation allows us to get rid of an ARM-specific
intrinsic, share more code with AArch64 and hopefully get better code out of
the mid-end optimisers.

llvm-svn: 201085

10 years agoAdd a copy of missing <ucontext.h> for Android and enable ASan SEGV handler.
Evgeniy Stepanov [Mon, 10 Feb 2014 13:34:43 +0000 (13:34 +0000)]
Add a copy of missing <ucontext.h> for Android and enable ASan SEGV handler.

This change adds a copy of <ucontext.h> for Android found in google-breakpad
that is missing from the official NDK.
ASan SEGV handler is still disabled by default and can be enabled with
ASAN_OPTIONS=handle_segv.

llvm-svn: 201084

10 years agoTest commit - added a new line to vec_shuf-insert.ll.
Robert Lougher [Mon, 10 Feb 2014 12:42:13 +0000 (12:42 +0000)]
Test commit - added a new line to vec_shuf-insert.ll.

llvm-svn: 201083

10 years agoASTUnit: simplify remapping files by using the exact same logic in Preprocessor
Dmitri Gribenko [Mon, 10 Feb 2014 12:31:34 +0000 (12:31 +0000)]
ASTUnit: simplify remapping files by using the exact same logic in Preprocessor

llvm-svn: 201082

10 years ago[mips][msa] Add DLSA instruction.
Matheus Almeida [Mon, 10 Feb 2014 12:05:17 +0000 (12:05 +0000)]
[mips][msa] Add DLSA instruction.

llvm-svn: 201081

10 years ago[mips][msa] Update FileCheck prefix in preparation for
Matheus Almeida [Mon, 10 Feb 2014 11:30:09 +0000 (11:30 +0000)]
[mips][msa] Update FileCheck prefix in preparation for
 the addition of Mips64 tests.

No functional changes.

llvm-svn: 201080

10 years ago[CMake] Add dependencies to gtest.
NAKAMURA Takumi [Mon, 10 Feb 2014 11:27:41 +0000 (11:27 +0000)]
[CMake] Add dependencies to gtest.

llvm-svn: 201079

10 years ago[mips][msa] Make LSA_DESC a parameterizable class.
Matheus Almeida [Mon, 10 Feb 2014 11:15:37 +0000 (11:15 +0000)]
[mips][msa] Make LSA_DESC a parameterizable class.

This way it's possible to share the instruction's description for LSA and
DLSA (to be added).

No functional changes.

llvm-svn: 201078

10 years ago[CMake] LLVMSupport should be responsible to provide system_libs.
NAKAMURA Takumi [Mon, 10 Feb 2014 10:52:19 +0000 (10:52 +0000)]
[CMake] LLVMSupport should be responsible to provide system_libs.

llvm-svn: 201077

10 years agoFix Clang install rules to not set permissions on include/
NAKAMURA Takumi [Mon, 10 Feb 2014 10:51:09 +0000 (10:51 +0000)]
Fix Clang install rules to not set permissions on include/

The CMake install(DIRECTORY) command documents that it sets permissions
on directories it is asked to install.  Since the <prefix>/include
directory may not be exclusive to the LLVM/Clang installation, we should
not ask CMake to manage permissions of that directory for us.  Instead,
give only our own include/clang and include/clang-c subdirectories to
the install(DIRECTORY) command.

Fixes PR4500. Patch by Brad King.

llvm-svn: 201076

10 years agoFix LLVM install rules to not set permissions on include/
NAKAMURA Takumi [Mon, 10 Feb 2014 10:50:55 +0000 (10:50 +0000)]
Fix LLVM install rules to not set permissions on include/

The CMake install(DIRECTORY) command documents that it sets permissions
on directories it is asked to install.  Since the <prefix>/include
directory may not be exclusive to the LLVM installation, we should not
ask CMake to manage permissions of that directory for us.  Instead, give
only our own include/llvm and include/llvm-c subdirectories to the
install(DIRECTORY) command.

Fixes PR4500. Patch by Brad King.

llvm-svn: 201075

10 years ago[msan] Return EINVAL instead of crashing from mmap of an invalid address.
Evgeniy Stepanov [Mon, 10 Feb 2014 09:37:03 +0000 (09:37 +0000)]
[msan] Return EINVAL instead of crashing from mmap of an invalid address.

llvm-svn: 201074

10 years ago[CMake] add_clang_library(): Use llvm_add_library.
NAKAMURA Takumi [Mon, 10 Feb 2014 09:05:28 +0000 (09:05 +0000)]
[CMake] add_clang_library(): Use llvm_add_library.

CMAKE_MODULE_LINKER_FLAGS can be removed since llvm_add_library(MODULE) adds same flags to MODULE.

llvm-svn: 201073

10 years ago[CMake] Introduce llvm_add_library().
NAKAMURA Takumi [Mon, 10 Feb 2014 09:05:11 +0000 (09:05 +0000)]
[CMake] Introduce llvm_add_library().

  - MODULE;SHARED;STATIC
      STATIC by default w/o BUILD_SHARED_LIBS.
      SHARED by default w/  BUILD_SHARED_LIBS.
  - OUTPUT_NAME name
      Corresponds to OUTPUT_NAME in target properties.
  - DEPENDS targets...
      Same semantics as add_dependencies().
  - LINK_COMPONENTS components...
      Same as the variable LLVM_LINK_COMPONENTS.
  - LINK_LIBS lib_targets...
      Same semantics as target_link_libraries().
  - ADDITIONAL_HEADERS (implemented in LLVMProcessSources)
      May specify header files for IDE generators.

I suggest llvm_add_library() may be used for inter-project add_library stuff
and also suggest add_***_library() may be used project-specific.

Please be patient that llvm_add_library might be ambiguous against add_llvm_library.

llvm-svn: 201072

10 years ago[Sanitizer] Don't #include the same system header twice.
Alexey Samsonov [Mon, 10 Feb 2014 08:57:28 +0000 (08:57 +0000)]
[Sanitizer] Don't #include the same system header twice.

llvm-svn: 201071

10 years ago[sanitizer] Disable 3 more syscall hooks on Android.
Evgeniy Stepanov [Mon, 10 Feb 2014 08:35:58 +0000 (08:35 +0000)]
[sanitizer] Disable 3 more syscall hooks on Android.

llvm-svn: 201070

10 years ago[TSan] Fix mismatched mangled names in operator delete interceptors
Alexey Samsonov [Mon, 10 Feb 2014 08:34:46 +0000 (08:34 +0000)]
[TSan] Fix mismatched mangled names in operator delete interceptors

llvm-svn: 201069

10 years ago[sanitizer] struct ustat and a bunch of other definitions are missing on Android.
Evgeniy Stepanov [Mon, 10 Feb 2014 08:00:24 +0000 (08:00 +0000)]
[sanitizer] struct ustat and a bunch of other definitions are missing on Android.

llvm-svn: 201068

10 years ago[asan] support for FreeBSD, LLVM part. patch by Viktor Kutuzov
Kostya Serebryany [Mon, 10 Feb 2014 07:37:04 +0000 (07:37 +0000)]
[asan] support for FreeBSD, LLVM part. patch by Viktor Kutuzov

llvm-svn: 201067

10 years agoAVX-512: Fixed extract_vector_elt for v16i1 and v8i1 vectors.
Elena Demikhovsky [Mon, 10 Feb 2014 07:02:39 +0000 (07:02 +0000)]
AVX-512: Fixed extract_vector_elt for v16i1 and v8i1 vectors.

llvm-svn: 201066

10 years agoRecommit r201059 and r201060 with hopefully a fix for its original failure.
Craig Topper [Mon, 10 Feb 2014 06:55:41 +0000 (06:55 +0000)]
Recommit r201059 and r201060 with hopefully a fix for its original failure.

Original commits messages:

Add MRMXr/MRMXm form to X86 for use by instructions which treat the 'reg' field of modrm byte as a don't care value. Will allow for simplification of disassembler code.

Simplify a bunch of code by removing the need for the x86 disassembler table builder to know about extended opcodes. The modrm forms are sufficient to convey the information.

llvm-svn: 201065

10 years agoRevert r201059 and r201060.
Bob Wilson [Mon, 10 Feb 2014 05:28:30 +0000 (05:28 +0000)]
Revert r201059 and r201060.

r201059 appears to cause a crash in a bootstrapped build of clang. Craig
isn't available to look at it right now, so I'm reverting it while he
investigates.

llvm-svn: 201064

10 years ago[CMake] LLVMProcessSources.cmake: Prune add_file_dependencies to ${TABLEGEN_OUTPUT}.
NAKAMURA Takumi [Mon, 10 Feb 2014 03:24:28 +0000 (03:24 +0000)]
[CMake] LLVMProcessSources.cmake: Prune add_file_dependencies to ${TABLEGEN_OUTPUT}.

I am sure it'd not be required any more.
In trunk, all of tablegen's users depend on ${TABLEGEN_OUTPUT} as not file dependency but inter-target dependency.

llvm-svn: 201063

10 years ago[CMake] Re-apply r200765, "Get rid of llvm_config() to expand dependencies."
NAKAMURA Takumi [Mon, 10 Feb 2014 03:24:19 +0000 (03:24 +0000)]
[CMake] Re-apply r200765, "Get rid of llvm_config() to expand dependencies."

CMake's target_link_libraries() will manage dependencies with Brad's LLVMConfig improvements.

Configuration time may be reduced by a few seconds.

llvm-svn: 201062

10 years ago[AArch64]Implement the copy of two FPR8 registers by using FMOVss of two FPR32 regist...
Hao Liu [Mon, 10 Feb 2014 03:16:22 +0000 (03:16 +0000)]
[AArch64]Implement the copy of two FPR8 registers by using FMOVss of two FPR32 registers in copyPhysReg.

llvm-svn: 201061

10 years agoSimplify a bunch of code by removing the need for the x86 disassembler table builder...
Craig Topper [Mon, 10 Feb 2014 01:58:12 +0000 (01:58 +0000)]
Simplify a bunch of code by removing the need for the x86 disassembler table builder to know about extended opcodes. The modrm forms are sufficient to convey the information.

llvm-svn: 201060

10 years agoAdd MRMXr/MRMXm form to X86 for use by instructions which treat the 'reg' field of...
Craig Topper [Mon, 10 Feb 2014 00:50:34 +0000 (00:50 +0000)]
Add MRMXr/MRMXm form to X86 for use by instructions which treat the 'reg' field of modrm byte as a don't care value. Will allow for simplification of disassembler code.

llvm-svn: 201059

10 years agoMCParser: add a single token lookahead
Saleem Abdulrasool [Sun, 9 Feb 2014 23:29:24 +0000 (23:29 +0000)]
MCParser: add a single token lookahead

Some of the more complex directive and macro handling for GAS compatibility
requires lookahead.  Add a single token lookahead in the MCAsmLexer.

llvm-svn: 201058

10 years agoRemove shell comment in the middle of a single-line command.
Bob Wilson [Sun, 9 Feb 2014 22:36:31 +0000 (22:36 +0000)]
Remove shell comment in the middle of a single-line command.

You can't put a comment in the middle of a command like this. This is
invalid shell syntax and breaks the build.

llvm-svn: 201057

10 years agoPR18685: Ignore class template specializations as potential
Kaelyn Uhrain [Sun, 9 Feb 2014 21:47:04 +0000 (21:47 +0000)]
PR18685: Ignore class template specializations as potential
nested-name-specifiers for typos unless the typo already has
a nested-name-specifier that is a template specialization.

llvm-svn: 201056

10 years agoAsmParser: Simplify code with ArrayRef.
Benjamin Kramer [Sun, 9 Feb 2014 17:13:11 +0000 (17:13 +0000)]
AsmParser: Simplify code with ArrayRef.

No functionality change.

llvm-svn: 201055

10 years agoWhitespace.
NAKAMURA Takumi [Sun, 9 Feb 2014 16:38:31 +0000 (16:38 +0000)]
Whitespace.

llvm-svn: 201054

10 years agoProvide CMake package modules in install tree
NAKAMURA Takumi [Sun, 9 Feb 2014 16:37:02 +0000 (16:37 +0000)]
Provide CMake package modules in install tree

Teach the Makefile build system to generate and install CMake modules
LLVMConfig.cmake and LLVMConfigVersion.cmake so that applications that
build with CMake can use 'find_package(LLVM)' even when LLVM is not
built with CMake.  These modules tell such applications about available
LLVM libraries and their dependencies.

Run llvm-config to generate the list of libraries and use the results of
llvm-build to generate the library dependencies.  Use sed to perform
substitutions in the LLVMConfig.cmake.in and LLVMConfigVersion.cmake.in
sources that our CMake build system uses.

Teach the Makefile build system to generate the LLVMExports.cmake file
with content similar to that produced by the CMake install(EXPORT)
command.  Extend llvm-build with an option to generate the library
dependencies fragment for this file.

Contributed by Brad King.

llvm-svn: 201053

10 years agoAdd version, arch, system libs, and targets to Makefile.config
NAKAMURA Takumi [Sun, 9 Feb 2014 16:36:42 +0000 (16:36 +0000)]
Add version, arch, system libs, and targets to Makefile.config

Teach autoconf/configure.ac to AC_SUBST several additional values in
Makefile.config to make them available to Makefile code.  These will
be useful to generate CMake package modules from the Makefile build.

Contributed by Brad King.

llvm-svn: 201052

10 years agoLoad exported lib and exe targets from LLVMConfig
NAKAMURA Takumi [Sun, 9 Feb 2014 16:36:28 +0000 (16:36 +0000)]
Load exported lib and exe targets from LLVMConfig

Teach each package configuration file to load the LLVMExports file for
its corresponding tree.  This will allow application CMake code to use
logical library and executable target names from LLVM as if they were in
our own build process (e.g. LLVMSupport).  CMake will have enough
information to propagate LLVM library link dependencies automatically
while configuring applications.

Contributed by Brad King.

llvm-svn: 201051

10 years agoExport lib and exe build target names from build tree
NAKAMURA Takumi [Sun, 9 Feb 2014 16:36:16 +0000 (16:36 +0000)]
Export lib and exe build target names from build tree

Record every logical target that we install with install(TARGETS) in a
global LLVM_EXPORTS property.  Then use the export(TARGETS) command to
provide a "LLVMExports.cmake" file that exports logical targets for
import into applications directly from our build tree.

The "LLVMExports.cmake" file is not meant for direct inclusion by
application code but should be included by "LLVMConfig.cmake" in a
future change.

Contributed by Brad King.

llvm-svn: 201050

10 years agoExport lib and exe build target names from install tree
NAKAMURA Takumi [Sun, 9 Feb 2014 16:36:03 +0000 (16:36 +0000)]
Export lib and exe build target names from install tree

Use the install(TARGETS) command EXPORT option for every library and
executable that we install with LLVM.  Then use the install(EXPORT)
command to provide a "LLVMExports.cmake" file that exports logical
targets for import into applications from our install tree.

The "LLVMExports.cmake" file is not meant for direct inclusion by
application code but should be included by "LLVMConfig.cmake" in a
future change.

Contributed by Brad King.

llvm-svn: 201049

10 years agoProvide LLVMConfig in both build and install tree
NAKAMURA Takumi [Sun, 9 Feb 2014 16:35:51 +0000 (16:35 +0000)]
Provide LLVMConfig in both build and install tree

Create separate package configuration files "LLVMConfig.cmake" for the
LLVM build and install trees so that each can have information specific
to its tree.  Configure each with the corresponding include, lib, and
cmake directories.  Include the "LLVM-Config" API modules directly from
the configured cmake modules directory.

In the install tree, compute the installation prefix relative to the
file location.  In the build tree, provide information specific to the
build tree for use by tools like Clang that can build externally against
the LLVM build tree.  Prefix such values in "LLVM_BUILD_" and comment
them as such.

Contributed by Brad King.

llvm-svn: 201048

10 years agoTeach LLVMConfig to avoid modifying CMAKE_MODULE_PATH
NAKAMURA Takumi [Sun, 9 Feb 2014 16:35:40 +0000 (16:35 +0000)]
Teach LLVMConfig to avoid modifying CMAKE_MODULE_PATH

Do not modify this value on the application's behalf and just ensure API
modules are always available next to the LLVMConfig module.  This is
already the case in the install tree so use file(COPY) to make it so in
the build tree.  Include the LLVM-Config API module from next to the
LLVMConfig location.

Contributed by Brad King.

llvm-svn: 201047

10 years agoDe-duplicate references to share/llvm/cmake path
NAKAMURA Takumi [Sun, 9 Feb 2014 16:35:29 +0000 (16:35 +0000)]
De-duplicate references to share/llvm/cmake path

Use a LLVM_INSTALL_PACKAGE_DIR variable to hold the path and reference
it where necessary.

Contributed by Brad King.

llvm-svn: 201046

10 years agoAsmParser: Parse (and ignore) nested .macro definitions.
Benjamin Kramer [Sun, 9 Feb 2014 16:22:00 +0000 (16:22 +0000)]
AsmParser: Parse (and ignore) nested .macro definitions.

This enables a slightly odd feature of gas. The macro is defined when
the outermost macro is instantiated.

PR18599

llvm-svn: 201045

10 years agoUse a consistent argument order in TargetLoweringObjectFile.
Rafael Espindola [Sun, 9 Feb 2014 14:50:44 +0000 (14:50 +0000)]
Use a consistent argument order in TargetLoweringObjectFile.

These methods normally call each other and it is really annoying if the
arguments are in different order. The more common rule was that the arguments
specific to call are first (GV, Encoding, Suffix) and the auxiliary objects
(Mang, TM) come after. This patch changes the exceptions.

llvm-svn: 201044

10 years agoFix formatting introduced in r200941
David Blaikie [Sun, 9 Feb 2014 09:49:29 +0000 (09:49 +0000)]
Fix formatting introduced in r200941

llvm-svn: 201043

10 years ago[libclang] While visiting a C++ destructor decl, keep the type identifier associated...
Argyrios Kyrtzidis [Sun, 9 Feb 2014 08:13:47 +0000 (08:13 +0000)]
[libclang] While visiting a C++ destructor decl, keep the type identifier associated with the decl,
don't turn it into a type ref.

rdar://15907618

llvm-svn: 201042

10 years agoRemove unnecessary include.
Craig Topper [Sun, 9 Feb 2014 07:55:19 +0000 (07:55 +0000)]
Remove unnecessary include.

llvm-svn: 201041