platform/upstream/llvm.git
10 years ago[Mips] Replace assembler code by YAML to make the 'entry-name.test' test target
Simon Atanasyan [Tue, 22 Jul 2014 21:47:34 +0000 (21:47 +0000)]
[Mips] Replace assembler code by YAML to make the 'entry-name.test' test target
independent.

llvm-svn: 213690

10 years ago[RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in instructions.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:55 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in instructions.

Factor out the addend encoding into a helper function and simplify the
processRelocationRef.

Also add a few simple rtdyld tests. More tests to come once GOTs can be tested too.

Related to <rdar://problem/17768539>

llvm-svn: 213689

10 years ago[RuntimeDyld][MachO][AArch64] Implement the decodeAddend method.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:51 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Implement the decodeAddend method.

This adds the required functionality to decode the immediate encoded in an
instruction that is referenced in a relocation entry.

llvm-svn: 213688

10 years ago[RuntimeDyld][MachO][AArch64] Add assertion to check for duplicate addend definition.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:49 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Add assertion to check for duplicate addend definition.

In MachO for AArch64 it is possible to have an explicit addend defined by
the ARM64_RELOC_ADDEND relocation or having an addend encoded within the
instruction. Only one of them are allowed per relocation.

llvm-svn: 213687

10 years ago[RuntimeDyld] Change the return type of decodeAddend to match the storage type.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:46 +0000 (21:42 +0000)]
[RuntimeDyld] Change the return type of decodeAddend to match the storage type.

llvm-svn: 213686

10 years agoFix incompatible assembly in ARM builtins library
Renato Golin [Tue, 22 Jul 2014 20:59:41 +0000 (20:59 +0000)]
Fix incompatible assembly in ARM builtins library

Convert the CBNZ backward branch instruction to CMP and BNE
avoiding illegal backwards branch and making the assembly code
in synh-ops.h to be UAL compliant.

Patch by: Sumanth Gundapaneni

llvm-svn: 213685

10 years agoInclude assembly files in builtins library build
Renato Golin [Tue, 22 Jul 2014 20:59:38 +0000 (20:59 +0000)]
Include assembly files in builtins library build

The CMake assembler build system ignores the .S assembly files in builtins
library build. This patch fixes the issue.

Patch by: Sumanth Gundapaneni

llvm-svn: 213684

10 years agoTypeSynthetic: Fix a pointer-to-function to void-pointer cast
David Majnemer [Tue, 22 Jul 2014 20:40:01 +0000 (20:40 +0000)]
TypeSynthetic: Fix a pointer-to-function to void-pointer cast

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

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

llvm-svn: 213682

10 years agoMangled: Fix an 'unused variable' warning on GNU/Linux
David Majnemer [Tue, 22 Jul 2014 20:36:37 +0000 (20:36 +0000)]
Mangled: Fix an 'unused variable' warning on GNU/Linux

Platforms which don't use LLDB's built-in demangler don't use the
'mangled_length' variable.  Instead, replace it's only use by an
expression it is equivalent to.

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

llvm-svn: 213681

10 years agoUse the correct from type in a SCS
Ehsan Akhgari [Tue, 22 Jul 2014 20:20:14 +0000 (20:20 +0000)]
Use the correct from type in a SCS

Summary:
If during constructing a standard conversion sequence, we resolve an
overload, we need to adjust the from type in the SCS according to the
resolved operator.

I found this bug when debugging PR20218.  This doesn't seem to be
observable, so there is no good way of testing it.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 213680

10 years agoThis patch implements optimization as mentioned in PR19753: Optimize comparisons...
Suyog Sarda [Tue, 22 Jul 2014 19:19:36 +0000 (19:19 +0000)]
This patch implements optimization as mentioned in PR19753: Optimize comparisons with "ashr/lshr exact" of a constanst.
It handles the errors which were seen in PR19958 where wrong code was being emitted due to earlier patch.
Added code for lshr as well as non-exact right shifts.

It implements :
(icmp eq/ne (ashr/lshr const2, A), const1)" ->
(icmp eq/ne A, Log2(const2/const1)) ->
(icmp eq/ne A, Log2(const2) - Log2(const1))

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

llvm-svn: 213678

10 years agoAdded InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"
Suyog Sarda [Tue, 22 Jul 2014 18:30:54 +0000 (18:30 +0000)]
Added InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"

Patch idea by Ankit Jain !

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

llvm-svn: 213677

10 years agoAdded InstCombine Transform for patterns:
Suyog Sarda [Tue, 22 Jul 2014 18:09:41 +0000 (18:09 +0000)]
Added InstCombine Transform for patterns:
"((~A & B) | A) -> (A | B)" and "((A & B) | ~A) -> (~A | B)"

Original Patch credit to Ankit Jain !!

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

