platform/upstream/llvm.git
9 years agoclang-cl: Make /Gd ignored instead of unsupported
Hans Wennborg [Sat, 13 Dec 2014 22:13:23 +0000 (22:13 +0000)]
clang-cl: Make /Gd ignored instead of unsupported

/Gd is the default calling convention setting, so we don't
need to take any action.

llvm-svn: 224200

9 years agoclang-cl: Add unsupported /Gv option (PR21892)
Hans Wennborg [Sat, 13 Dec 2014 22:06:23 +0000 (22:06 +0000)]
clang-cl: Add unsupported /Gv option (PR21892)

We don't currently support any of the calling convention options.

llvm-svn: 224199

9 years agoRevert "[ARM] Combine base-updating/post-incrementing vector load/stores."
Renato Golin [Sat, 13 Dec 2014 20:23:18 +0000 (20:23 +0000)]
Revert "[ARM] Combine base-updating/post-incrementing vector load/stores."

This reverts commit r223862, as it created a regression on the test-suite
on test MultiSource/Benchmarks/Ptrdist/anagram by scrambling the order
in which the words are shown. We'll investigate the issue and re-apply
when safe.

llvm-svn: 224198

9 years agoFix Doxygen command misspellings.
Benjamin Kramer [Sat, 13 Dec 2014 19:19:07 +0000 (19:19 +0000)]
Fix Doxygen command misspellings.

Found by -Wdocumentation.

llvm-svn: 224197

9 years agoSilencing a -Wsign-compare warning; NFC.
Aaron Ballman [Sat, 13 Dec 2014 16:55:02 +0000 (16:55 +0000)]
Silencing a -Wsign-compare warning; NFC.

llvm-svn: 224195

9 years agoSilencing a *lot* of -Wsign-compare warnings; NFC.
Aaron Ballman [Sat, 13 Dec 2014 16:53:15 +0000 (16:53 +0000)]
Silencing a *lot* of -Wsign-compare warnings; NFC.

llvm-svn: 224194

9 years agoParse: MS property members cannot have an in-class initializer
David Majnemer [Sat, 13 Dec 2014 11:34:16 +0000 (11:34 +0000)]
Parse: MS property members cannot have an in-class initializer

We would crash trying to treat a property member as a field.  These
shoudl be forbidden anyway, reject programs which contain them.

This fixes PR21840.

llvm-svn: 224193

9 years ago[ELF] Clean up OPT_INPUT handler. NFC.
Rui Ueyama [Sat, 13 Dec 2014 09:36:44 +0000 (09:36 +0000)]
[ELF] Clean up OPT_INPUT handler. NFC.

llvm-svn: 224192

9 years agoMake YAML files own MemoryBuffer.
Rui Ueyama [Sat, 13 Dec 2014 08:59:50 +0000 (08:59 +0000)]
Make YAML files own MemoryBuffer.

YAML files have references such as StringRef to the underlying
MemoryBuffer, so we shouldn't deallocate the buffer.

llvm-svn: 224191

9 years agoMove definitions to the correct file.
Rui Ueyama [Sat, 13 Dec 2014 08:59:46 +0000 (08:59 +0000)]
Move definitions to the correct file.

llvm-svn: 224190

9 years agoSema: Constexpr functions must have return statements which have an expr
David Majnemer [Sat, 13 Dec 2014 08:12:56 +0000 (08:12 +0000)]
Sema: Constexpr functions must have return statements which have an expr

clang lets programmers be pretty cavalier when it comes to void return
statements in functions which have non-void return types.  However, we
cannot be so forgiving in constexpr functions: evaluation will go off
the rails very quickly.

Instead, keep the return statement in the AST but mark the function as
invalid.  Doing so gives us nice diagnostics while making constexpr
evaluation halt.

This fixes PR21859.

llvm-svn: 224189

9 years agoMake the platform process connect path less chatty.
Stephane Sezer [Sat, 13 Dec 2014 05:23:51 +0000 (05:23 +0000)]
Make the platform process connect path less chatty.

Summary:
If a stream contains an empty string, no need to append it to the output
(otherwise we end up with a blank line). Also, no need to print a status
message when the state changes to connected, as this string brings no
information -- "Process 0" does not mean anything to the user, and the
process being connected has no meaning either.

Test Plan:
Connect to a remote linux platform mode daemon with `platform select
remote-linux` followed by `platform connect ...`, create a target and
run it, observe the output. Also, run the full test suite (dosep.py).

Before:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 0 connected

    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

After:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

Reviewers: tfiala, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 224188

9 years agoUse range-based for loops.
Craig Topper [Sat, 13 Dec 2014 05:12:19 +0000 (05:12 +0000)]
Use range-based for loops.

llvm-svn: 224187

9 years agoRename argument strings of codegen passes to avoid collisions with command line
Akira Hatanaka [Sat, 13 Dec 2014 04:52:04 +0000 (04:52 +0000)]
Rename argument strings of codegen passes to avoid collisions with command line
options.

