platform/upstream/llvm.git
9 years agoRemove unused diagnostic.
Benjamin Kramer [Mon, 10 Nov 2014 16:07:58 +0000 (16:07 +0000)]
Remove unused diagnostic.

llvm-svn: 221605

9 years ago[mips] Fix sret arguments for N32/N64 which were accidentally broken in r221534.
Daniel Sanders [Mon, 10 Nov 2014 15:57:53 +0000 (15:57 +0000)]
[mips] Fix sret arguments for N32/N64 which were accidentally broken in r221534.

llvm-svn: 221604

9 years ago[Mips] Replace the redundant condition by assert call
Simon Atanasyan [Mon, 10 Nov 2014 15:50:22 +0000 (15:50 +0000)]
[Mips] Replace the redundant condition by assert call

No functional changes.

llvm-svn: 221603

9 years ago[Mips] Do not read addends for relocations which do not use them
Simon Atanasyan [Mon, 10 Nov 2014 15:50:01 +0000 (15:50 +0000)]
[Mips] Do not read addends for relocations which do not use them

No functional changes.

llvm-svn: 221602

9 years agoUpdate status pages for C++1z
Marshall Clow [Mon, 10 Nov 2014 15:43:20 +0000 (15:43 +0000)]
Update status pages for C++1z

llvm-svn: 221601

9 years ago[Tooling] Restore current directory after processing each file.
Alexander Kornienko [Mon, 10 Nov 2014 15:42:31 +0000 (15:42 +0000)]
[Tooling] Restore current directory after processing each file.

Summary:
If we actually change directory before processing a file, we need to
restore it afterwards. This was broken in r216620.

Added a comment for the changes in r216620.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 221600

9 years agoEnable running Ubsan tests on FreeBSD
Viktor Kutuzov [Mon, 10 Nov 2014 15:31:56 +0000 (15:31 +0000)]
Enable running Ubsan tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6089

llvm-svn: 221599

9 years agoMark test using python as REQUIRES: python27.
Manuel Klimek [Mon, 10 Nov 2014 15:29:29 +0000 (15:29 +0000)]
Mark test using python as REQUIRES: python27.

llvm-svn: 221598

9 years ago[Ubsan] Fix the missing_return.cpp test to pass on FreeBSD
Viktor Kutuzov [Mon, 10 Nov 2014 15:27:13 +0000 (15:27 +0000)]
[Ubsan] Fix the missing_return.cpp test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6088

llvm-svn: 221597

9 years ago[Ubsan] Fix the cast-overflow.cpp test to build on FreeBSD
Viktor Kutuzov [Mon, 10 Nov 2014 15:25:01 +0000 (15:25 +0000)]
[Ubsan] Fix the cast-overflow.cpp test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D6087

llvm-svn: 221596

9 years ago[Sanitizers] Enable stack traces on FreeBSD
Viktor Kutuzov [Mon, 10 Nov 2014 15:22:04 +0000 (15:22 +0000)]
[Sanitizers] Enable stack traces on FreeBSD
Differential Revision: http://reviews.llvm.org/D6086

llvm-svn: 221595

9 years ago[ELF] add missing test for max-page-size
Shankar Easwaran [Mon, 10 Nov 2014 15:16:31 +0000 (15:16 +0000)]
[ELF] add missing test for max-page-size

llvm-svn: 221594

9 years agoLLGS Android target support (r221570) missed adding some files: http://reviews.llvm...
Shawn Best [Mon, 10 Nov 2014 15:06:15 +0000 (15:06 +0000)]
LLGS Android target support (r221570) missed adding some files: reviews.llvm.org/D6166

llvm-svn: 221593

9 years ago[CMake] llvm-c-test: Use libLLVM.so if it is available.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:04:26 +0000 (15:04 +0000)]
[CMake] llvm-c-test: Use libLLVM.so if it is available.

llvm-svn: 221592

9 years ago[CMake] Let llvm-shlib work on Linux with --whole-archive.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:04:02 +0000 (15:04 +0000)]
[CMake] Let llvm-shlib work on Linux with --whole-archive.

FIXME: It should work on not only Linux but elf-targeting gnu ld.

For example if LLVM_DYLIB_COMPONENTS is "BitWriter Support", CMake emits the command line like;

  -Wl,--whole-archive
    lib/libLLVMBitWriter.a
    lib/libLLVMSupport.a *1
  -Wl,--no-whole-archive
  lib/libLLVMCore.a
  lib/libLLVMSupport.a   *2
  -lrt -ldl -ltinfo -lpthread -lm

It works since symbols in LLVMCore is resolved with not *2 but *1.

Unfortunately, --gc-sections is not powerful in this case to prune unused "visibility(default)" entries.

I am still experimenting other way not to rely on --whole-archive.

llvm-svn: 221591