llvm-svn: 213676

10 years agoRevert "Treat warnings in Sphinx as errors. The reasons for doing this are..."
Dan Liew [Tue, 22 Jul 2014 18:09:17 +0000 (18:09 +0000)]
Revert "Treat warnings in Sphinx as errors. The reasons for doing this are..."

This reverts commit r213661.

Reverting at the request of Sean Silva.

llvm-svn: 213675

10 years agoAdd LLVM_TOOLS_BINARY_DIR variable to LLVMConfig.cmake so clients
Dan Liew [Tue, 22 Jul 2014 17:48:51 +0000 (17:48 +0000)]
Add LLVM_TOOLS_BINARY_DIR variable to LLVMConfig.cmake so clients
of LLVM using CMake can easily find the tools directory.

LLVM_BUILD_TOOLS_BINARY_DIR was removed because it is now
superfluous.

llvm-svn: 213674

10 years ago[ASan] Fix comments about __sanitizer_cov function
Alexey Samsonov [Tue, 22 Jul 2014 17:46:09 +0000 (17:46 +0000)]
[ASan] Fix comments about __sanitizer_cov function

llvm-svn: 213673

10 years agoFix classic_locale for Android.
Dan Albert [Tue, 22 Jul 2014 17:32:56 +0000 (17:32 +0000)]
Fix classic_locale for Android.

Android's classic_locale begins at _ctype_ + 1.

llvm-svn: 213672

10 years agoDramatically improves C++ demangling performance by introducing a new implementation...
Kate Stone [Tue, 22 Jul 2014 17:03:38 +0000 (17:03 +0000)]
Dramatically improves C++ demangling performance by introducing a new implementation that is much faster than the existing demangler.  While not yet complete, the new demangler will fail gracefully when it encounters symbols it isn’t prepared to deal with.  In these cases LLDB will fall back to using the full demangler to prevent a loss in functionality.  On sizable code bases the fast path succeeds 95% of the time, providing a significant net win.

The new implementation is located in source/Core/FastDemangle.cpp.  It’s fairly straightforward C code with a few basic C++ extensions.  It should compile with little or no change on a variety of platforms, but of course it is still only useful for symbols that comply with the Itanium ABI mangling spec (plus a few Clang extensions.)

<rdar://problem/15397553> <rdar://problem/15794867>

llvm-svn: 213671

10 years agoMake use of the align parameter attribute for all pointer arguments
Hal Finkel [Tue, 22 Jul 2014 16:58:55 +0000 (16:58 +0000)]
Make use of the align parameter attribute for all pointer arguments

We previously supported the align attribute on all (pointer) parameters, but we
only used it for byval parameters. However, it is completely consistent at the
IR level to treat 'align n' on all pointer parameters as an alignment
assumption on the pointer, and now we wll. Specifically, this causes
computeKnownBits to use the align attribute on all pointer parameters, not just
byval parameters. I've also added an explicit parameter attribute test for this
to test/Bitcode/attributes.ll.

And I've updated the LangRef to document the align parameter attribute (as it
turns out, it was not documented at all previously, although the byval
documentation mentioned that it could be used).

There are (at least) two benefits to doing this:
 - It allows enhancing alignment based on the pointer alignment after inlining callees.
 - It allows simplification of pointer arithmetic.

llvm-svn: 213670

10 years agoMake the test runner understand Windows command shell execution.
Zachary Turner [Tue, 22 Jul 2014 16:19:29 +0000 (16:19 +0000)]
Make the test runner understand Windows command shell execution.

Currently, the test runner makes the assumption that it will run
commands through /bin/sh.  This is obviously not true on Windows,
so this patch abstracts this logic out somewhat.  Instead of
having the caller build the command string himself, the caller
will now pass in argument list of the form [[a, b], [c, d], ...]
which will get converted into a string of the form a b; c d or
a b && c d, depending on the platform.

Reviewed by: Todd Fiala

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

llvm-svn: 213669

10 years ago[ASan/Win tests] Bring back -GS- as SEH tests fail otherwise
Timur Iskhodzhanov [Tue, 22 Jul 2014 16:09:11 +0000 (16:09 +0000)]
[ASan/Win tests] Bring back -GS- as SEH tests fail otherwise

llvm-svn: 213668

10 years ago[ASan/Win tests] Don't generate debug info where it is not needed
Timur Iskhodzhanov [Tue, 22 Jul 2014 15:53:10 +0000 (15:53 +0000)]
[ASan/Win tests] Don't generate debug info where it is not needed

Otherwise it results in flaky tests

llvm-svn: 213667

10 years agoX86: drop relocations on __eh_frame sections globally.
Tim Northover [Tue, 22 Jul 2014 15:47:09 +0000 (15:47 +0000)]
X86: drop relocations on __eh_frame sections globally.