This commit changes the command line arguments (PassInfo::PassArgument) of two
passes, MachineFunctionPrinter and MachineScheduler, to avoid collisions with
command line options that have the same argument strings.

This bug manifests when the PassList construct (defined in opt.cpp) is used
in a tool that links with codegen passes. To reproduce the bug, paste the
following lines into llc.cpp and run llc.

#include "llvm/IR/LegacyPassNameParser.h"
static llvm::cl::list<const llvm::PassInfo*, bool, llvm::PassNameParser>
PassList(llvm::cl::desc("Optimizations available:"));

rdar://problem/19212448

llvm-svn: 224186

9 years agoNFC: Minor formatting fix
Will Wilson [Sat, 13 Dec 2014 04:38:19 +0000 (04:38 +0000)]
NFC: Minor formatting fix

llvm-svn: 224185

9 years agoPretty print support for template arg enum constants
Will Wilson [Sat, 13 Dec 2014 04:31:07 +0000 (04:31 +0000)]
Pretty print support for template arg enum constants

llvm-svn: 224184

9 years agoFix two small bugs in typo correction. One assertion failure building member expressi...
Nick Lewycky [Sat, 13 Dec 2014 02:54:28 +0000 (02:54 +0000)]
Fix two small bugs in typo correction. One assertion failure building member expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.

The testcase shows a third bug with a FIXME in it.

llvm-svn: 224183

9 years agoUse the newer python syntax for exceptions
Justin Bogner [Sat, 13 Dec 2014 02:49:27 +0000 (02:49 +0000)]
Use the newer python syntax for exceptions

We've dropped support for python 2.5, so now we can use the forward
compatible "except ... as" syntax.

llvm-svn: 224182

9 years agoUse the newer python syntax for exceptions
Justin Bogner [Sat, 13 Dec 2014 02:46:56 +0000 (02:46 +0000)]
Use the newer python syntax for exceptions

We've dropped support for python 2.5, so now we can use the forward
compatible "except ... as" syntax.

llvm-svn: 224181

9 years agoUpdate to new bindings.
Peter Collingbourne [Sat, 13 Dec 2014 02:26:00 +0000 (02:26 +0000)]
Update to new bindings.

llvm-svn: 224180

9 years agoGo bindings: introduce Value.ConstantAsMetadata.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:57 +0000 (02:25 +0000)]
Go bindings: introduce Value.ConstantAsMetadata.

llvm-svn: 224179

9 years agoGo bindings: introduce llvm.TemporaryMDNode.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:54 +0000 (02:25 +0000)]
Go bindings: introduce llvm.TemporaryMDNode.

llvm-svn: 224178

9 years agoGo bindings: introduce Metadata.ReplaceAllUsesWith.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:51 +0000 (02:25 +0000)]
Go bindings: introduce Metadata.ReplaceAllUsesWith.

llvm-svn: 224177

9 years agoGo bindings: expose the Metadata type.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:49 +0000 (02:25 +0000)]
Go bindings: expose the Metadata type.

Also modifies SetCurrentDebugLocation to take individual arguments rather
than an MDNode.

llvm-svn: 224176

9 years agoGo bindings: remove contextless metadata bindings.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:45 +0000 (02:25 +0000)]
Go bindings: remove contextless metadata bindings.

llvm-svn: 224175

9 years agoMove a bunch of method implementations over to the C++ file; remove the need for...
Enrico Granata [Sat, 13 Dec 2014 02:07:50 +0000 (02:07 +0000)]
Move a bunch of method implementations over to the C++ file; remove the need for a few includes. All in all, good stuff

llvm-svn: 224174

9 years agoImplement feedback on r224172 in PR21899
Reid Kleckner [Sat, 13 Dec 2014 01:11:23 +0000 (01:11 +0000)]
Implement feedback on r224172 in PR21899

Based on suggestions from Kaelyn.

llvm-svn: 224173

9 years agoTypo correction: Ignore temporary binding exprs after overload resolution
Reid Kleckner [Sat, 13 Dec 2014 00:53:10 +0000 (00:53 +0000)]
Typo correction: Ignore temporary binding exprs after overload resolution

Transformation of a CallExpr doesn't always result in a new CallExpr.

Fixes PR21899.

llvm-svn: 224172

9 years agoTests will timeout if they exceed time limit.
Vince Harron [Sat, 13 Dec 2014 00:08:19 +0000 (00:08 +0000)]
Tests will timeout if they exceed time limit.

Default time limit is 5 minutes.

Override the default timeout of 5 minutes with LLDB_TEST_TIMEOUT.
LLDB_TEST_TIMEOUT=10m

Override the timeout for individual tests with LLDB_[TESTNAME]_TIMEOUT.
E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m

Set to "0" to run without timeout.

Submitted for Chaoren Lin

llvm-svn: 224171