9 years ago[CMake] Move llvm-shlib in prior to other tools.
NAKAMURA Takumi [Mon, 10 Nov 2014 15:03:02 +0000 (15:03 +0000)]
[CMake] Move llvm-shlib in prior to other tools.

llvm-svn: 221590

9 years ago[Gnu] Support --image-base option
Shankar Easwaran [Mon, 10 Nov 2014 14:55:21 +0000 (14:55 +0000)]
[Gnu] Support --image-base option

The value for --image-base is used as the base address of the program.

llvm-svn: 221589

9 years ago[ELF] Fix DT_INIT_ARRAY{SZ} and DT_FINI_ARRAY{SZ}
Shankar Easwaran [Mon, 10 Nov 2014 14:55:11 +0000 (14:55 +0000)]
[ELF] Fix DT_INIT_ARRAY{SZ} and DT_FINI_ARRAY{SZ}

The dynamic table was creating the entry DT_FINI_ARRAY{SZ} even when there was
no .fini_array section. The entries should be creating in the dynamic section
only if there are sections .init_array/.fini_array in the output.

Fixes the tests that checked for errroneous outputs.

llvm-svn: 221588

9 years ago[ELF] Fix values of linker created dynamic variables.
Shankar Easwaran [Mon, 10 Nov 2014 14:55:07 +0000 (14:55 +0000)]
[ELF] Fix values of linker created dynamic variables.

The value of _DYNAMIC should be pointing at the start of the .dynamic segment.
This was pointing to the end of the dynamic segment. Similarly the value of
_GLOBAL_OFFSET_TABLE_ was not proper too.

llvm-svn: 221587

9 years ago[ELF] .dynamic should have SHT_DYNAMIC flag
Shankar Easwaran [Mon, 10 Nov 2014 14:54:53 +0000 (14:54 +0000)]
[ELF] .dynamic should have SHT_DYNAMIC flag

llvm-svn: 221586

9 years ago[Gnu] Add options that are ignored
Shankar Easwaran [Mon, 10 Nov 2014 14:54:49 +0000 (14:54 +0000)]
[Gnu] Add options that are ignored

Add options that are ignored and exists just for compatibility reasons.

llvm-svn: 221585

9 years ago[ELF] Support -z max-page-size option
Shankar Easwaran [Mon, 10 Nov 2014 14:54:43 +0000 (14:54 +0000)]
[ELF] Support -z max-page-size option

The GNU linker allows the user to change the page size by using the option -z
max-page-size.

llvm-svn: 221584

9 years agoAdd support library.
Shankar Easwaran [Mon, 10 Nov 2014 14:54:34 +0000 (14:54 +0000)]
Add support library.

The parsing routines in the linker script to parse strings encoded in various
formats(hexadecimal, octal, decimal, etc), is needed by the GNU driver too. This
library provides helper functions for all flavors and flavors to add helper
functions which other flavors may make use of.

llvm-svn: 221583

9 years agoMissing testcase from r221581.
Aaron Ballman [Sat, 8 Nov 2014 17:09:50 +0000 (17:09 +0000)]
Missing testcase from r221581.

llvm-svn: 221582

9 years agoUpdated the wording for a diagnostic to be more grammatically correct, and use a...
Aaron Ballman [Sat, 8 Nov 2014 17:07:15 +0000 (17:07 +0000)]
Updated the wording for a diagnostic to be more grammatically correct, and use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580.

llvm-svn: 221581

9 years ago[c++1z] Support for attributes on namespaces and enumerators.
Aaron Ballman [Sat, 8 Nov 2014 15:33:35 +0000 (15:33 +0000)]
[c++1z] Support for attributes on namespaces and enumerators.

llvm-svn: 221580