Without this, we produce non-extern relocations when targeting older OS X
versions that ld64 can't cope with in the particular context of __eh_frame
sections (who'd want generic relocation-processing anyway?).

This means that an updated linker (ld64 from Xcode 3.2.6 or later) may be
needed when targeting such platforms with a modern version of LLVM, but this is
probably the case anyway and a reasonable requirement.

PR20212, rdar://problem/17544795

llvm-svn: 213665

10 years agoExport LLVM_ENABLE_RTTI and LLVM_ENABLE_EH in LLVMConfig.cmake so
Dan Liew [Tue, 22 Jul 2014 15:41:33 +0000 (15:41 +0000)]
Export LLVM_ENABLE_RTTI and LLVM_ENABLE_EH in LLVMConfig.cmake so
clients of LLVM know if RTTI and/or EH were enabled in the build of
LLVM they are trying to link against.

llvm-svn: 213664

10 years agoAdded LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EH
Dan Liew [Tue, 22 Jul 2014 15:41:18 +0000 (15:41 +0000)]
Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EH
to globally be controlled. Individual targets (e.g.  ExceptionDemo) can
still override this by using LLVM_REQUIRE_RTTI and LLVM_REQUIRE_EH if
they need to be compiled with RTTI or exception handling respectively.

llvm-svn: 213663

10 years agoThis patch implements transform for pattern "(A | B) ^ (~A) -> (A | ~B)".
Suyog Sarda [Tue, 22 Jul 2014 15:37:39 +0000 (15:37 +0000)]
This patch implements transform for pattern "(A | B) ^ (~A) -> (A | ~B)".

Patch Credit to Ankit Jain !!

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

llvm-svn: 213662

10 years agoTreat warnings in Sphinx as errors. The reasons for doing this are...
Dan Liew [Tue, 22 Jul 2014 15:07:35 +0000 (15:07 +0000)]
Treat warnings in Sphinx as errors. The reasons for doing this are...

- When CMake builds the documentation with sphinx-build it treats
  warnings as errors. We should be consistent with what we do in
  CMake.
- Having warnings treated as errors will hopefully encourage
  developers to write documentation correctly.

llvm-svn: 213661

10 years agoFix Sphinx warning.
Dan Liew [Tue, 22 Jul 2014 14:59:38 +0000 (14:59 +0000)]
Fix Sphinx warning.

llvm-svn: 213660

10 years agoremove hardcoded metadata numbers from tests
Robert Lytton [Tue, 22 Jul 2014 14:47:42 +0000 (14:47 +0000)]
remove hardcoded metadata numbers from tests

llvm-svn: 213659

10 years agoImprove the checkUInt32Argument() helper function so that it diagnoses integer consta...
Aaron Ballman [Tue, 22 Jul 2014 14:09:34 +0000 (14:09 +0000)]
Improve the checkUInt32Argument() helper function so that it diagnoses integer constants larger than 32-bits.

llvm-svn: 213658

10 years agoProvide extra information in the "integer constant is too large" diagnostic. This...
Aaron Ballman [Tue, 22 Jul 2014 14:08:09 +0000 (14:08 +0000)]
Provide extra information in the "integer constant is too large" diagnostic. This will be used to improve other diagnostics.

llvm-svn: 213657

10 years ago[ASan/Win] Add SEH handling to the DLL thunk as well
Timur Iskhodzhanov [Tue, 22 Jul 2014 14:02:53 +0000 (14:02 +0000)]
[ASan/Win] Add SEH handling to the DLL thunk as well

llvm-svn: 213656

10 years ago[OCaml] Don't truncate constants over 32 bits in Llvm.const_int.
Peter Zotov [Tue, 22 Jul 2014 13:55:20 +0000 (13:55 +0000)]
[OCaml] Don't truncate constants over 32 bits in Llvm.const_int.

llvm-svn: 213655

10 years ago[ASan/Win] Handle SEH exceptions (best-effort, similar to longjmp)
Timur Iskhodzhanov [Tue, 22 Jul 2014 13:44:18 +0000 (13:44 +0000)]
[ASan/Win] Handle SEH exceptions (best-effort, similar to longjmp)

llvm-svn: 213654

10 years ago[mips] Fix two patterns that select i32's (for MIPS32r6) / i64's (for MIPS64r6)
Sasa Stankovic [Tue, 22 Jul 2014 13:36:02 +0000 (13:36 +0000)]
[mips] Fix two patterns that select i32's (for MIPS32r6) / i64's (for MIPS64r6)
from setne comparison with an i32.

The patterns that are fixed:
  * (select (i32 (setne i32, immZExt16)), i32, i32) (for MIPS32r6)
  * (select (i32 (setne i32, immZExt16)), i64, i64) (for MIPS64r6)

llvm-svn: 213653

10 years agoAdding a heading to the loop hint attributes so that attribute documentation can...
Aaron Ballman [Tue, 22 Jul 2014 13:13:31 +0000 (13:13 +0000)]
Adding a heading to the loop hint attributes so that attribute documentation can be generated again.

llvm-svn: 213652

10 years agoEscaping an RST character to correct a Sphinx warning.
Aaron Ballman [Tue, 22 Jul 2014 13:12:38 +0000 (13:12 +0000)]
Escaping an RST character to correct a Sphinx warning.

llvm-svn: 213651

10 years agoDisallowing GNU-style attributes in new expressions, since they are prohibited by...
Aaron Ballman [Tue, 22 Jul 2014 12:44:22 +0000 (12:44 +0000)]
Disallowing GNU-style attributes in new expressions, since they are prohibited by GCC as well.

llvm-svn: 213650

10 years ago[ASan/Win] Add handling of C++ exceptions to the RTL
Timur Iskhodzhanov [Tue, 22 Jul 2014 12:37:51 +0000 (12:37 +0000)]
[ASan/Win] Add handling of C++ exceptions to the RTL

Also add a longjmp() test

llvm-svn: 213649

10 years ago[OPENMP] Tests for nesting of regions for 'atomic' directive.
Alexey Bataev [Tue, 22 Jul 2014 12:35:18 +0000 (12:35 +0000)]
[OPENMP] Tests for nesting of regions for 'atomic' directive.

llvm-svn: 213648

10 years ago[clang-tidy] Add a check for RAII temporaries.
Benjamin Kramer [Tue, 22 Jul 2014 12:30:35 +0000 (12:30 +0000)]
[clang-tidy] Add a check for RAII temporaries.

Summary:
This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
  {
    scoped_lock(&global_mutex);
    critical_section();
  }

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213647

10 years ago[ASan] Simplify exception/longjmp tests even further
Timur Iskhodzhanov [Tue, 22 Jul 2014 12:25:51 +0000 (12:25 +0000)]
[ASan] Simplify exception/longjmp tests even further

llvm-svn: 213646

10 years agoAVX-512: I added new headers to makefiles. It should resolve tests fail.
Elena Demikhovsky [Tue, 22 Jul 2014 12:08:25 +0000 (12:08 +0000)]
AVX-512: I added new headers to makefiles. It should resolve tests fail.
If it will not, I'm reverting the both commits.

llvm-svn: 213645

10 years agoFix an issue where an entry point of 0x00 would cause LLDB to think that the ELF...
Deepak Panickal [Tue, 22 Jul 2014 12:01:43 +0000 (12:01 +0000)]
Fix an issue where an entry point of 0x00 would cause LLDB to think that the ELF is not executable without checking for ET_EXEC

llvm-svn: 213644

10 years agoFix the warnings introduced
Deepak Panickal [Tue, 22 Jul 2014 11:59:11 +0000 (11:59 +0000)]
Fix the warnings introduced

llvm-svn: 213643

10 years ago[ASan] Split throw_catch tests into two files: throw/catch + longjmp
Timur Iskhodzhanov [Tue, 22 Jul 2014 11:46:24 +0000 (11:46 +0000)]
[ASan] Split throw_catch tests into two files: throw/catch + longjmp

Also add some more assertions into these tests

llvm-svn: 213642

10 years agoAVX-512: Added intrinsics to clang.
Elena Demikhovsky [Tue, 22 Jul 2014 11:31:39 +0000 (11:31 +0000)]
AVX-512: Added intrinsics to clang.
The set is small, that what I have right now.
Everybody is welcome to add more.

llvm-svn: 213641

10 years agoAVX-512: Fixed intrinsic of VSQRTPS/PD instructions.
Elena Demikhovsky [Tue, 22 Jul 2014 11:07:31 +0000 (11:07 +0000)]
AVX-512: Fixed intrinsic of VSQRTPS/PD instructions.
I set number and types of parameters according to GCC intrinsics.

llvm-svn: 213640

10 years ago[OPENMP] Initial parsing and sema analysis for 'atomic' directive.
Alexey Bataev [Tue, 22 Jul 2014 10:10:35 +0000 (10:10 +0000)]
[OPENMP] Initial parsing and sema analysis for 'atomic' directive.

llvm-svn: 213639

10 years ago[OPENMP] Initial parsing and sema analysis for 'ordered' directive.
Alexey Bataev [Tue, 22 Jul 2014 06:45:04 +0000 (06:45 +0000)]
[OPENMP] Initial parsing and sema analysis for 'ordered' directive.

llvm-svn: 213616

10 years agoFix std::make_heap's worst case time complexity
David Majnemer [Tue, 22 Jul 2014 06:07:09 +0000 (06:07 +0000)]
Fix std::make_heap's worst case time complexity

std::make_heap is currently implemented by iteratively applying a
siftup-type algorithm.  Since sift-up is O(ln n), this gives
std::make_heap a worst case time complexity of O(n ln n).

The C++ standard mandates that std::make_heap make no more than O(3n)
comparisons, this makes our std::make_heap out of spec.

Fix this by introducing an implementation of __sift_down and switch
std::make_heap to create the heap using it.
This gives std::make_heap linear time complexity in the worst case.

This fixes PR20161.

llvm-svn: 213615

10 years agofixed typo in comment
Sanjay Patel [Tue, 22 Jul 2014 04:57:06 +0000 (04:57 +0000)]
fixed typo in comment

llvm-svn: 213614

10 years agoFix '&' printing for template arguments in parentheses in template diffing.
Richard Trieu [Tue, 22 Jul 2014 04:42:15 +0000 (04:42 +0000)]
Fix '&' printing for template arguments in parentheses in template diffing.

llvm-svn: 213613

10 years ago[SDAG] Refactor the code for inserting a newly allocated SDNode into the
Chandler Carruth [Tue, 22 Jul 2014 04:07:55 +0000 (04:07 +0000)]
[SDAG] Refactor the code for inserting a newly allocated SDNode into the
DAG into a helper function.

This adds a trip through the (very minimal) verification logic in
a bunch of places that were missing it, but shouldn't have any other
impact outside of refactoring. I'm hoping to use this to do more clever
things when DAG nodes are inserted into the graph.

llvm-svn: 213612

10 years agoMore gracefully handle parentheses in templare arguments in template diffing.
Richard Trieu [Tue, 22 Jul 2014 04:06:54 +0000 (04:06 +0000)]
More gracefully handle parentheses in templare arguments in template diffing.

llvm-svn: 213611

10 years ago[SDAG] Remove a giant pile of asserts that may have helped track down
Chandler Carruth [Tue, 22 Jul 2014 04:03:22 +0000 (04:03 +0000)]
[SDAG] Remove a giant pile of asserts that may have helped track down
a bug in 2010 when they were added but are adding no value today.

In fact, they are utter lies. NodeAllocator is used to allocate almost
all of these node types. I don't know what we were trying to assert
here, and the docs don't give any answer. Until we once again stumble
upon a bug needing help, let's clear the path for improvements.

llvm-svn: 213610

10 years agoFix a template diffing problem were an '&' is unexpectedly printed in
Richard Trieu [Tue, 22 Jul 2014 03:33:01 +0000 (03:33 +0000)]
Fix a template diffing problem were an '&' is unexpectedly printed in
a template argument.

llvm-svn: 213609

10 years agoAdd openmp to the list of tagged things.
Bill Wendling [Tue, 22 Jul 2014 03:17:30 +0000 (03:17 +0000)]
Add openmp to the list of tagged things.

llvm-svn: 213608

10 years agoRevert of r213521. This change introduced a non-hermetic test (depending on a
Richard Smith [Tue, 22 Jul 2014 02:32:12 +0000 (02:32 +0000)]
Revert of r213521. This change introduced a non-hermetic test (depending on a
file not in the test/ area). Backing out now so that this test isn't part of
the 3.5 branch.

Original commit message: "TableGen: Allow AddedComplexity values to be negative
[...]"

llvm-svn: 213596

10 years agoSema: correct handling for __va_start for WoA
Saleem Abdulrasool [Tue, 22 Jul 2014 02:01:04 +0000 (02:01 +0000)]
Sema: correct handling for __va_start for WoA

Windows ARM indicates __va_start as a variadic function.  However, the function
itself is treated as having 4 formal arguments:
  - (out) pointer to the va_list
  - (in) address of the last named argument
  - (in) slot size for the type of the last argument
  - address of the last named argument

The last argument does not seem to have any bearing on codegen, and thus is not
explicitly type checked at this point.

Unlike the previous handling for __va_start, it does not currently validate if
the parameter is the last named parameter (it seems that MSVC currently accepts
this).

llvm-svn: 213595

10 years agoAvoid crash if default argument parsed with errors.
Serge Pavlov [Tue, 22 Jul 2014 01:54:49 +0000 (01:54 +0000)]
Avoid crash if default argument parsed with errors.

If function parameters have default values, and that of the second
parameter is parsed with errors, function declaration would have
a parameter without default value that follows a parameter with
that. Such declaration breaks logic of selecting overloaded
function. As a solution, put opaque object as default value in such case.

This patch fixes PR20055.

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

llvm-svn: 213594

10 years ago-fms-extensions: Implement half of #pragma init_seg
Reid Kleckner [Tue, 22 Jul 2014 00:53:05 +0000 (00:53 +0000)]
-fms-extensions: Implement half of #pragma init_seg

Summary:
This pragma is very rare.  We could *hypothetically* lower some uses of
it down to @llvm.global_ctors, but given that GlobalOpt isn't able to
optimize prioritized global ctors today, there's really no point.

If we wanted to do this in the future, I would check if the section used
in the pragma started with ".CRT$XC" and had up to two characters after
it.  Those two characters could form the 16-bit initialization priority
that we support in @llvm.global_ctors.  We would have to teach LLVM to
lower prioritized global ctors on COFF as well.

This should let us compile some silly uses of this pragma in WebKit /
Blink.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

llvm-svn: 213593

10 years ago[mach-o] Add test case for armv6 (arm not thumb) hello world
Nick Kledzik [Tue, 22 Jul 2014 00:49:49 +0000 (00:49 +0000)]
[mach-o] Add test case for armv6 (arm not thumb) hello world

llvm-svn: 213592

10 years agoImprove LLDB's embedded C++ demangler by addressing the following two issues:
Kate Stone [Tue, 22 Jul 2014 00:18:52 +0000 (00:18 +0000)]
Improve LLDB's embedded C++ demangler by addressing the following two issues:

1) Preserve ref qualification state in a local variable while parsing a nested name.  Previously, the state was recorded in the shared db reference and could therefore be overwritten when parsing multiple levels of nested names (e.g.: when a qualified name has qualified template args.)

2) Address an off-by-one error when testing whether or not a thunk is non-virtual.  This resulted in the demangled identifying all thunks as non-virtual.

