platform/upstream/llvm.git
9 years agollvm-pdbdump: Fix gcc/clang build
David Majnemer [Sun, 22 Feb 2015 22:33:57 +0000 (22:33 +0000)]
llvm-pdbdump: Fix gcc/clang build

llvm-svn: 230187

9 years ago[llvm-pdbdump] Fix a few compilation failures.
Zachary Turner [Sun, 22 Feb 2015 22:20:26 +0000 (22:20 +0000)]
[llvm-pdbdump] Fix a few compilation failures.

llvm-svn: 230186

9 years agoAdd missing header
David Blaikie [Sun, 22 Feb 2015 22:18:55 +0000 (22:18 +0000)]
Add missing header

llvm-svn: 230185

9 years ago[llvm-pdbdump] Rewrite dumper using visitor pattern.
Zachary Turner [Sun, 22 Feb 2015 22:03:38 +0000 (22:03 +0000)]
[llvm-pdbdump] Rewrite dumper using visitor pattern.

This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

llvm-svn: 230184

9 years agoUnix/BSD system calls are prefixed with SYS_ on FreeBSD and Mac
Ismail Pazarbasi [Sun, 22 Feb 2015 22:01:09 +0000 (22:01 +0000)]
Unix/BSD system calls are prefixed with SYS_ on FreeBSD and Mac

Also, __syscall form should be used when one or more of the
parameters is a 64-bit argument to ensure that argument alignment
is correct.

llvm-svn: 230183

9 years ago[llvm-pdbdump] Simplify options and output.
Zachary Turner [Sun, 22 Feb 2015 21:45:38 +0000 (21:45 +0000)]
[llvm-pdbdump] Simplify options and output.

This removes a wealth of options, and instead now only provides
three options.  -symbols, -types, and -compilands.  This greatly
simplifies use of the tool, and makes it easier to understand
what you're going to see when you run the tool.

llvm-svn: 230182

9 years agoRoll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevit...
David Blaikie [Sun, 22 Feb 2015 20:58:38 +0000 (20:58 +0000)]
Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build.

llvm-svn: 230181

9 years agoUse common parse routine to read alignment values from bitcode
JF Bastien [Sun, 22 Feb 2015 19:32:03 +0000 (19:32 +0000)]
Use common parse routine to read alignment values from bitcode

While fuzzing LLVM bitcode files, I discovered that (1) the bitcode reader doesn't check that alignments are no larger than 2**29; (2) downstream code doesn't check the range; and (3) for values out of range, corresponding large memory requests (based on alignment size) will fail. This code fixes the bitcode reader to check for valid alignments, fixing this problem.

This CL fixes alignment value on global variables, functions, and instructions: alloca, load, load atomic, store, store atomic.

Patch by Karl Schimpf (kschimpf@google.com).

llvm-svn: 230180

9 years agoRevert "[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is...
Renato Golin [Sun, 22 Feb 2015 18:58:18 +0000 (18:58 +0000)]
Revert "[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand"

This reverts commit r230019, as it was breaking the ARM sanitizer buildbot
and let other errors be introduced since it wasn't fixed/reverted in
time.

llvm-svn: 230179

9 years ago[LICM] Refactor to expose functionality as utility functions
Hal Finkel [Sun, 22 Feb 2015 18:35:32 +0000 (18:35 +0000)]
[LICM] Refactor to expose functionality as utility functions

This refactors the core functionality of LICM: HoistRegion, SinkRegion and
PromoteAliasSet (renamed to promoteLoopAccessesToScalars) as utility functions
in LoopUtils. This will enable other transformations to make use of them
directly.

Patch by Ashutosh Nema.

llvm-svn: 230178

9 years ago[DagCombiner] Generalized BuildVector Vector Concatenation
Simon Pilgrim [Sun, 22 Feb 2015 18:17:28 +0000 (18:17 +0000)]
[DagCombiner] Generalized BuildVector Vector Concatenation

The CONCAT_VECTORS combiner pass can transform the concat of two BUILD_VECTOR nodes into a single BUILD_VECTOR node.

This patch generalises this to support any number of BUILD_VECTOR nodes, and also permits UNDEF nodes to be included as well.

This was noticed as AVX vec128 -> vec256 canonicalization sometimes creates a CONCAT_VECTOR with a real vec128 lower and an vec128 UNDEF upper.

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

llvm-svn: 230177