9 years agoSyntheticChildrenFrontEnd::* should also be built when python is disabled
Keno Fischer [Sat, 13 Dec 2014 00:05:58 +0000 (00:05 +0000)]
SyntheticChildrenFrontEnd::* should also be built when python is disabled

Summary:
This moves
- SyntheticChildrenFrontEnd::CreateValueObjectFromExpression
- SyntheticChildrenFrontEnd::CreateValueObjectFromAddress
- SyntheticChildrenFrontEnd::CreateValueObjectFromData
outside the `#ifndef LLDB_DISABLE_PYTHON` since it doesn't seem to depend on python being available and indeed breaks the build when python is disabled.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 224170

9 years ago[PowerPC] Add a DAGToDAG peephole to remove unnecessary zero-exts
Hal Finkel [Fri, 12 Dec 2014 23:59:36 +0000 (23:59 +0000)]
[PowerPC] Add a DAGToDAG peephole to remove unnecessary zero-exts

On PPC64, we end up with lots of i32 -> i64 zero extensions, not only from all
of the usual places, but also from the ABI, which specifies that values passed
are zero extended. Almost all 32-bit PPC instructions in PPC64 mode are defined
to do *something* to the higher-order bits, and for some instructions, that
action clears those bits (thus providing a zero-extended result). This is
especially common after rotate-and-mask instructions. Adding an additional
instruction to zero-extend the results of these instructions is unnecessary.

This PPCISelDAGToDAG peephole optimization examines these zero-extensions, and
looks back through their operands to see if all instructions will implicitly
zero extend their results. If so, we convert these instructions to their 64-bit
variants (which is an internal change only, the actual encoding of these
instructions is the same as the original 32-bit ones) and remove the
unnecessary zero-extension (changing where the INSERT_SUBREG instructions are
to make everything internally consistent).

llvm-svn: 224169

9 years agoValueTracking: Don't recurse too deeply in computeKnownBitsFromAssume
David Majnemer [Fri, 12 Dec 2014 23:59:29 +0000 (23:59 +0000)]
ValueTracking: Don't recurse too deeply in computeKnownBitsFromAssume

Respect the MaxDepth recursion limit, doing otherwise will trigger an
assert in computeKnownBits.

This fixes PR21891.

llvm-svn: 224168

9 years agoImplement the __builtin_call_with_static_chain GNU extension.
Peter Collingbourne [Fri, 12 Dec 2014 23:41:25 +0000 (23:41 +0000)]
Implement the __builtin_call_with_static_chain GNU extension.

The extension has the following syntax:

  __builtin_call_with_static_chain(Call, Chain)
  where Call must be a function call expression and Chain must be of pointer type

This extension performs a function call Call with a static chain pointer
Chain passed to the callee in a designated register. This is useful for
calling foreign language functions whose ABI uses static chain pointers
(e.g. to implement closures).

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

llvm-svn: 224167

9 years ago[ARMConstantIsland] Insert tbb/tbh optimization where previous jump table resided.
Chad Rosier [Fri, 12 Dec 2014 23:27:40 +0000 (23:27 +0000)]
[ARMConstantIsland] Insert tbb/tbh optimization where previous jump table resided.

llvm-svn: 224165

9 years agoFrontend: Canonicalize to native paths when dumping module dependencies
Justin Bogner [Fri, 12 Dec 2014 23:12:27 +0000 (23:12 +0000)]
Frontend: Canonicalize to native paths when dumping module dependencies

Mixed path separators (ie, both / and \\) can mess up the sort order
of the VFS map when dumping module dependencies, as was recently
exposed by r224055 and papered over in r224145. Instead, we should
simply use native paths for consistency.

This also adds a TODO to add handling of .. in paths. There was some
code for this before r224055, but it was untested and probably broken.

llvm-svn: 224164

9 years agoAdd option to turn off installation of headers.
Eric Fiselier [Fri, 12 Dec 2014 22:52:58 +0000 (22:52 +0000)]
Add option to turn off installation of headers.

llvm-svn: 224162

9 years agoSome more cleanup of the ValueObjectConstResultImpl code. NFC.
Enrico Granata [Fri, 12 Dec 2014 22:37:44 +0000 (22:37 +0000)]
Some more cleanup of the ValueObjectConstResultImpl code. NFC.

llvm-svn: 224160

9 years agoPass EC by reference to MemoryBufferMMapFile to return error code.
Yaron Keren [Fri, 12 Dec 2014 22:27:53 +0000 (22:27 +0000)]
Pass EC by reference to MemoryBufferMMapFile to return error code.

Patch by Kim Grasman!

llvm-svn: 224159

9 years agoFix up this test case
Enrico Granata [Fri, 12 Dec 2014 22:11:32 +0000 (22:11 +0000)]
Fix up this test case

llvm-svn: 224157