llvm-svn: 213591

10 years ago[MSan] Fix strncpy interceptor
Alexey Samsonov [Tue, 22 Jul 2014 00:10:08 +0000 (00:10 +0000)]
[MSan] Fix strncpy interceptor

llvm-svn: 213590

10 years agoclang-cl: ignore /showIncludes when combined with /E (PR20336)
Hans Wennborg [Mon, 21 Jul 2014 23:42:07 +0000 (23:42 +0000)]
clang-cl: ignore /showIncludes when combined with /E (PR20336)

Both /showIncludes and /E write to stdout. Allowing both results
in interleaved output and an error when double-closing the file
descriptor, intended to catch issues like this.

llvm-svn: 213589

10 years agoRename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.
Mark Heffernan [Mon, 21 Jul 2014 23:11:03 +0000 (23:11 +0000)]
Rename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.

llvm-svn: 213588

10 years agoRename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.
Mark Heffernan [Mon, 21 Jul 2014 23:10:56 +0000 (23:10 +0000)]
Rename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.

llvm-svn: 213587

10 years agoAdd some tests for NVPTX lowering of cmpxchg
Eli Bendersky [Mon, 21 Jul 2014 22:54:44 +0000 (22:54 +0000)]
Add some tests for NVPTX lowering of cmpxchg