9 years ago[DAGCombine] Don't assume integer-type legailty in reduceBuildVecConvertToConvertBuildVec
Hal Finkel [Sun, 22 Feb 2015 16:10:22 +0000 (16:10 +0000)]
[DAGCombine] Don't assume integer-type legailty in reduceBuildVecConvertToConvertBuildVec

DAGCombine will rewrite an BUILD_VECTOR where all non-undef inputs some from
[US]INT_TO_FP, as a BUILD_VECTOR of integers with the conversion applied as a
vector operation. We check operation legality of the conversion, but fail to
check legality of the integer vector type itself. Because targets don't
normally override operation legality defaults for illegal types, we need to
check this also.

This came up in the context of the QPX vector entensions for PowerPC (which can
have legal floating-point vector types without corresponding legal integer
vector types). No in-tree test case for this yes, but one can be added once
the QPX support has been committed.

llvm-svn: 230176

9 years ago[SDAG] Use correct alignments on expanded vector trunc-store/ext-loads
Hal Finkel [Sun, 22 Feb 2015 15:58:04 +0000 (15:58 +0000)]
[SDAG] Use correct alignments on expanded vector trunc-store/ext-loads

When expanding a truncating store or extending load using vector extracts or
inserts and scalar stores and loads, we were giving each of these scalar stores
or loads the same alignment as the original vector operation. While this will
often be right (most vector operations, especially those produced by
autovectorization, have the alignment of the underlying scalar type), the
vector operation could certainly have a larger alignment.

No test case (yet); noticed by inspection.

llvm-svn: 230175

9 years agoRevert r230171 "TSan runtime: unbreak the build with ccache"
Dmitri Gribenko [Sun, 22 Feb 2015 12:20:05 +0000 (12:20 +0000)]
Revert r230171 "TSan runtime: unbreak the build with ccache"

It broke a buildbot with a non-clang (?) compiler.

llvm-svn: 230174

9 years agoWhitespace fix for r230172.
Kuba Brecka [Sun, 22 Feb 2015 11:49:21 +0000 (11:49 +0000)]
Whitespace fix for r230172.

llvm-svn: 230173

9 years agoFix gc-test.cc to work under higher -O levels
Kuba Brecka [Sun, 22 Feb 2015 11:12:17 +0000 (11:12 +0000)]
Fix gc-test.cc to work under higher -O levels

The gc-test.cc tries underflows of a variable up to -32 bytes, but on i386, the left redzone is not 32 bytes, it’s only 16 bytes and therefore the access to var[-32] is completely off. The reason why this test didn’t fail before is that we’ve been lucky and there was another variable before the var array, which was also instrumented. This fix uses “-32” for 64-bit systems and “-16” for 32-bit.

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

llvm-svn: 230172

9 years agoTSan runtime: unbreak the build with ccache
Dmitri Gribenko [Sun, 22 Feb 2015 11:04:59 +0000 (11:04 +0000)]
TSan runtime: unbreak the build with ccache

llvm-svn: 230171

9 years agoFix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:29 +0000 (09:58 +0000)]
Fix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]

llvm-svn: 230170

9 years agoRewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIB...
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:19 +0000 (09:58 +0000)]
RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]

llvm-svn: 230169

9 years agoRewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:58:13 +0000 (09:58 +0000)]
RewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]

llvm-svn: 230168

9 years agoLowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]
NAKAMURA Takumi [Sun, 22 Feb 2015 09:51:42 +0000 (09:51 +0000)]
LowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]

\param should be used as itemized.

llvm-svn: 230167

9 years agoSwitch to use override, fixes -Winconsistent-missing-override on LLD.
Chandler Carruth [Sun, 22 Feb 2015 08:34:47 +0000 (08:34 +0000)]
Switch to use override, fixes -Winconsistent-missing-override on LLD.

llvm-svn: 230166

9 years ago[X86] Add some missing redundant MMX and SSE encodings for disassembler.
Craig Topper [Sun, 22 Feb 2015 07:50:41 +0000 (07:50 +0000)]
[X86] Add some missing redundant MMX and SSE encodings for disassembler.

llvm-svn: 230165

9 years agoRemove log statements from config scripts.
Zachary Turner [Sun, 22 Feb 2015 07:31:42 +0000 (07:31 +0000)]
Remove log statements from config scripts.

The bots seem to be happy now.

llvm-svn: 230164

9 years agoReally fix the build this time.
Zachary Turner [Sun, 22 Feb 2015 07:13:52 +0000 (07:13 +0000)]
Really fix the build this time.