9 years ago[CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for llvm-c.
NAKAMURA Takumi [Sat, 8 Nov 2014 14:12:30 +0000 (14:12 +0000)]
[CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for llvm-c.

FYI, 3 modules below are redundant in trunk;

  AsmPrinter
  MC
  SelectionDAG

llvm-svn: 221579

9 years ago[ASan] Fix stack-overflow test for PowerPC
Jay Foad [Sat, 8 Nov 2014 09:51:45 +0000 (09:51 +0000)]
[ASan] Fix stack-overflow test for PowerPC

Summary:
Tweak the asan stack overflow heuristics to cope with PowerPC64 redzones,
which are larger than on x86-64: 288 bytes for big-endian and 512 bytes
for little-endian.

Reviewers: kcc, willschm, samsonov, eugenis

Reviewed By: samsonov, eugenis

Subscribers: llvm-commits

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

llvm-svn: 221578

9 years agoAdd a RegisterNumber class to RegisterContextLLDB.h and start using
Jason Molenda [Sat, 8 Nov 2014 08:09:22 +0000 (08:09 +0000)]
Add a RegisterNumber class to RegisterContextLLDB.h and start using
it in RegisterContext.cpp.

There's a lot of bookkeeping code in RegisterContextLLDB where it has
to convert between different register numbering schemes and it makes
some methods like SavedLocationForRegister very hard to read or
maintain.  Abstract all of the details about different register numbering
systems for a given register into this new class to make it easier
to understand what the method is doing.

Also add register name printing to all of the logging -- that's easy to
get now that I've got an object to represent the register numbers.

There were some gnarly corner cases of this method that I believe
I've translated correctly - initial testing looks good but it's
possible I missed a corner case, especially with architectures which
uses a link-register aka return address register like arm32/arm64.
Basic behavior is correct but there are a lot of corner casese that are
handled in this method ...

llvm-svn: 221577

9 years ago[c++1z] Support for u8 character literals.
Richard Smith [Sat, 8 Nov 2014 06:08:42 +0000 (06:08 +0000)]
[c++1z] Support for u8 character literals.

llvm-svn: 221576

9 years agoFix a corner case with the handling of noreturn functions.
Jason Molenda [Sat, 8 Nov 2014 05:38:17 +0000 (05:38 +0000)]
Fix a corner case with the handling of noreturn functions.
If a noreturn function was the last function in a section,
we wouldn't correctly back up the saved-pc value into the
correct section leading to us showing the wrong function in
the backtrace.

Also add a backtrace test with an attempt to elicit this
particular layout.  It happens to work out with clang -Os
but other compilers may not quite get the same layout I'm
getting at that opt setting.  We'll still be exercising the
basic noreturn handling in the unwinder even if we don't get
one function at the very end of a section.

<rdar://problem/16051613>

llvm-svn: 221575

9 years ago[c++1z] Implement nested-namespace-definitions.
Richard Smith [Sat, 8 Nov 2014 05:37:34 +0000 (05:37 +0000)]
[c++1z] Implement nested-namespace-definitions.

This allows 'namespace A::B { ... }' as a shorthand for 'namespace A {
namespace B { ... } }'. We already supported this correctly for error recovery;
promote that support to a full implementation.

This is not the right implementation: we do not maintain source fidelity
because we desugar the nested namespace definition in the parser. This is
tricky to avoid, since the definition genuinely does inject one named
entity per level in the namespace name.

llvm-svn: 221574

9 years ago[c++1z] N4295: fold-expressions.
Richard Smith [Sat, 8 Nov 2014 05:07:16 +0000 (05:07 +0000)]
[c++1z] N4295: fold-expressions.

This is a new form of expression of the form:

  (expr op ... op expr)

where one of the exprs is a parameter pack. It expands into

  (expr1 op (expr2onwards op ... op expr))

(and likewise if the pack is on the right). The non-pack operand can be
omitted; in that case, an empty pack gives a fallback value or an error,
depending on the operator.

llvm-svn: 221573

9 years ago[ELF] Remove unused variable
Shankar Easwaran [Sat, 8 Nov 2014 04:03:24 +0000 (04:03 +0000)]
[ELF] Remove unused variable

llvm-svn: 221572

9 years ago[ELF] Support --no-align-segments.
Shankar Easwaran [Sat, 8 Nov 2014 03:44:49 +0000 (03:44 +0000)]
[ELF] Support --no-align-segments.

lld generates an ELF by adhering to the ELF spec by aligning vma/fileoffset to a
page boundary, but this becomes an issue when dealing with large pages. This
adds support so that lld generated executables adheres to the ELF spec with the
rule vma % p_align = offset % p_align.

This is supported by the flag --no-align-segments.

This could be the default in few targets like X86_64 to save space on disk.

llvm-svn: 221571

9 years agoLLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166
Shawn Best [Sat, 8 Nov 2014 01:41:49 +0000 (01:41 +0000)]
LLGS Android target support - for Andy Chien : reviews.llvm.org/D6166

llvm-svn: 221570

9 years agoCheck module signature when the module has already been loaded
Ben Langmuir [Sat, 8 Nov 2014 00:34:30 +0000 (00:34 +0000)]
Check module signature when the module has already been loaded

We may need to verify the signature on subsequent imports as well, just
like we verify the size/modtime:
@import A;
@import B; // imports A
@import C; // imports A

llvm-svn: 221569

9 years agoFixed a buildbot failure.
Fariborz Jahanian [Sat, 8 Nov 2014 00:23:55 +0000 (00:23 +0000)]
Fixed a buildbot failure.

llvm-svn: 221568

9 years agoFix unintended fallthrough in ASTReader
Ben Langmuir [Sat, 8 Nov 2014 00:06:39 +0000 (00:06 +0000)]
Fix unintended fallthrough in ASTReader

llvm-svn: 221567

9 years agofix for unit tests finding path to LLDB.h http://reviews.llvm.org/D6177
Shawn Best [Sat, 8 Nov 2014 00:04:04 +0000 (00:04 +0000)]
fix for unit tests finding path to LLDB.h  reviews.llvm.org/D6177

llvm-svn: 221566

9 years agoR600/SI: Fix broken check prefixes in test
Matt Arsenault [Sat, 8 Nov 2014 00:02:57 +0000 (00:02 +0000)]
R600/SI: Fix broken check prefixes in test

llvm-svn: 221565

9 years agoTransforms: address some late comments
Saleem Abdulrasool [Sat, 8 Nov 2014 00:00:50 +0000 (00:00 +0000)]
Transforms: address some late comments

We already use the llvm namespace.  Remove the unnecessary prefix.  Use the
StringRef::equals method to compare with C strings rather than instantiating
std::strings.

Addresses late review comments from David Majnemer.

llvm-svn: 221564

9 years agoTransforms: sort source files in build
Saleem Abdulrasool [Sat, 8 Nov 2014 00:00:47 +0000 (00:00 +0000)]
Transforms: sort source files in build

Sort target sources.  NFC.

llvm-svn: 221563

9 years ago[Objective-C Sema]. Issue availability/deprecated warning when
Fariborz Jahanian [Fri, 7 Nov 2014 23:51:15 +0000 (23:51 +0000)]
[Objective-C Sema]. Issue availability/deprecated warning when
there is a uinque method found when message is sent to receiver
of 'id' type. // rdar://18848183

llvm-svn: 221562

9 years agoRemove the top-level DebugDriverThread in ProcessWindows.
Zachary Turner [Fri, 7 Nov 2014 23:44:13 +0000 (23:44 +0000)]
Remove the top-level DebugDriverThread in ProcessWindows.

Originally the idea was that we would queue requests to a master
thread that would dispatch them to other slave threads each
responsible for debugging an individual process.  This might make
some scenarios more scalable and responsive, but for now it seems
to be unwarranted complexity for no observable benefit.

llvm-svn: 221561

9 years agoSelectionDAG: Assert if we truncate SDNode's NumOperands or NumValues
David Majnemer [Fri, 7 Nov 2014 22:39:11 +0000 (22:39 +0000)]
SelectionDAG: Assert if we truncate SDNode's NumOperands or NumValues

No functionality change intended, this just stops us early if we created
a bad SDNode.

llvm-svn: 221560

9 years agoARM ABI: simplify decisions on whether args can be expanded.
Tim Northover [Fri, 7 Nov 2014 22:30:50 +0000 (22:30 +0000)]
ARM ABI: simplify decisions on whether args can be expanded.

Homogeneous aggregates on AAPCS_VFP ARM need to be passed *without* being
flattened (e.g. [2 x float] rather than "float, float") for various weird ABI
reasons. However, this isn't the case for anything else; further, we know at
the ABIArgInfo::getDirect callsites whether this flattening is allowed.

So, we can get more unified ARM code, with a simpler Clang, by just using that
knowledge directly.

llvm-svn: 221559

9 years agoIntroduce a SanitizerKind enum to LangOptions.
Alexey Samsonov [Fri, 7 Nov 2014 22:29:38 +0000 (22:29 +0000)]
Introduce a SanitizerKind enum to LangOptions.

Use the bitmask to store the set of enabled sanitizers instead of a
bitfield. On the negative side, it makes syntax for querying the
set of enabled sanitizers a bit more clunky. On the positive side, we
will be able to use SanitizerKind to eventually implement the
new semantics for -fsanitize-recover= flag, that would allow us
to make some sanitizers recoverable, and some non-recoverable.

No functionality change.

llvm-svn: 221558

9 years agoUse @rpath for ASan dylib in Makefiles
Kuba Brecka [Fri, 7 Nov 2014 22:27:43 +0000 (22:27 +0000)]
Use @rpath for ASan dylib in Makefiles

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

llvm-svn: 221557

9 years agoUse @rpath for ASan dylib in Makefiles
Kuba Brecka [Fri, 7 Nov 2014 22:27:12 +0000 (22:27 +0000)]
Use @rpath for ASan dylib in Makefiles

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

llvm-svn: 221556

9 years ago[Reassociate] Better preserve NSW/NUW flags.
Chad Rosier [Fri, 7 Nov 2014 22:12:57 +0000 (22:12 +0000)]
[Reassociate] Better preserve NSW/NUW flags.
Part of PR12985.

Phabricator Revision: http://reviews.llvm.org/D6172

llvm-svn: 221555

9 years agoTransforms: use typedef rather than using aliases
Saleem Abdulrasool [Fri, 7 Nov 2014 22:09:52 +0000 (22:09 +0000)]
Transforms: use typedef rather than using aliases

Visual Studio 2012 apparently does not support using alias declarations.  Use
the more traditional typedef approach.  This should let the Windows buildbots
pass.  NFC.

llvm-svn: 221554

9 years ago[mach-o] remove stray debug output
Nick Kledzik [Fri, 7 Nov 2014 22:00:26 +0000 (22:00 +0000)]
[mach-o] remove stray debug output

llvm-svn: 221553

9 years ago[mach-o] Fix MachOFileNode to own archives same as ELFFileNode
Nick Kledzik [Fri, 7 Nov 2014 22:00:23 +0000 (22:00 +0000)]
[mach-o] Fix MachOFileNode to own archives same as ELFFileNode

My previous fix to have FileArchive own the member MemoryBuffers was not a
complete solution for darwin because nothing owned the FileArchive object.
Fixed MachOFileNode to be like ELFFileNode and have the graph node own the
archive object.

llvm-svn: 221552

9 years agoPPC fix works for ARM, too
Renato Golin [Fri, 7 Nov 2014 21:55:11 +0000 (21:55 +0000)]
PPC fix works for ARM, too

llvm-svn: 221551

9 years agoSafely generate new loop metadata node
David Peixotto [Fri, 7 Nov 2014 21:44:18 +0000 (21:44 +0000)]
Safely generate new loop metadata node

Polly was accidently modifying a debug info metadata node when
attempting to generate a new unique metadata node for the loop id.
The problem was that we had dwarf metadata that referred to a
metadata node with a null value, like this:

  !6 = ... some dwarf metadata referring to !7 ...
  !7 = {null}

When we attempt to generate a new metadata node, we reserve the
first space for self-referential node by setting the first argument
to null and then mutating the node later to refer to itself.
However, because the nodes are uniqued based on pointer values, when
we get the new metadata node it actually referred to an existing
node (!7 in the example).  When we went to modify the metadata to
point to itself, we were accidently mutating the dwarf metatdata. We
ended up in this situation:

  !6 = ... some dwarf metadata referring to !7 ...
  !7 = {!7}

and this causes an assert when generating the debug info. The fix is
simple, we just need to use a unique value when getting a new
metadata node. The MDNode::getTemporary() provides exactly the API
we need (and it is used in clang to generate the unique nodes).

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

llvm-svn: 221550

9 years agoRemove unused variable.
Rafael Espindola [Fri, 7 Nov 2014 21:33:09 +0000 (21:33 +0000)]
Remove unused variable.

llvm-svn: 221549

9 years agoTransform: add SymbolRewriter pass
Saleem Abdulrasool [Fri, 7 Nov 2014 21:32:08 +0000 (21:32 +0000)]
Transform: add SymbolRewriter pass

This introduces the symbol rewriter. This is an IR->IR transformation that is
implemented as a CodeGenPrepare pass. This allows for the transparent
adjustment of the symbols during compilation.

It provides a clean, simple, elegant solution for symbol inter-positioning. This
technique is often used, such as in the various sanitizers and performance
analysis.

The control of this is via a custom YAML syntax map file that indicates source
to destination mapping, so as to avoid having the compiler to know the exact
details of the source to destination transformations.

llvm-svn: 221548

9 years agoFix style.
Michael J. Spencer [Fri, 7 Nov 2014 21:30:36 +0000 (21:30 +0000)]
Fix style.

llvm-svn: 221547

9 years agoFix style.
Michael J. Spencer [Fri, 7 Nov 2014 21:30:32 +0000 (21:30 +0000)]
Fix style.

llvm-svn: 221546

9 years ago[mach-o] Add support for -order_file option
Nick Kledzik [Fri, 7 Nov 2014 21:01:21 +0000 (21:01 +0000)]
[mach-o] Add support for -order_file option

The darwin linker lets you rearrange functions and data for better locality
(less paging).  You do this with the -order_file option which supplies a text
file containing one symbol per line.

Implementing this required a small change to LayoutPass to add a custom sorter
hook.

llvm-svn: 221545

9 years agoFix FileArchive member MemoryBuffer early destruction
Nick Kledzik [Fri, 7 Nov 2014 20:52:38 +0000 (20:52 +0000)]
Fix FileArchive member MemoryBuffer early destruction

When FileArchive loads a member, it instantiates a temporary MemoryBuffer
which points to the member range of the archive file.  The problem is that the
object file parsers call getBufferIndentifer() on that temporary MemoryBuffer
and store that StringRef as the _path data member for that lld::File.  When
FileArchive::instantiateMember() goes out of scope the MemoryBuffer is deleted
and the File::._path becomes a dangling reference.

The fix adds a vector<> to FileArchive to own the instantiated MemoryBuffers.
In addition it fixes member's path to be the standard format
(e.g. "/path/libfoo.a(foo.o)") instead of just the leaf name.

llvm-svn: 221544

9 years agoR600: Remove unused define
Matt Arsenault [Fri, 7 Nov 2014 20:45:00 +0000 (20:45 +0000)]
R600: Remove unused define

llvm-svn: 221543

9 years ago[ASan] Fix zero_page_pc test for PowerPC
Jay Foad [Fri, 7 Nov 2014 20:42:11 +0000 (20:42 +0000)]
[ASan] Fix zero_page_pc test for PowerPC

Summary:
In the Power architecture, all branch instructions ignore the 2 least
significant bits of the target address. Consequently if you branch to an
invalid address, the address reported along with the SIGSEGV will have
been rounded down to a multiple of 4. Tweak this test accordingly.

This may fix the test for ARM too, in which case we could remove
the XFAIL, but I have no way of testing that.

Reviewers: kcc, willschm, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 221542

9 years agoThis was meant to be count, not m_count
Enrico Granata [Fri, 7 Nov 2014 20:37:17 +0000 (20:37 +0000)]
This was meant to be count, not m_count

llvm-svn: 221541

9 years agoSBValue::Cast is deprecated. This does not work as reliably as free-form casting...
Enrico Granata [Fri, 7 Nov 2014 20:22:18 +0000 (20:22 +0000)]
SBValue::Cast is deprecated. This does not work as reliably as free-form casting via the expression evaluator. Some of our clients depend on it, so we can't remove it. But any new adopters should favor the expression parser as the way forward

llvm-svn: 221540

9 years ago[Mips] Do not hard-code the paired relocation type
Simon Atanasyan [Fri, 7 Nov 2014 19:32:08 +0000 (19:32 +0000)]
[Mips] Do not hard-code the paired relocation type

Request `getPairRelocation()` function to get paired relocation type.
That allows us to look up another pairs like R_MICROMIPS_HI16/LO16
in the future.

llvm-svn: 221539

9 years agoDon't redeclare a pure virtual method.
Rafael Espindola [Fri, 7 Nov 2014 18:07:04 +0000 (18:07 +0000)]
Don't redeclare a pure virtual method.

I.E., there is no value is having

void foo() override = 0;

If it is override it is already present in a base class. Since it is pure,
some other class will have to implement it.

llvm-svn: 221537

9 years agoUse StringRefMemoryObject in llvm-mc. NFC.
Rafael Espindola [Fri, 7 Nov 2014 17:59:05 +0000 (17:59 +0000)]
Use StringRefMemoryObject in llvm-mc. NFC.

llvm-svn: 221536

9 years agoFix clash of gcc toolchains in hexagon driver regression tests.
Samuel Antao [Fri, 7 Nov 2014 17:48:03 +0000 (17:48 +0000)]
Fix clash of gcc toolchains in hexagon driver regression tests.

If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands.

llvm-svn: 221535

9 years ago[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...
Daniel Sanders [Fri, 7 Nov 2014 16:54:21 +0000 (16:54 +0000)]
[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...

Summary:
... and after all that refactoring, it's possible to distinguish softfloat
floating point values from integers so this patch no longer breaks softfloat to
do it.

Remove direct handling of i32's in the N32/N64 ABI by promoting them to
i64. This more closely reflects the ABI documentation and also fixes
problems with stack arguments on big-endian targets.

We now rely on signext/zeroext annotations (already generated by clang) and
the Assert[SZ]ext nodes to avoid the introduction of unnecessary sign/zero
extends.

It was not possible to convert three tests to use signext/zeroext. These tests
are bswap.ll, ctlz-v.ll, ctlz-v.ll. It's not possible to put signext on a
vector type so we just accept the sign extends here for now. These tests don't
pass the vectors the same way clang does (clang puts multiple elements in the
same argument, these map 1 element to 1 argument) so we don't need to worry too
much about it.

With this patch, all known N32/N64 bugs should be fixed and we now pass the
first 10,000 tests generated by ABITest.py.

Subscribers: llvm-commits

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

llvm-svn: 221534

9 years agoRevert r221404 which caused lldb to not display
Fariborz Jahanian [Fri, 7 Nov 2014 16:47:05 +0000 (16:47 +0000)]
Revert r221404 which caused lldb to not display
vararg expressions.

llvm-svn: 221533

9 years agoMake sure only NEON enabled devices save/restore D16+ registers
Renato Golin [Fri, 7 Nov 2014 16:33:58 +0000 (16:33 +0000)]
Make sure only NEON enabled devices save/restore D16+ registers

llvm-svn: 221532

9 years ago[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as...
NAKAMURA Takumi [Fri, 7 Nov 2014 16:08:19 +0000 (16:08 +0000)]
[CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as SHARED. Users of LLVMSupport won't inherit ${system_libs}.

unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly.

llvm-svn: 221531

9 years agoPass PRIVATE to target_link_libraries if using shared libraries.
Rafael Espindola [Fri, 7 Nov 2014 15:33:56 +0000 (15:33 +0000)]
Pass PRIVATE to target_link_libraries if using shared libraries.

A shared library (unlike a .a), has its dependencies recorded in the library and
we can pass PRIVATE to target_link_libraries.

This patch then removes some bogus dependencies when using
BUILD_SHARED_LIBS=ON. For example, we go from

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMBitReader.so
lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
lib/libLLVMTarget.so lib/libLLVMProfileData.so

to

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMTransformUtils.so
lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
lib/libLLVMTarget.so

In fact, build.ninja goes from 5231028 bytes to 4896759 bytes.

With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus
warning when building with BUILD_SHARED_LIBS.

llvm-svn: 221530

9 years ago[mips] Removed the remainder of MipsCC. NFC.
Daniel Sanders [Fri, 7 Nov 2014 15:33:08 +0000 (15:33 +0000)]
[mips] Removed the remainder of MipsCC. NFC.

Summary:
One of the calls to AllocateStack (the one in LowerCall) doesn't look like
it should be there but it was there before and removing it breaks the
frame size calculation.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

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

llvm-svn: 221529

9 years ago[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgS...
Daniel Sanders [Fri, 7 Nov 2014 15:03:53 +0000 (15:03 +0000)]
[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgSizeInBytes(). NFC.

Summary:

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221528

9 years agoMipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:56:31 +0000 (14:56 +0000)]
MipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.

llvm-svn: 221527

9 years agollvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.
NAKAMURA Takumi [Fri, 7 Nov 2014 14:50:10 +0000 (14:50 +0000)]
llvm/test/tools/llvm-symbolizer/ppc64.test: Avoid subshell.

llvm-svn: 221526

9 years ago[mips] Move MipsCCState to a separate file and clang-formatted it.
Daniel Sanders [Fri, 7 Nov 2014 14:24:31 +0000 (14:24 +0000)]
[mips] Move MipsCCState to a separate file and clang-formatted it.

Summary: Depends on D6113

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221525

9 years agoImprove comments in vtordisp tests: fix a typo, add a bit more clarity
Timur Iskhodzhanov [Fri, 7 Nov 2014 14:11:14 +0000 (14:11 +0000)]
Improve comments in vtordisp tests: fix a typo, add a bit more clarity

llvm-svn: 221524

9 years ago[ELF] Remove is64bits() and isLittlEndian().
Shankar Easwaran [Fri, 7 Nov 2014 14:08:43 +0000 (14:08 +0000)]
[ELF] Remove is64bits() and isLittlEndian().

ELFLinkingContext had these two functions, which is really not needed since
the Writer uses a llvm::object template composed of Endianness, Alignment,
Is32bit/64bit. We could just use that and not duplicate functionality.

No Change In Functionality.

llvm-svn: 221523

9 years ago[mips] Fix unused variable warnings introduced in r221521
Daniel Sanders [Fri, 7 Nov 2014 12:43:01 +0000 (12:43 +0000)]
[mips] Fix unused variable warnings introduced in r221521

llvm-svn: 221522

9 years ago[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByVa...
Daniel Sanders [Fri, 7 Nov 2014 12:21:37 +0000 (12:21 +0000)]
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs()

Summary: Depends on D6112

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221521

9 years ago[sanitizer] Never remove the last frame off the stack trace.
Evgeniy Stepanov [Fri, 7 Nov 2014 12:03:07 +0000 (12:03 +0000)]
[sanitizer] Never remove the last frame off the stack trace.

It can only make it worse.

llvm-svn: 221520

9 years ago[mips] Remove MipsCC::getRegVT(). NFC
Daniel Sanders [Fri, 7 Nov 2014 12:02:59 +0000 (12:02 +0000)]
[mips] Remove MipsCC::getRegVT(). NFC

Summary: It's no longer used.

Reviewers: vmedic, theraven

Reviewed By: theraven

Subscribers: llvm-commits

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

llvm-svn: 221519

9 years ago[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands...
Daniel Sanders [Fri, 7 Nov 2014 11:43:49 +0000 (11:43 +0000)]
[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands. NFC

Summary:
In addition to the usual f128 workaround, it was also necessary to provide
a means of accessing ArgListEntry::IsFixed.

Reviewers: theraven, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221518

9 years ago[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code...
Daniel Sanders [Fri, 7 Nov 2014 11:10:48 +0000 (11:10 +0000)]
[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code. NFC

Summary:
In the long run, it should probably become a calling convention in its own
right but for now just move it out of
MipsISelLowering::analyzeCallOperands() so that we can drop this function
in favour of CCState::AnalyzeCallOperands().

Subscribers: llvm-commits

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

llvm-svn: 221517

9 years ago[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.
Daniel Sanders [Fri, 7 Nov 2014 10:45:16 +0000 (10:45 +0000)]
[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.

Summary:
CCState objects already carry this information in their isVarArg() method.

Subscribers: llvm-commits

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

llvm-svn: 221516

9 years agoMove ARM failure from FIXME to XFAIL
Renato Golin [Fri, 7 Nov 2014 10:30:53 +0000 (10:30 +0000)]
Move ARM failure from FIXME to XFAIL

llvm-svn: 221515

9 years agollvm-symbolizer: teach it about PowerPC64 ELF function descriptors
Jay Foad [Fri, 7 Nov 2014 09:08:39 +0000 (09:08 +0000)]
llvm-symbolizer: teach it about PowerPC64 ELF function descriptors

Summary:
Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function.

This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux.

Reviewers: kcc, willschm, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 221514

9 years agoSCCP: overdefined calls cannot become constant
David Majnemer [Fri, 7 Nov 2014 08:54:19 +0000 (08:54 +0000)]
SCCP: overdefined calls cannot become constant

We would attempt to fold away a call instruction which had been marked
overdefined.  However, it's not valid to transition to constant from
overdefined.

This fixes PR21512.

llvm-svn: 221513

9 years ago[Refactor][NFC] Generalize the creation of ScopArrayInfo objects.
Johannes Doerfert [Fri, 7 Nov 2014 08:31:31 +0000 (08:31 +0000)]
[Refactor][NFC] Generalize the creation of ScopArrayInfo objects.

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

llvm-svn: 221512

9 years agoCodeGen, Itanium: Properly dllimport RTTI data
David Majnemer [Fri, 7 Nov 2014 07:26:38 +0000 (07:26 +0000)]
CodeGen, Itanium: Properly dllimport RTTI data

We would blindly assume that RTTI data should have the same linkage as
the vtable because we didn't think the RTTI data was external.  This
oversight stemmed because we didn't take dllimport into account.

This fixes PR21512.

llvm-svn: 221511

9 years agoAdd Position-independent Code model Module API.
Justin Hibbits [Fri, 7 Nov 2014 04:46:10 +0000 (04:46 +0000)]
Add Position-independent Code model Module API.

Summary:
This makes PIC levels a Module flag attribute, which can be queried by the
backend.  The flag is named `PIC Level`, and can have a value of:

  0 - Backend-default
  1 - Small-model (-fpic)
  2 - Large-model (-fPIC)

These match the `-pic-level' command line argument for clang, and the value of the
preprocessor macro `__PIC__'.

Test Plan:
New flags tests specific for the 'PIC Level' module flag.
Tests to be added as part of a future commit for PowerPC, which will use this new API.

Reviewers: rafael, echristo

Reviewed By: rafael, echristo

Subscribers: rafael, llvm-commits

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

llvm-svn: 221510

9 years agoUse llvm::StringRefMemoryObject NFC.
Rafael Espindola [Fri, 7 Nov 2014 04:24:12 +0000 (04:24 +0000)]
Use llvm::StringRefMemoryObject NFC.

llvm-svn: 221509

9 years agoFix Mach-O unit tests breakage on Windows
Rui Ueyama [Fri, 7 Nov 2014 02:54:52 +0000 (02:54 +0000)]
Fix Mach-O unit tests breakage on Windows

Mach-O normalized file reader assumes that the entire file is aligned
to a large boundary. If the in-memory file is not aligned properly, it will
abort with an assertion failure in read32/read64. This patch forces the
in-memory file for the unit test to be aligned at 64-byte boundary.

I found these tests are failing on Windows, but theoretically they could
fail on other platform.

llvm-svn: 221508

9 years ago[AArch64] Keep flags on condition vreg when instantiating a CB branch.
Ahmed Bougacha [Fri, 7 Nov 2014 02:50:00 +0000 (02:50 +0000)]
[AArch64] Keep flags on condition vreg when instantiating a CB branch.

Reversing a CB* instruction used to drop the flags on the condition. On the
included testcase, this lead to a read from an undefined vreg.
Using addOperand keeps the flags, here <undef>.

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

llvm-svn: 221507

9 years agoDisable a Mach-O test on Windows that depends on Unix path separator.
Rui Ueyama [Fri, 7 Nov 2014 01:51:00 +0000 (01:51 +0000)]
Disable a Mach-O test on Windows that depends on Unix path separator.

llvm-svn: 221506

9 years agoAdd missing -target triple to ELF tests.
Rui Ueyama [Fri, 7 Nov 2014 01:45:32 +0000 (01:45 +0000)]
Add missing -target triple to ELF tests.

llvm-svn: 221505