llvm-svn: 213586

10 years ago[mach-o] add support for old x86 __eh_frame sections
Nick Kledzik [Mon, 21 Jul 2014 22:06:57 +0000 (22:06 +0000)]
[mach-o] add support for old x86 __eh_frame sections

Over time the symbols and relocations have changed for dwarf unwind info
in the __eh_frame section.  Add test cases for older and new style.

llvm-svn: 213585

10 years agoclang-format vs plugin: set version number from cmake (PR20307)
Hans Wennborg [Mon, 21 Jul 2014 21:48:06 +0000 (21:48 +0000)]
clang-format vs plugin: set version number from cmake (PR20307)

Previously it was hard-coded to 1.0, which meant the installer would
not install the plugin over previous versions.

This commit makes us use LLVM's major.minor.patch version from cmake,
or whatever CLANG_FORMAT_VS_VERSION is set to when configuring the build.

It's pretty dirty to update a configuration file in the source directory
from the cmake build like this. However, the plugin build is already
dirty in this regard since it builds in the source dir when visual studio,
and then copies out the resulting vsix.

llvm-svn: 213584

10 years ago[ASan] Fix __asan_describe_address and add a test for it.
Alexey Samsonov [Mon, 21 Jul 2014 21:33:46 +0000 (21:33 +0000)]
[ASan] Fix __asan_describe_address and add a test for it.