I was setting the python variable to "@HAVE_DIA_SDK@", which will
always be a string, and will always evaluate to True.

llvm-svn: 230163

9 years agoAttempt to fix the builders.
Zachary Turner [Sun, 22 Feb 2015 07:01:41 +0000 (07:01 +0000)]
Attempt to fix the builders.

The issue was that the test Makefile had not been updated to
provide a value for HAVE_DIA_SDK, so it was being initialized
incorrectly.  Hopefully this brings everything back to green.

llvm-svn: 230162

9 years ago[llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".
Zachary Turner [Sun, 22 Feb 2015 06:47:32 +0000 (06:47 +0000)]
[llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".

NOTE: This patch intentionally breaks the build.  It attempts
to resubmit r230083, but with some debug logging in the CMake
and lit config files to determine why certain bots do not
correctly disable the DIA tests when DIA is not available.

After a sufficient number of bots fail, this patch will either
be reverted or, if the cause of the failure becomes obvious,
a fix submitted with the log statements removed.

llvm-svn: 230161

9 years agoRelax the requirement on sized deallocation a bit: Default on unsized delete if sized...
Larisse Voufo [Sun, 22 Feb 2015 06:36:53 +0000 (06:36 +0000)]
Relax the requirement on sized deallocation a bit: Default on unsized delete if sized delete is not provided in global scope, and -fdefine-sized-deallocation option is disabled.

llvm-svn: 230160

9 years agoFix typo.
Larisse Voufo [Sun, 22 Feb 2015 06:36:49 +0000 (06:36 +0000)]
Fix typo.

llvm-svn: 230159

9 years agoMove -fdefine-sized-deallocation and -fno-sized-deallocation options from driver...
Larisse Voufo [Sun, 22 Feb 2015 06:36:46 +0000 (06:36 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.

llvm-svn: 230158

9 years ago[ELF] Teach GNU Driver about --stats.
Davide Italiano [Sun, 22 Feb 2015 03:12:21 +0000 (03:12 +0000)]
[ELF] Teach GNU Driver about --stats.

This is mainly for back-compatibility with GNU ld.
Ideally --stats should be a general option in LinkingContext, providing
individual stats for every pass in the linking process.
In the GNU driver, a better wording could be used, but there's no need
to change it for now.

Differential Revision: D7657
Reviewed by: ruiu

llvm-svn: 230157

9 years agoCOFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections
David Majnemer [Sun, 22 Feb 2015 02:35:27 +0000 (02:35 +0000)]
COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections

The CodeView debug info section, .debug$S, also has this set.  MinGW
sets this bit for their DWARF sections as well.

llvm-svn: 230156

9 years agoCOFF: Consistently format the DWARF sections
David Majnemer [Sun, 22 Feb 2015 02:35:22 +0000 (02:35 +0000)]
COFF: Consistently format the DWARF sections

llvm-svn: 230155

9 years ago[Orc] Remove redundant using directive.
Lang Hames [Sun, 22 Feb 2015 01:48:23 +0000 (01:48 +0000)]
[Orc] Remove redundant using directive.

llvm-svn: 230154

9 years ago[Orc] Add header comment to IndirectionUtils.cpp.
Lang Hames [Sun, 22 Feb 2015 01:45:31 +0000 (01:45 +0000)]
[Orc] Add header comment to IndirectionUtils.cpp.

llvm-svn: 230153

9 years agoRemove two unused methods. No behavior change.
Nico Weber [Sun, 22 Feb 2015 00:27:32 +0000 (00:27 +0000)]
Remove two unused methods.  No behavior change.

llvm-svn: 230152

9 years agoIRCE: generalize InductiveRangeCheck::computeSafeIterationSpace to
Sanjoy Das [Sat, 21 Feb 2015 22:20:22 +0000 (22:20 +0000)]
IRCE: generalize InductiveRangeCheck::computeSafeIterationSpace to
work with a non-canonical induction variable.

This is currently a non-functional change because we only ever call
computeSafeIterationSpace on a canonical induction variable; but the
generalization will be useful in a later commit.

llvm-svn: 230151

9 years agoIRCE: use SCEVs instead of llvm::Value's for intermediate
Sanjoy Das [Sat, 21 Feb 2015 22:07:32 +0000 (22:07 +0000)]
IRCE: use SCEVs instead of llvm::Value's for intermediate
calculations.  Semantically non-functional change.

This gets rid of some of the SCEV -> Value -> SCEV round tripping and
the Construct(SMin|SMax)Of and MaybeSimplify helper routines.

llvm-svn: 230150

9 years agoR600/SI: Use v_madmk_f32
Matt Arsenault [Sat, 21 Feb 2015 21:29:10 +0000 (21:29 +0000)]
R600/SI: Use v_madmk_f32

llvm-svn: 230149

9 years agoR600/SI: Try to use v_madak_f32
Matt Arsenault [Sat, 21 Feb 2015 21:29:07 +0000 (21:29 +0000)]
R600/SI: Try to use v_madak_f32

This is a code size optimization when the constant
only has one use.

llvm-svn: 230148

9 years agoR600/SI: Don't crash when getting immediate operand size
Matt Arsenault [Sat, 21 Feb 2015 21:29:04 +0000 (21:29 +0000)]
R600/SI: Don't crash when getting immediate operand size

llvm-svn: 230147

9 years agoR600/SI: Fix mad*k definitions
Matt Arsenault [Sat, 21 Feb 2015 21:29:00 +0000 (21:29 +0000)]
R600/SI: Fix mad*k definitions

llvm-svn: 230146

9 years ago[X86][SSE] Added shuffle based integer zero extension tests.
Simon Pilgrim [Sat, 21 Feb 2015 21:25:16 +0000 (21:25 +0000)]
[X86][SSE] Added shuffle based integer zero extension tests.

llvm-svn: 230145

9 years agodocs: Mention that assertions must be enabled to use the -stats flag
Justin Bogner [Sat, 21 Feb 2015 20:53:36 +0000 (20:53 +0000)]
docs: Mention that assertions must be enabled to use the -stats flag

Patch by Rob Stewart. Thanks!

llvm-svn: 230144

9 years ago[Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.
Lang Hames [Sat, 21 Feb 2015 20:44:36 +0000 (20:44 +0000)]
[Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.

NFC.

llvm-svn: 230143

9 years agoMachineInstr: Use range-based for loops. NFC.
Benjamin Kramer [Sat, 21 Feb 2015 17:08:08 +0000 (17:08 +0000)]
MachineInstr: Use range-based for loops. NFC.

llvm-svn: 230142

9 years agoCalling memmove on a MachineOperand is totally safe.
Benjamin Kramer [Sat, 21 Feb 2015 16:22:48 +0000 (16:22 +0000)]
Calling memmove on a MachineOperand is totally safe.

While it's not POD due to the user-defined constructor, it's still a trivially
copyable type. No functional change.

llvm-svn: 230141

9 years agoRemove leftover code
Johannes Doerfert [Sat, 21 Feb 2015 16:18:28 +0000 (16:18 +0000)]
Remove leftover code

llvm-svn: 230140

9 years ago[ELF] Remove FIXME(s) that are already fixed.
Shankar Easwaran [Sat, 21 Feb 2015 15:51:54 +0000 (15:51 +0000)]
[ELF] Remove FIXME(s) that are already fixed.

FIXME code was left around in few places where its already been taken care of.

This removes the FIXME's that are not needed.

llvm-svn: 230139

9 years ago[ELF][Writer] Use Path to create AtomSection.
Shankar Easwaran [Sat, 21 Feb 2015 15:49:34 +0000 (15:49 +0000)]
[ELF][Writer] Use Path to create AtomSection.

Now since the correct file path for atoms is available and not clobbered,
commit r222309 which was reverted previously can be added back.

No change in functionality.

llvm-svn: 230138

9 years agoRemove dead prototype.
Benjamin Kramer [Sat, 21 Feb 2015 14:35:00 +0000 (14:35 +0000)]
Remove dead prototype.

llvm-svn: 230137

9 years agoX86: Remove custom lowering of SIGN_EXTEND_INREG
Benjamin Kramer [Sat, 21 Feb 2015 14:31:29 +0000 (14:31 +0000)]
X86: Remove custom lowering of SIGN_EXTEND_INREG

This was just replicating logic from the legalizer. Covered by existing
tests.

llvm-svn: 230136

9 years agoUnconditionally create a new MCInstrInfo in the asm printer for
Eric Christopher [Sat, 21 Feb 2015 09:09:15 +0000 (09:09 +0000)]
Unconditionally create a new MCInstrInfo in the asm printer for
asm parsing since it's not subtarget dependent and we can't depend
upon the one hanging off the MachineFunction's subtarget still
being around.

llvm-svn: 230135

9 years agoRemove obsolete comment.
Eric Christopher [Sat, 21 Feb 2015 08:48:23 +0000 (08:48 +0000)]
Remove obsolete comment.

llvm-svn: 230134

9 years agoHave the MipsAsmPrinter fp stub emission code take a custom
Eric Christopher [Sat, 21 Feb 2015 08:48:22 +0000 (08:48 +0000)]
Have the MipsAsmPrinter fp stub emission code take a custom
MCSubtargetInfo as the MachineFunction has gone away and we need
to emit code at the module level.

llvm-svn: 230133

9 years agoTurn an if+llvm_unreachable into an assert and reword comment.
Eric Christopher [Sat, 21 Feb 2015 08:32:38 +0000 (08:32 +0000)]
Turn an if+llvm_unreachable into an assert and reword comment.

llvm-svn: 230132

9 years agoEndianness can be gotten from the DataLayout which we already
Eric Christopher [Sat, 21 Feb 2015 08:32:22 +0000 (08:32 +0000)]
Endianness can be gotten from the DataLayout which we already
have. Also, the subtarget is invalid at this point.

llvm-svn: 230131

9 years agoIf constructed llvm_build_dir doesn't exist, retry as an iphoneos path.
Jason Molenda [Sat, 21 Feb 2015 06:13:51 +0000 (06:13 +0000)]
If constructed llvm_build_dir doesn't exist, retry as an iphoneos path.

llvm-svn: 230130

9 years agoX86: Call __main using the SelectionDAG
David Majnemer [Sat, 21 Feb 2015 05:49:45 +0000 (05:49 +0000)]
X86: Call __main using the SelectionDAG

Synthesizing a call directly using the MI layer would confuse the frame
lowering code.  This is problematic as frame lowering is highly
sensitive the particularities of calls, etc.

llvm-svn: 230129

9 years agoAdd missing #include. This should fix the Windows build.
Zachary Turner [Sat, 21 Feb 2015 04:45:12 +0000 (04:45 +0000)]
Add missing #include.  This should fix the Windows build.

llvm-svn: 230128

9 years ago[ELF] Fix References being ignored.
Shankar Easwaran [Sat, 21 Feb 2015 04:42:43 +0000 (04:42 +0000)]
[ELF] Fix References being ignored.

The ELFReader was skipping references for sections that contained relocations.

This fixes the bug.

llvm-svn: 230127

9 years agoUpdate for Clang API change in r230123 -- lookup_result was always
Chandler Carruth [Sat, 21 Feb 2015 04:31:13 +0000 (04:31 +0000)]
Update for Clang API change in r230123 -- lookup_result was always
const, there was never a need for lookup_const_result. Now that vestigal
type is gone, so switch LLDB to lookup_result and to use the
DeclContextLookupResult rather than the Const variant.

llvm-svn: 230126

9 years agoAdd temporary workaround for missing symbol __cxa_throw_bad_new_array_length on OS X.
Eric Fiselier [Sat, 21 Feb 2015 04:30:36 +0000 (04:30 +0000)]
Add temporary workaround for missing symbol __cxa_throw_bad_new_array_length on OS X.

llvm-svn: 230125

9 years ago[obj2yaml/yaml2obj] Add SHT_GROUP support.
Shankar Easwaran [Sat, 21 Feb 2015 04:28:26 +0000 (04:28 +0000)]
[obj2yaml/yaml2obj] Add SHT_GROUP support.

This adds section group support to the tools obj2yaml and yaml2obj.

llvm-svn: 230124

9 years agoCleanup: remove artificial division between lookup results and const lookup
Richard Smith [Sat, 21 Feb 2015 02:45:19 +0000 (02:45 +0000)]
Cleanup: remove artificial division between lookup results and const lookup
results. No-one was ever modifying a lookup result, and it would not be
reasonable to do so.

llvm-svn: 230123

9 years agoSmall cleanup. Don't use else when not needed.
Davide Italiano [Sat, 21 Feb 2015 02:36:54 +0000 (02:36 +0000)]
Small cleanup. Don't use else when not needed.
Pointed out by David Majnemer.

llvm-svn: 230122

9 years agoRevert r167816 and replace it with a proper fix for the issue: do not
Richard Smith [Sat, 21 Feb 2015 02:31:57 +0000 (02:31 +0000)]
Revert r167816 and replace it with a proper fix for the issue: do not
invalidate lookup_iterators and lookup_results for some name within a
DeclContext if the lookup results for a *different* name change.

llvm-svn: 230121

9 years ago[libc++] Try and prevent evaluation of `is_default_constructible` on tuples default...
Eric Fiselier [Sat, 21 Feb 2015 02:30:41 +0000 (02:30 +0000)]
[libc++] Try and prevent evaluation of `is_default_constructible` on tuples default constructor if it is not needed.

Summary:
Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should.

```

#include <type_traits>

template <class T>
struct IllFormedDefaultImp {
    IllFormedDefaultImp(T x) : value(x) {}
    constexpr IllFormedDefaultImp() {}
    T value;
};

typedef IllFormedDefaultImp<int &> IllFormedDefault;

template <class T, class U>
struct pair
{
  template <bool Dummy = true,
    class = typename std::enable_if<
         std::is_default_constructible<T>::value
      && std::is_default_constructible<U>::value
      && Dummy>::type
    >
  constexpr pair() : first(), second() {}

  pair(T const & t, U const & u) : first(t), second(u) {}

  T first;
  U second;
};

int main()
{
  int x = 1;
  IllFormedDefault v(x);
  pair<IllFormedDefault, IllFormedDefault> p(v, v);
}
```

One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple.

Reviewers: mclow.lists, rsmith, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: ldionne, cfe-commits

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

llvm-svn: 230120

9 years ago[libcxx] Move to using libc++abi2.exp as the default symbol list for libc++
Eric Fiselier [Sat, 21 Feb 2015 02:26:24 +0000 (02:26 +0000)]
[libcxx] Move to using libc++abi2.exp as the default symbol list for libc++

Summary:
libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified.

Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp.

I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9.

Reviewers: danalbert, mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: meadori, cfe-commits

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

llvm-svn: 230119

9 years agoCodeGen: convert CCState interface to using ArrayRefs
Tim Northover [Sat, 21 Feb 2015 02:11:17 +0000 (02:11 +0000)]
CodeGen: convert CCState interface to using ArrayRefs

Everyone except R600 was manually passing the length of a static array
at each callsite, calculated in a variety of interesting ways. Far
easier to let ArrayRef handle that.

There should be no functional change, but out of tree targets may have
to tweak their calls as with these examples.

llvm-svn: 230118

9 years agoRun simple-fail.cpp at -O{1,2,3}.
Peter Collingbourne [Sat, 21 Feb 2015 01:48:51 +0000 (01:48 +0000)]
Run simple-fail.cpp at -O{1,2,3}.

It's probably overkill to run the other tests at -O* given the increasing
combinatorial explosion.

llvm-svn: 230117

9 years agoCFI: Add tests for 32-bit, 64-bit and memory bitsets. Break optimization in more...
Peter Collingbourne [Sat, 21 Feb 2015 01:36:08 +0000 (01:36 +0000)]
CFI: Add tests for 32-bit, 64-bit and memory bitsets. Break optimization in more places.

llvm-svn: 230116

9 years agoImprove diagnostic when failing to synthesize implicit member due to dllexport (PR22591)
Hans Wennborg [Sat, 21 Feb 2015 01:07:24 +0000 (01:07 +0000)]
Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)

This is only a problem in C++03 mode targeting MS ABI (MinGW doesn't
export inline methods, and C++11 marks these methods implicitly
deleted).

Since targeting the MS ABI in pre-C++11 mode is a rare configuration,
this will probably not get fixed, but we can at least have a better
error message.

llvm-svn: 230115

9 years agoFix typo.
Larisse Voufo [Sat, 21 Feb 2015 01:05:29 +0000 (01:05 +0000)]
Fix typo.

llvm-svn: 230114

9 years agoWin64: Stack alignment constraints aren't applied during SET_FPREG
David Majnemer [Sat, 21 Feb 2015 01:04:47 +0000 (01:04 +0000)]
Win64: Stack alignment constraints aren't applied during SET_FPREG

Stack realignment occurs after the prolog, not during, for Win64.
Because of this, don't factor in the maximum stack alignment when
establishing a frame pointer.

This fixes PR22572.

llvm-svn: 230113

9 years agoMove -fdefine-sized-deallocation and -fno-sized-deallocation options from driver...
Larisse Voufo [Sat, 21 Feb 2015 01:03:48 +0000 (01:03 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.

llvm-svn: 230112

9 years agoAsmParser/Writer: Handle symbolic constants in DI 'flags:'
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 01:02:18 +0000 (01:02 +0000)]
AsmParser/Writer: Handle symbolic constants in DI 'flags:'

Parse (and write) symbolic constants in debug info `flags:` fields.
This prevents a readability (and CHECK-ability) regression with the new
debug info hierarchy.

Old (well, current) assembly, with pretty-printing:

    !{!"...\\0016387", ...} ; ... [public] [rvalue reference]

Flags field without this change:

   !MDDerivedType(flags: 16387, ...)

Flags field with this change:

   !MDDerivedType(flags: DIFlagPublic | DIFlagRValueReference, ...)

As discussed in the review thread, this isn't a final state.  Most of
these flags correspond to `DW_AT_` symbolic constants, and we might
eventually want to support arbitrary attributes in some form.  However,
as it stands now, some of the flags correspond to other concepts (like
`FlagStaticMember`); until things are refactored this is the simplest
way to move forward without regressing assembly.

llvm-svn: 230111

9 years agoAdd missing Xcode project files for MICmdCmdSymbol.cpp and MICmdCmdSymbol.h.
Greg Clayton [Sat, 21 Feb 2015 00:57:59 +0000 (00:57 +0000)]
Add missing Xcode project files for MICmdCmdSymbol.cpp and MICmdCmdSymbol.h.

llvm-svn: 230110

9 years ago[Objective-C]. Provide a new formatting kind, "os_trace" which
Fariborz Jahanian [Sat, 21 Feb 2015 00:45:58 +0000 (00:45 +0000)]
[Objective-C]. Provide a new formatting kind, "os_trace" which
can take a "const char*" format but supports standard printf
and CF/NS types . rdar://19904147

llvm-svn: 230109

9 years agoIR: Add helper to split debug info flags bitfield
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:45:26 +0000 (00:45 +0000)]
IR: Add helper to split debug info flags bitfield

Split debug info 'flags' bitfield over a vector so the current flags can
be iterated over.  This API (in combination with r230107) will be used
for assembly support for symbolic constants.

llvm-svn: 230108

9 years agoIR: Add debug info flag string conversions
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:43:09 +0000 (00:43 +0000)]
IR: Add debug info flag string conversions

Add `DIDescriptor::getFlag(StringRef)` and
`DIDescriptor::getFlagString(unsigned)`.  The latter only converts exact
matches; I'll add separate API for breaking the flags bitfield up into
parts.

llvm-svn: 230107

9 years agoDon't use:
Greg Clayton [Sat, 21 Feb 2015 00:39:13 +0000 (00:39 +0000)]
Don't use:

#include <lldb/API/*>"

Please use:

#include "lldb/API/*"

llvm-svn: 230106

9 years agoIR: Move DebugInfo Flag* definitions to .def file, NFC
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:37:53 +0000 (00:37 +0000)]
IR: Move DebugInfo Flag* definitions to .def file, NFC

This prepares for adding string support.

llvm-svn: 230105

9 years agoRevert "Adapt Makefile dependencies for the clang module format change in r230089."
Adrian Prantl [Sat, 21 Feb 2015 00:29:43 +0000 (00:29 +0000)]
Revert "Adapt Makefile dependencies for the clang module format change in r230089."

llvm-svn: 230104

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Sat, 21 Feb 2015 00:29:14 +0000 (00:29 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit 230099.

The Linux configure+make build variant still needs some work.

llvm-svn: 230103

9 years agoFix the test so it runs correctly when there are spaces in the path to the stdc+...
Greg Clayton [Sat, 21 Feb 2015 00:28:32 +0000 (00:28 +0000)]
Fix the test so it runs correctly when there are spaces in the path to the stdc++ library.

<rdar://problem/19297312>

llvm-svn: 230102

9 years agoFix this test case so it runs correctly.
Greg Clayton [Sat, 21 Feb 2015 00:23:36 +0000 (00:23 +0000)]
Fix this test case so it runs correctly.

<rdar://problem/19286788>

llvm-svn: 230101

9 years agoAsmParser: Use StringRef for keyword comparisons, NFC
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:18:40 +0000 (00:18 +0000)]
AsmParser: Use StringRef for keyword comparisons, NFC

Leverage `StringRef` inside keyword comparison macros.  There's no
reason to be so low-level here, and I'm about to add another
`startswith()` use, so let's make it easy to read.

llvm-svn: 230100

9 years agoconfigure+make: Rearange clangCodeGen to come before clangAST.
Adrian Prantl [Sat, 21 Feb 2015 00:15:40 +0000 (00:15 +0000)]
configure+make: Rearange clangCodeGen to come before clangAST.
Follow-up to r230089.

llvm-svn: 230099

9 years agoSet the datalayout in the gold plugin.
Rafael Espindola [Sat, 21 Feb 2015 00:13:15 +0000 (00:13 +0000)]
Set the datalayout in the gold plugin.

This fixes the gold tests after r230054.

llvm-svn: 230098

9 years ago[PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable...
Philip Reames [Sat, 21 Feb 2015 00:09:09 +0000 (00:09 +0000)]
[PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable per GC

Previously, this pass ran over every function in the Module if added to the pass order.  With this change, it runs only over those with a GC attribute where the GC explicitly opts in.  A GC can also choose which of entry safepoint polls, backedge safepoint polls, and call safepoints it wants.  I hope to get these exposed as checks on the GCStrategy at some point, but for now, the checks are manual string comparisons.

llvm-svn: 230097

9 years agoconfigure+make: Add ipo to the dependencies of libclang.
Adrian Prantl [Sat, 21 Feb 2015 00:04:15 +0000 (00:04 +0000)]
configure+make: Add ipo to the dependencies of libclang.
Follow-up to r230089.

llvm-svn: 230096

9 years agoAsmParser: Use do{}while(false) in macros, NFC
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 23:49:24 +0000 (23:49 +0000)]
AsmParser: Use do{}while(false) in macros, NFC

`do { ... } while (false)` is standard macro etiquette for forcing
instantiations into a single statement and requiring a `;` afterwards,
making statement-like macros easier to reason about (and harder to use
incorrectly).

I'm about to modify the macros in `LexIdentifier()`.  I noticed that the
`KEYWORD` macro *does* follow the rule, so I thought I'd clean up the
other macros to match (otherwise might not be worth changing, since the
benefits of this pattern are fairly irrelevant here).

llvm-svn: 230095

9 years agoRemove some unnecessary unreachables in favor of (sometimes implicit) assertions
David Blaikie [Fri, 20 Feb 2015 23:44:24 +0000 (23:44 +0000)]
Remove some unnecessary unreachables in favor of (sometimes implicit) assertions

Also simplify some else-after-return cases including some standard
algorithm convenience/use.

llvm-svn: 230094

9 years agoLiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.
Matthias Braun [Fri, 20 Feb 2015 23:43:14 +0000 (23:43 +0000)]
LiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.

Summary:
Letting them begin at the PHI instruction slightly simplifies the code
but more importantly avoids breaking the assumption that live ranges
starting at the block begin are also live at the end of the predecessor
blocks. The MachineVerifier checks that but was apparently never run in
the few instances where liveranges are calculated for machine-SSA
functions.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 230093

9 years ago[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names
Simon Atanasyan [Fri, 20 Feb 2015 23:37:40 +0000 (23:37 +0000)]
[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names

The patch teaches the clang's driver to understand new MIPS ISA names,
pass appropriate options to the assembler, defines corresponding macros etc

http://reviews.llvm.org/D7737

llvm-svn: 230092

9 years agoDon't set $LIB if we're not targetting windows.
Filipe Cabecinhas [Fri, 20 Feb 2015 23:35:19 +0000 (23:35 +0000)]
Don't set $LIB if we're not targetting windows.

Reviewers: timurrrr, samsonov

Subscribers: llvm-commits

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

llvm-svn: 230091

9 years agoAdapt Makefile dependencies for the clang module format change in r230089.
Adrian Prantl [Fri, 20 Feb 2015 23:35:07 +0000 (23:35 +0000)]
Adapt Makefile dependencies for the clang module format change in r230089.

llvm-svn: 230090

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 23:34:26 +0000 (23:34 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 2.

llvm-svn: 230089

9 years agoHide a bunch of advanced testing options in default opt --help output
Philip Reames [Fri, 20 Feb 2015 23:32:03 +0000 (23:32 +0000)]
Hide a bunch of advanced testing options in default opt --help output

These are internal options.  I need to go through, evaluate which are worth keeping and which not.  Many of them should probably be renamed as well.  Until I have time to do that, we can at least stop poluting the standard opt -help output.

llvm-svn: 230088