9 years agoutils: update vim syntax highlighting for LLVM IR
Saleem Abdulrasool [Fri, 12 Dec 2014 21:52:44 +0000 (21:52 +0000)]
utils: update vim syntax highlighting for LLVM IR

Add missing externally_initialized keyword from SVN r174340.  Also reflow the
text.

llvm-svn: 224155

9 years agoClean up static analyzer warnings.
Michael Ilseman [Fri, 12 Dec 2014 21:48:03 +0000 (21:48 +0000)]
Clean up static analyzer warnings.

Clang's static analyzer found several potential cases of undefined
behavior, use of un-initialized values, and potentially null pointer
dereferences in tablegen, Support, MC, and ADT. This cleans them up
with specific assertions on the assumptions of the code.

llvm-svn: 224154

9 years ago[Hexagon] Adding double word add/min/minu/max/maxu instructions and tests.
Colin LeMahieu [Fri, 12 Dec 2014 21:29:25 +0000 (21:29 +0000)]
[Hexagon] Adding double word add/min/minu/max/maxu instructions and tests.

llvm-svn: 224153

9 years agoRevert r224149, llvm-dsymutil was already here.
Nico Weber [Fri, 12 Dec 2014 21:25:07 +0000 (21:25 +0000)]
Revert r224149, llvm-dsymutil was already here.

I saw a failure on an internal bot, opened this file, saw it was missing,
thought "aha!", tried to land, got an "file is out of date", synced, didn't see
the file listed right above the line I added (cause I didn't add it in the
right place) and landed. Apologies!

llvm-svn: 224152

9 years agoAdd a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObje...
Enrico Granata [Fri, 12 Dec 2014 21:23:55 +0000 (21:23 +0000)]
Add a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObjectConstResult. This test passing is the baseline of functionality we want to ensure for our const results

llvm-svn: 224151

9 years ago[Hexagon] Adding J class call instructions.
Colin LeMahieu [Fri, 12 Dec 2014 21:12:27 +0000 (21:12 +0000)]
[Hexagon] Adding J class call instructions.

llvm-svn: 224150

9 years agoAdd llvm-dsymutil to test/CMakeLists.txt
Nico Weber [Fri, 12 Dec 2014 20:56:49 +0000 (20:56 +0000)]
Add llvm-dsymutil to test/CMakeLists.txt

r224134 added this and runs it from a test, but doesn't build it with test
binaries.

llvm-svn: 224149

9 years ago[Sanitizer] Introduce Allocator::may_return_null bool flag.
Alexey Samsonov [Fri, 12 Dec 2014 20:07:35 +0000 (20:07 +0000)]
[Sanitizer] Introduce Allocator::may_return_null bool flag.

Summary:
Turn "allocator_may_return_null" common flag into an
Allocator::may_return_null bool flag. We want to make sure
that common flags are immutable after initialization. There
are cases when we want to change this flag in the allocator
at runtime: e.g. in unit tests and during ASan activation
on Android.

Test Plan: regression test suite, real-life applications

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 224148

9 years agoThe so-called "trivial implementation" has been with us for a few years now. It's...
Enrico Granata [Fri, 12 Dec 2014 19:26:08 +0000 (19:26 +0000)]
The so-called "trivial implementation" has been with us for a few years now. It's probably safe to assume it works.. so remove the #if stuff

llvm-svn: 224147

9 years agoIR: Don't track nullptr on metadata RAUW
Duncan P. N. Exon Smith [Fri, 12 Dec 2014 19:24:33 +0000 (19:24 +0000)]
IR: Don't track nullptr on metadata RAUW

The RAUW support in `Metadata` supports going to `nullptr` specifically
to handle values being deleted, causing `ValueAsMetadata` to be deleted.

Fix the case where the reference is from a `TrackingMDRef` (as opposed
to an `MDOperand` or a `MetadataAsValue`).

This is surprisingly rare -- metadata tracked by `TrackingMDRef` going
to null -- but it came up in an openSUSE bootstrap during inlining.  The
tracking ref was held by the `ValueMap` because it was referencing a
local, the basic block containing the local became dead after it had
been merged in, and when the local was deleted, the tracking ref
asserted in an `isa`.

llvm-svn: 224146

9 years agoAllow module deps to be printed in an arbitrary order
Reid Kleckner [Fri, 12 Dec 2014 19:13:04 +0000 (19:13 +0000)]
Allow module deps to be printed in an arbitrary order

The order is different between Windows and Unix for reasons unknown, but
the compiler output appears to still be determinstic.

llvm-svn: 224145

9 years agoMAP_FILE is the default. We don't need to add it.
Rafael Espindola [Fri, 12 Dec 2014 19:12:42 +0000 (19:12 +0000)]
MAP_FILE is the default. We don't need to add it.

llvm-svn: 224144

9 years agoDo attempt to ask the impl_backend for the live address of a const result if none...
Enrico Granata [Fri, 12 Dec 2014 19:05:44 +0000 (19:05 +0000)]
Do attempt to ask the impl_backend for the live address of a const result if none is stored in the object itself; this is for symmetry with GetAddressOf()