llvm-svn: 213583

10 years agoMatch semantics of PointerMayBeCapturedBefore to its name by default
Hal Finkel [Mon, 21 Jul 2014 21:30:22 +0000 (21:30 +0000)]
Match semantics of PointerMayBeCapturedBefore to its name by default

As it turns out, the capture tracker named CaptureBefore used by AA, and now
available via the PointerMayBeCapturedBefore function, would have been
more-aptly named CapturedBeforeOrAt, because it considers captures at the
instruction provided. This is not always what one wants, and it is difficult to
get the strictly-before behavior given only the current interface. This adds an
additional parameter which controls whether or not you want to include
captures at the provided instruction. The default is not to include the
instruction provided, so that 'Before' matches its name.

No functionality change intended.

llvm-svn: 213582

10 years agoRevert "Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for...
David Blaikie [Mon, 21 Jul 2014 20:45:59 +0000 (20:45 +0000)]
Revert "Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information."

This reverts commit r212649 while I investigate/reduce/etc PR20367.

llvm-svn: 213581

10 years agotest-release.sh: Add support for dot releases
Tom Stellard [Mon, 21 Jul 2014 20:20:08 +0000 (20:20 +0000)]
test-release.sh: Add support for dot releases

llvm-svn: 213580

10 years agoRevert "Emit lifetime.start / lifetime.end markers for unnamed temporary objects."
Arnaud A. de Grandmaison [Mon, 21 Jul 2014 19:47:02 +0000 (19:47 +0000)]
Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary objects."