llvm-svn: 224143

9 years agoDo not set the live address of a const result child if its parent has an invalid...
Enrico Granata [Fri, 12 Dec 2014 18:59:49 +0000 (18:59 +0000)]
Do not set the live address of a const result child if its parent has an invalid live address

llvm-svn: 224142

9 years agoRelax debug-map-parsing.test error message check for Windows
Reid Kleckner [Fri, 12 Dec 2014 18:52:07 +0000 (18:52 +0000)]
Relax debug-map-parsing.test error message check for Windows

On Windows we get the string "no such file or directory".

llvm-svn: 224141

9 years agoMore code format fix from r224133, NFC
Steven Wu [Fri, 12 Dec 2014 18:48:37 +0000 (18:48 +0000)]
More code format fix from r224133, NFC

llvm-svn: 224140

9 years agoRemove silly left over from the Windows resize_file implementation.
Rafael Espindola [Fri, 12 Dec 2014 18:37:43 +0000 (18:37 +0000)]
Remove silly left over from the Windows resize_file implementation.

I didn't notice the problem first because on a non debug build the CRT was
just exiting the process without any message.

llvm-svn: 224139

9 years agoMove the resize file feature from mapped_file_region to the only user.
Rafael Espindola [Fri, 12 Dec 2014 18:13:23 +0000 (18:13 +0000)]
Move the resize file feature from mapped_file_region to the only user.

This removes a duplicated stat on every file that llvm-ar looks at.

llvm-svn: 224138

9 years agoAdd a method to disable the Windows crash / assert dialogs.
Zachary Turner [Fri, 12 Dec 2014 18:10:52 +0000 (18:10 +0000)]
Add a method to disable the Windows crash / assert dialogs.

When running the test suite on Windows, we can't have Windows popping
up dialogs when LLDB crashes in native code because it will hang
the test suite.  This patch silences those dialogs by checking an
environment variable at startup and configuring Windows based on
its value.

This patch also adds an environment variable to force inferiors to
never spawn in their own console window.  This is useful to prevent
new window spawm when running the test suite.

Reviewed by: Scott Graham

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

llvm-svn: 224137

9 years agoPass a FD to resise_file and add a testcase.
Rafael Espindola [Fri, 12 Dec 2014 17:55:12 +0000 (17:55 +0000)]
Pass a FD to resise_file and add a testcase.

I will add a real use in another commit.

llvm-svn: 224136

9 years agoRemove unused feature. NFC.
Rafael Espindola [Fri, 12 Dec 2014 17:35:34 +0000 (17:35 +0000)]
Remove unused feature. NFC.

llvm-svn: 224135

9 years agoInitial dsymutil tool commit.
Frederic Riss [Fri, 12 Dec 2014 17:31:24 +0000 (17:31 +0000)]
Initial dsymutil tool commit.

The goal of this tool is to replicate Darwin's dsymutil functionality
based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does
not link the debug information, it leaves it in the object files in
relocatable form, but embbeds a `debug map` into the executable that
describes where to find the debug information and how to relocate it.
When releasing/archiving a binary, dsymutil is called to link all the DWARF
information into a `dsym bundle` that can distributed/stored along with
the binary.