This commit did break the sanitizer-x86 bot. Revert it while
investigating.

llvm-svn: 213579

10 years agoFix build breakage caused by use of std::to_string(int). Replace with raw_string_ost...
Mark Heffernan [Mon, 21 Jul 2014 19:06:29 +0000 (19:06 +0000)]
Fix build breakage caused by use of std::to_string(int).  Replace with raw_string_ostream.

llvm-svn: 213578

10 years agoAdjust gen_dynamic_list for PowerPC function descriptors
Alexey Samsonov [Mon, 21 Jul 2014 19:01:03 +0000 (19:01 +0000)]
Adjust gen_dynamic_list for PowerPC function descriptors

llvm-svn: 213577

10 years agoEmit lifetime.start / lifetime.end markers for unnamed temporary objects.
Arnaud A. de Grandmaison [Mon, 21 Jul 2014 18:54:21 +0000 (18:54 +0000)]
Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots.

llvm-svn: 213576

10 years agobuild: silence GCC warning on Linux
Saleem Abdulrasool [Mon, 21 Jul 2014 18:18:52 +0000 (18:18 +0000)]
build: silence GCC warning on Linux

LLDWrapPython.cpp is a generated file.  This contains a double assignment to the
same value, which causes GCC to emit a warning about sequence point evaluation
causing a use-before-init.  Simply silence the warning.

llvm-svn: 213575

10 years agoAdd support for '#pragma unroll'.
Mark Heffernan [Mon, 21 Jul 2014 18:08:34 +0000 (18:08 +0000)]
Add support for '#pragma unroll'.

llvm-svn: 213574

10 years agoSema: Handle C11 atomics when diagnosing out of range comparisons
Justin Bogner [Mon, 21 Jul 2014 18:01:53 +0000 (18:01 +0000)]
Sema: Handle C11 atomics when diagnosing out of range comparisons

This fixes a couple of asserts when analyzing comparisons involving
C11 atomics that were uncovered by r205608 when we extended the
applicability of -Wtautological-constant-out-of-range-compare.

llvm-svn: 213573

10 years agoR600: silence GCC warning
Saleem Abdulrasool [Mon, 21 Jul 2014 17:52:00 +0000 (17:52 +0000)]
R600: silence GCC warning

GCC believes it may be possible to not return a value from the switch:
  lib/Target/R600/SIRegisterInfo.cpp:187:1: warning: control reaches end of non-void function [-Wreturn-type]

Add an unreachable label to indicate that this is not possible and still permit
switch coverage checking.

llvm-svn: 213572

10 years agoR600/SI: Refactor VOP3 instruction definitions
Tom Stellard [Mon, 21 Jul 2014 17:44:29 +0000 (17:44 +0000)]
R600/SI: Refactor VOP3 instruction definitions

llvm-svn: 213571

10 years agoR600/SI: Separate encoding and operand definitions into their own classes
Tom Stellard [Mon, 21 Jul 2014 17:44:28 +0000 (17:44 +0000)]
R600/SI: Separate encoding and operand definitions into their own classes

llvm-svn: 213570

10 years agoReplace the result usages while legalizing cmpxchg.
Logan Chien [Mon, 21 Jul 2014 17:33:44 +0000 (17:33 +0000)]
Replace the result usages while legalizing cmpxchg.

We should update the usages to all of the results;
otherwise, we might get assertion failure or SEGV during
the type legalization of ATOMIC_CMP_SWAP_WITH_SUCCESS
with two or more illegal types.

For example, in the following sequence, both i8 and i1
might be illegal in some target, e.g. armv5, mipsel, mips64el,

    %0 = cmpxchg i8* %ptr, i8 %desire, i8 %new monotonic monotonic
    %1 = extractvalue { i8, i1 } %0, 1

Since both i8 and i1 should be legalized, the corresponding
ATOMIC_CMP_SWAP_WITH_SUCCESS dag will be checked/replaced/updated
twice.

If we don't update the usage to *ALL* of the results in the
first round, the DAG for extractvalue might be processed earlier.
The GetPromotedInteger() will result in assertion failure,
because its operand (i.e. the success bit of cmpxchg) is not
promoted beforehand.

llvm-svn: 213569

10 years agoUpdate CMakeLists.txt and Makefiles for building/linking the Hexagon ABI and Dynamic...
Deepak Panickal [Mon, 21 Jul 2014 17:24:05 +0000 (17:24 +0000)]
Update CMakeLists.txt and Makefiles for building/linking the Hexagon ABI and Dynamic Loader

llvm-svn: 213568

10 years agoAdd the Hexagon DSP breakpoint opcode to PlatformWindows and PlatformLinux
Deepak Panickal [Mon, 21 Jul 2014 17:22:12 +0000 (17:22 +0000)]
Add the Hexagon DSP breakpoint opcode to PlatformWindows and PlatformLinux

llvm-svn: 213567

10 years agoABI for the Hexagon DSP
Deepak Panickal [Mon, 21 Jul 2014 17:21:01 +0000 (17:21 +0000)]
ABI for the Hexagon DSP

llvm-svn: 213566

10 years agoDynamic loader for the Hexagon DSP
Deepak Panickal [Mon, 21 Jul 2014 17:19:12 +0000 (17:19 +0000)]
Dynamic loader for the Hexagon DSP

llvm-svn: 213565

10 years agoR600/SI: Initailize encoding fields of unused VOP3 modifiers to 0
Tom Stellard [Mon, 21 Jul 2014 17:12:40 +0000 (17:12 +0000)]
R600/SI: Initailize encoding fields of unused VOP3 modifiers to 0

llvm-svn: 213564

10 years agoR600/SI: Initialize unused VOP3 sources to 0 instead of SIOperand.ZERO
Tom Stellard [Mon, 21 Jul 2014 17:12:37 +0000 (17:12 +0000)]
R600/SI: Initialize unused VOP3 sources to 0 instead of SIOperand.ZERO

llvm-svn: 213563

10 years agoRevert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator...
Duncan P. N. Exon Smith [Mon, 21 Jul 2014 17:06:51 +0000 (17:06 +0000)]
Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges."

This reverts commit r213474 (and r213475), which causes a miscompile on
a stage2 LTO build.  I'll reply on the list in a moment.

llvm-svn: 213562

10 years agoR600/SI: Add instruction shrinking pass
Tom Stellard [Mon, 21 Jul 2014 16:55:33 +0000 (16:55 +0000)]
R600/SI: Add instruction shrinking pass

This pass converts 64-bit instructions to 32-bit when possible.

llvm-svn: 213561

10 years agoFix lld build for llvm API changes committed in r213557
David Blaikie [Mon, 21 Jul 2014 16:46:14 +0000 (16:46 +0000)]
Fix lld build for llvm API changes committed in r213557

llvm-svn: 213560

10 years agoFix Sphinx warnings.
Dan Liew [Mon, 21 Jul 2014 16:39:00 +0000 (16:39 +0000)]
Fix Sphinx warnings.

llvm-svn: 213559

10 years agoR600/SI: VOPC instructions explicitly define VCC
Tom Stellard [Mon, 21 Jul 2014 16:27:24 +0000 (16:27 +0000)]
R600/SI: VOPC instructions explicitly define VCC

Therefore we don't need to add it to the implict defs list.

llvm-svn: 213558

10 years agoCorrect the ownership passing semantics of object::createBinary and make them explici...
David Blaikie [Mon, 21 Jul 2014 16:26:24 +0000 (16:26 +0000)]
Correct the ownership passing semantics of object::createBinary and make them explicit in the type system.

createBinary documented that it destroyed the parameter in error cases,
though by observation it does not. By passing the unique_ptr by value
rather than lvalue reference, callers are now explicit about passing
ownership and the function implements the documented contract. Remove
the explicit documentation, since now the behavior cannot be anything
other than what was documented, so it's redundant.

Also drops a unique_ptr::release in llvm-nm that was always run on a
null unique_ptr anyway.

llvm-svn: 213557

10 years agoRemove unnecessary use of unique_ptr::release() used to construct another unique_ptr.
David Blaikie [Mon, 21 Jul 2014 16:23:21 +0000 (16:23 +0000)]
Remove unnecessary use of unique_ptr::release() used to construct another unique_ptr.

llvm-svn: 213556

10 years agoRename dosep.ty to dosep.py
Zachary Turner [Mon, 21 Jul 2014 16:16:31 +0000 (16:16 +0000)]
Rename dosep.ty to dosep.py

llvm-svn: 213555