With this commit, the LLVM based dsymutil is just able to parse the STABS
debug maps embedded by ld64 in linked binaries (and not all of them, for
example archives aren't supported yet).

Note that the tool directory is called dsymutil, but the executable is
currently called llvm-dsymutil. This discrepancy will disappear once the
tool will be feature complete. At this point the executable will be renamed
to dsymutil, but until then you do not want it to override the system one.

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

llvm-svn: 224134

9 years agoRestructure code from r224097. NFC
Steven Wu [Fri, 12 Dec 2014 17:21:54 +0000 (17:21 +0000)]
Restructure code from r224097. NFC

llvm-svn: 224133

9 years ago[AVX512] Enabling bit logic lowering
Robert Khasanov [Fri, 12 Dec 2014 17:02:18 +0000 (17:02 +0000)]
[AVX512] Enabling bit logic lowering
Added lowering tests.

llvm-svn: 224132

9 years agoFix the issue of mangling of local anonymous unions (Itanium C++ ABI):
Evgeny Astigeevich [Fri, 12 Dec 2014 16:17:46 +0000 (16:17 +0000)]
Fix the issue of mangling of local anonymous unions (Itanium C++ ABI):
A discriminator is used for the first occurrence of a name.
inline int f1 () {
  static union {
    int a;
    long int b;
  };

  static union {
    int c;
    double d;
  };

  return a+c;
}
The name of the second union is mangled as _ZZ2f1vE1c_0 instead of _ZZ2f1vE1c.

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

llvm-svn: 224131

9 years agoNow that we require a newer python, use the new exception syntax.
Rafael Espindola [Fri, 12 Dec 2014 15:32:23 +0000 (15:32 +0000)]
Now that we require a newer python, use the new exception syntax.

llvm-svn: 224130

9 years agoRequire python 2.7.
Rafael Espindola [Fri, 12 Dec 2014 15:29:31 +0000 (15:29 +0000)]
Require python 2.7.

We were already requiring 2.5, which meant that people on old linux distros
had to upgrade anyway.

Requiring python 2.6 will make supporting 3.X easier as we can use the 3.X
exception syntax.

According to the discussion on llvmdev, there is not much value is requiring
just 2.6, we may as well just require 2.7.

llvm-svn: 224129

9 years ago[mips] Enable code generation for MIPS-III.
Vasileios Kalintiris [Fri, 12 Dec 2014 15:16:46 +0000 (15:16 +0000)]
[mips] Enable code generation for MIPS-III.

Summary:
This commit enables the MIPS-III target and adds support for code
generation of SELECT nodes. We have to use pseudo-instructions with
custom inserters for these nodes as MIPS-III CPUs do not have
conditional-move instructions.

Depends on D6212

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 224128

9 years ago[AVX512] Enabling MIN/MAX lowering.
Robert Khasanov [Fri, 12 Dec 2014 15:10:43 +0000 (15:10 +0000)]
[AVX512] Enabling MIN/MAX lowering.
Added lowering tests.

llvm-svn: 224127

9 years agoReapply "[MachineScheduler] Fix for PR21807: minor code difference building with...
Andrea Di Biagio [Fri, 12 Dec 2014 15:09:58 +0000 (15:09 +0000)]
Reapply "[MachineScheduler] Fix for PR21807: minor code difference building with/without -g."

This reapplies r224118 with a fix for test 'misched-code-difference-with-debug.ll'.
That test was failing on some buildbots because it was x86 specific but it was
missing a target triple.
Added an explicit triple to test misched-code-difference-with-debug.ll.

llvm-svn: 224126

9 years ago[Reassociate] Use dbgs() instead of errs().
Chad Rosier [Fri, 12 Dec 2014 14:44:12 +0000 (14:44 +0000)]
[Reassociate] Use dbgs() instead of errs().

llvm-svn: 224125

9 years ago[mips] Support SELECT nodes for targets that don't have conditional-move instructions.
Vasileios Kalintiris [Fri, 12 Dec 2014 14:41:37 +0000 (14:41 +0000)]
[mips] Support SELECT nodes for targets that don't have conditional-move instructions.

Summary:
For Mips targets that do not have conditional-move instructions, ie. targets
before MIPS32 and MIPS-IV, we have to insert a diamond control-flow
pattern in order to support SELECT nodes. In order to do that, we add
pseudo-instructions with a custom inserter that emits the necessary
control-flow that selects the correct value.

With this patch we add complete support for code generation of Mips-II targets
based on the LLVM test-suite.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 224124

9 years agoDisable --icf=safe to avoid a bug.
Rafael Espindola [Fri, 12 Dec 2014 14:28:19 +0000 (14:28 +0000)]
Disable --icf=safe to avoid a bug.

Thanks to Sameer Sahasrabuddhe for the report!

llvm-svn: 224123

9 years ago[AVX512] Minor fix in lowering pattern for broadcast intrustions.
Robert Khasanov [Fri, 12 Dec 2014 14:21:30 +0000 (14:21 +0000)]
[AVX512] Minor fix in lowering pattern for broadcast intrustions.
No functional change.

llvm-svn: 224122

9 years agoRevert: [MachineScheduler] Fix for PR21807: minor code difference building with/witho...
Andrea Di Biagio [Fri, 12 Dec 2014 13:34:03 +0000 (13:34 +0000)]
Revert: [MachineScheduler] Fix for PR21807: minor code difference building with/without -g.

Test 'misched-code-difference-with-debug.ll' was failing on some buildbots.

llvm-svn: 224121

9 years agoDon't break string literals in Java and JavaScript.
Alexander Kornienko [Fri, 12 Dec 2014 13:03:22 +0000 (13:03 +0000)]
Don't break string literals in Java and JavaScript.

The proper way to break string literals in these languages is by inserting a "+"
between parts which we don't support yet. So we disable string literal breaking
until then.

llvm-svn: 224120

9 years agoThis patch recognizes (+ (+ v0, v1) (+ v2, v3)), reorders them for bundling into...
Suyog Sarda [Fri, 12 Dec 2014 12:53:44 +0000 (12:53 +0000)]
This patch recognizes (+ (+ v0, v1) (+ v2, v3)), reorders them for bundling into vector of loads,
and vectorizes it.

 Test case :

       float hadd(float* a) {
           return (a[0] + a[1]) + (a[2] + a[3]);
        }

 AArch64 assembly before patch :

        ldp s0, s1, [x0]
  ldp s2, s3, [x0, #8]
  fadd s0, s0, s1
  fadd s1, s2, s3
  fadd s0, s0, s1
  ret

 AArch64 assembly after patch :

        ldp d0, d1, [x0]
  fadd v0.2s, v0.2s, v1.2s
  faddp s0, v0.2s
  ret

Reviewed Link : http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141208/248531.html

llvm-svn: 224119

9 years ago[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.
Andrea Di Biagio [Fri, 12 Dec 2014 12:41:22 +0000 (12:41 +0000)]
[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.

This patch fixes the issue reported as PR21807. There was a minor difference
in the generated code depending on the -g flag.

The cause was that with -g the machine scheduler used a different
scheduling strategy. This decision was based on the number of instructions
in a schedule region and included debug instructions in that count.

This patch fixes the issue in MISched and provides a test.

Patch by Russell Gallop!

llvm-svn: 224118

9 years ago[Asan] XFAIL the interception_failure_test.cc test on FreeBSD
Viktor Kutuzov [Fri, 12 Dec 2014 12:13:40 +0000 (12:13 +0000)]
[Asan] XFAIL the interception_failure_test.cc test on FreeBSD
Differential Revision: http://reviews.llvm.org/D6591

llvm-svn: 224117

9 years ago[Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSD
Viktor Kutuzov [Fri, 12 Dec 2014 12:09:56 +0000 (12:09 +0000)]
[Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6590

llvm-svn: 224116

9 years agoEmit Tag_ABI_FP_16bit_format build attribute.
Charlie Turner [Fri, 12 Dec 2014 11:59:18 +0000 (11:59 +0000)]
Emit Tag_ABI_FP_16bit_format build attribute.

The __fp16 type is unconditionally exposed. Since -mfp16-format is not yet
supported, there is not a user switch to change this behaviour. This build
attribute should capture the default behaviour of the compiler, which is to
expose the IEEE 754 version of __fp16.

When -mfp16-format is emitted, that will be the way to control the value of
this build attribute.

Change-Id: I8a46641ff0fd2ef8ad0af5f482a6d1af2ac3f6b0
llvm-svn: 224115

9 years agoSilence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.
Yaron Keren [Fri, 12 Dec 2014 11:07:51 +0000 (11:07 +0000)]
Silence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.

In release builds this is actually possible as without asserts there is
no testing of the actual read bytes and the variables could be partially
uninitialized.

llvm-svn: 224114

9 years agoMake File always take the ownership of a MemoryBuffer.
Rui Ueyama [Fri, 12 Dec 2014 10:27:33 +0000 (10:27 +0000)]
Make File always take the ownership of a MemoryBuffer.

The documentation of parseFile() said that "the resulting File
object may take ownership of the MemoryBuffer." So, whether or not
the ownership of a MemoryBuffer would be taken was not clear.
A FileNode (a subclass of InputElement, which is being deprecated)
keeps the ownership if a File doesn't take it.

This patch makes File always take the ownership of a buffer.
Buffers lifespan is not always the same as File instances.
Files are able to deallocate buffers after parsing the contents.

llvm-svn: 224113

9 years agoclang-format: Revamp nested block formatting.
Daniel Jasper [Fri, 12 Dec 2014 09:40:58 +0000 (09:40 +0000)]
clang-format: Revamp nested block formatting.

This fixed llvm.org/PR21804 and hopefully a few other strange cases.

Before:
    if (blah_blah(whatever, whatever, [] {
      doo_dah();
      doo_dah();
    })) {
    }
    }

After:
    if (blah_blah(whatever, whatever, [] {
          doo_dah();
          doo_dah();
        })) {
    }
    }

llvm-svn: 224112

9 years agoInclude newlib-specific locales in __locale
Sergey Dmitrouk [Fri, 12 Dec 2014 08:36:16 +0000 (08:36 +0000)]
Include newlib-specific locales in __locale

llvm-svn: 224111

9 years agoCodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile
David Majnemer [Fri, 12 Dec 2014 08:16:09 +0000 (08:16 +0000)]
CodeGen: Loads/stores to allocas for atomic ops shouldn't be volatile

Don't inherit the volatile-ness of the input pointer to the volatile
operation for memory allocated on the side.

This fixes PR17306.

llvm-svn: 224110

9 years agoPass output stream to AsLexInput instead of the whole tool_output_file.
Craig Topper [Fri, 12 Dec 2014 07:52:19 +0000 (07:52 +0000)]
Pass output stream to AsLexInput instead of the whole tool_output_file.

llvm-svn: 224109

9 years agoUse unique_ptr to remove an explicit delete. Change return type to pass the unique_pt...
Craig Topper [Fri, 12 Dec 2014 07:52:16 +0000 (07:52 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.

llvm-svn: 224108

9 years agoUse make_unique instead of reset() and 'new'
Craig Topper [Fri, 12 Dec 2014 07:52:14 +0000 (07:52 +0000)]
Use make_unique instead of reset() and 'new'

llvm-svn: 224107

9 years agoUse range-based for loop.
Craig Topper [Fri, 12 Dec 2014 07:52:11 +0000 (07:52 +0000)]
Use range-based for loop.

llvm-svn: 224106

9 years agoRemove unnecessary calls to unique_ptr::get.
Craig Topper [Fri, 12 Dec 2014 07:52:09 +0000 (07:52 +0000)]
Remove unnecessary calls to unique_ptr::get.

llvm-svn: 224105

9 years agoRemove an unnecessary reference variable that pointed to a unique_ptr variable. Just...
Craig Topper [Fri, 12 Dec 2014 07:52:06 +0000 (07:52 +0000)]
Remove an unnecessary reference variable that pointed to a unique_ptr variable. Just use the unique_ptr variable directly.

llvm-svn: 224104

9 years agoUse unique_ptr operator= instead of constructor to make it explicit that there's...
Craig Topper [Fri, 12 Dec 2014 07:52:00 +0000 (07:52 +0000)]
Use unique_ptr operator= instead of constructor to make it explicit that there's no conversion occurring.

llvm-svn: 224103

9 years agoSeparate file parsing from File's constructors.
Rui Ueyama [Fri, 12 Dec 2014 07:31:09 +0000 (07:31 +0000)]
Separate file parsing from File's constructors.

This is a second patch for InputGraph cleanup.

Sorry about the size of the patch, but what I did in this
patch is basically moving code from constructor to a new
method, parse(), so the amount of new code is small.
This has no change in functionality.

We've discussed the issue that we have too many classes
to represent a concept of "file". We have File subclasses
that represent files read from disk. In addition to that,
we have bunch of InputElement subclasses (that are part
of InputGraph) that represent command line arguments for
input file names. InputElement is a wrapper for File.

InputElement has parseFile method. The method instantiates
a File. The File's constructor reads a file from disk and
parses that.

Because parseFile method is called from multiple worker
threads, file parsing is processed in parallel. In other
words, one reason why we needed the wrapper classes is
because a File would start reading a file as soon as it
is instantiated.

So, the reason why we have too many classes here is at
least partly because of the design flaw of File class.
Just like threads in a good threading library, we need
to separate instantiation from "start" method, so that
we can instantiate File objects when we need them (which
should be very fast because it involves only one mmap()
and no real file IO) and use them directly instead of
the wrapper classes. Later, we call parse() on each
file in parallel to let them do actual file IO.

In this design, we can eliminate a reason to have the
wrapper classes.

In order to minimize the size of the patch, I didn't go so
far as to replace the wrapper classes with File classes.
The wrapper classes are still there.

In this patch, we call parse() immediately after
instantiating a File, so this really has no change in
functionality. Eventually the call of parse() should be
moved to Driver::link(). That'll be done in another patch.

llvm-svn: 224102

9 years ago[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS
Kumar Sukhani [Fri, 12 Dec 2014 07:08:12 +0000 (07:08 +0000)]
[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS

Enabling COMPILER_RT_INCLUDE_TESTS and updating tests/sanitizer_allocator_test.cc to remove Allocator64 related tests for MIPS.

Reviewed By: samsonov

llvm-svn: 224101

9 years agoDo not warn on keyword undef
Serge Pavlov [Fri, 12 Dec 2014 06:37:55 +0000 (06:37 +0000)]
Do not warn on keyword undef

#undef a keyword is generally harmless but used often in configuration scripts.
Also added tests that I forgot to include to commit in r223114.

llvm-svn: 224100

9 years ago[ELF] Remove isThumb().
Shankar Easwaran [Fri, 12 Dec 2014 05:20:28 +0000 (05:20 +0000)]
[ELF] Remove isThumb().

llvm-svn: 224099

9 years agoA fix for PR21176.
Ekaterina Romanova [Fri, 12 Dec 2014 05:11:47 +0000 (05:11 +0000)]
A fix for PR21176.

DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.
Added DW_OP_stack_value to the stack.

Marked incorrect-variable-debugloc1.ll to xfail for PowerPC64, while the the failure (PR21881)
is being investigated.

llvm-svn: 224098

9 years agoFix another infinite loop in InstCombine
Steven Wu [Fri, 12 Dec 2014 04:34:07 +0000 (04:34 +0000)]
Fix another infinite loop in InstCombine

Summary:
InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/19150820

Reviewers: majnemer

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

llvm-svn: 224097

9 years agoAdd support for building libc++ as a 32 bit library
Eric Fiselier [Fri, 12 Dec 2014 03:12:18 +0000 (03:12 +0000)]
Add support for building libc++ as a 32 bit library

llvm-svn: 224096

9 years agoFix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI...
Eric Fiselier [Fri, 12 Dec 2014 02:36:23 +0000 (02:36 +0000)]
Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI are turned off.

llvm-svn: 224095