platform/upstream/llvm.git
11 years agocmake: don't set LLVM_COMPILER_IS_GCC_COMPATIBLE when using clang-cl
Hans Wennborg [Mon, 7 Oct 2013 22:03:23 +0000 (22:03 +0000)]
cmake: don't set LLVM_COMPILER_IS_GCC_COMPATIBLE when using clang-cl

Tip-of-tree CMake has become clang-cl aware [1]. In this case,
CMAKE_CXX_COMPILER_ID will still be Clang, but MSVC will be true.

[1] See http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d8356d4

llvm-svn: 192139

11 years agoRename lld:*_error::_ -> lld:*_error::ErrorCode.
Rui Ueyama [Mon, 7 Oct 2013 21:58:51 +0000 (21:58 +0000)]
Rename lld:*_error::_ -> lld:*_error::ErrorCode.

Summary: Rename lld:*_error::_ -> lld:*_error::ErrorCode.

Reviewers: shankarke

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1851

llvm-svn: 192138

11 years agoWindows: Avoiding resizing, use uninitialized data() instead
David Majnemer [Mon, 7 Oct 2013 21:57:07 +0000 (21:57 +0000)]
Windows: Avoiding resizing, use uninitialized data() instead

This is ever-so faster but more importantly matches what we have elsewhere.

llvm-svn: 192137

11 years agolibcxxabi contains the runtime support for C++. But, as some folks have
Nick Kledzik [Mon, 7 Oct 2013 21:39:41 +0000 (21:39 +0000)]
libcxxabi contains the runtime support for C++.  But, as some folks have
realized, it is not complete.  It relies on some _Unwind_* functions to be
supplied by the OS. That means it cannot be ported to platforms that don’t
already have an unwinder.

Years ago Apple wrote its own unwinder for MacOSX and iOS.  To make libcxxabi
complete, Apple has decided the source code for its unwinder can be contributed
to the open source LLVM libcxxabi project, with a dual licensed under LLVM
and MIT license.

So, I’ve spent some time cleaning up the sources to make them conform with
LLVM style and to conditionalize the sources in a way that should make it
easier to port to other platforms.  The sources are in a separate "Unwind"
directory under "src" in libcxxabi.

Background:
Most architectures now use "zero cost" exceptions for C++.  The zero cost means
there are no extra instructions executed if no exceptions are thrown.  But if
an exception is thrown, the runtime must consult side tables and figure out how
to restore registers and "unwind" from the current stack frame to the catch
clause.  That ability to modify the stack frames and cause the thread to resume
in a catch clause with all registers restored properly is the main purpose
of the unwinder.

This unwinder has two levels of API.  The high level APIs are the _Unwind_*
functions which the cxa_* exception functions in libcxxabi require.  The low
level APIs are the unw_* functions which are an interface defined by the the
old HP libunwind project (which shares no code with this unwinder).

llvm-svn: 192136

11 years ago[mips] Test case for r192124.
Akira Hatanaka [Mon, 7 Oct 2013 21:32:57 +0000 (21:32 +0000)]
[mips] Test case for r192124.

llvm-svn: 192135

11 years agoMark tests failing on FreeBSD after r191996
Ed Maste [Mon, 7 Oct 2013 21:25:48 +0000 (21:25 +0000)]
Mark tests failing on FreeBSD after r191996

llvm-svn: 192134

11 years agoLoopVectorize: External uses must use the last value in a reduction cycle
Arnold Schwaighofer [Mon, 7 Oct 2013 21:05:43 +0000 (21:05 +0000)]
LoopVectorize: External uses must use the last value in a reduction cycle

Otherwise, we don't perform operations that would have been performed on
the scalar version.

Fixes PR17498.

llvm-svn: 192133

11 years agoxfail for gcc tests due to pr17499 (regressions due to r191966).
Ashok Thirumurthi [Mon, 7 Oct 2013 21:00:29 +0000 (21:00 +0000)]
xfail for gcc tests due to pr17499 (regressions due to r191966).

llvm-svn: 192132

11 years agoRemove -ast-dump-xml.
Richard Smith [Mon, 7 Oct 2013 20:56:34 +0000 (20:56 +0000)]
Remove -ast-dump-xml.

llvm-svn: 192131

11 years agoAdd Mips16 patterns for sign extend byte and sign extend halfword.
Reed Kotler [Mon, 7 Oct 2013 20:46:19 +0000 (20:46 +0000)]
Add Mips16 patterns for sign extend byte and sign extend halfword.

llvm-svn: 192130

11 years agoObjectiveC migrator: A typical implementation of
Fariborz Jahanian [Mon, 7 Oct 2013 20:41:53 +0000 (20:41 +0000)]
ObjectiveC migrator: A typical implementation of
'default' methods in Foundation does not
infer 'instancetype' for methods' result type.
// rdar://15145218

llvm-svn: 192129

11 years agoAdd support for WG21 N3599 (literal operator template for strings) as a GNU
Richard Smith [Mon, 7 Oct 2013 19:57:58 +0000 (19:57 +0000)]
Add support for WG21 N3599 (literal operator template for strings) as a GNU
extension. The GCC folks have decided to support this even though the standard
committee have not yet approved this feature.

Patch by Hristo Venev!

llvm-svn: 192128

11 years agoObjectiveC modern rewriter. Rewrite typedefs
Fariborz Jahanian [Mon, 7 Oct 2013 19:54:22 +0000 (19:54 +0000)]
ObjectiveC modern rewriter. Rewrite typedefs
declared locally in ObjectiveC containers.
// rdar://15143875

llvm-svn: 192127

11 years agoStruct byval: use the correct alignment for loads generated to load
Manman Ren [Mon, 7 Oct 2013 19:47:53 +0000 (19:47 +0000)]
Struct byval: use the correct alignment for loads generated to load
from struct byval to registers.

We used to pass 0 which means the alignment of PtrVT. Even when the alignment
of the struct is smaller than 4, the LOADs would have alignment of 4, and
further optimizations could combine the LOADs into a ldm, which would
cause crash.

The fix is to pass the alignment of the struct byval.

rdar://problem/15144402

llvm-svn: 192126

11 years ago[mips] Coding style clean up.
Akira Hatanaka [Mon, 7 Oct 2013 19:33:02 +0000 (19:33 +0000)]
[mips] Coding style clean up.

llvm-svn: 192125

11 years ago[mips] Disable tail merging when long branch pass is enabled.
Akira Hatanaka [Mon, 7 Oct 2013 19:13:53 +0000 (19:13 +0000)]
[mips] Disable tail merging when long branch pass is enabled.

llvm-svn: 192124

11 years agoX86: Fix type check. Just because an integer type is illegal doesn't mean it's i64.
Benjamin Kramer [Mon, 7 Oct 2013 19:11:35 +0000 (19:11 +0000)]
X86: Fix type check. Just because an integer type is illegal doesn't mean it's i64.

Fixes PR17495, where an i24 triggered this code. It's intended to
optimize i64 loads on 32 bit x86.

llvm-svn: 192123

11 years ago[mips] Define method MipsSubtarget::enableLongBranchPass.
Akira Hatanaka [Mon, 7 Oct 2013 19:06:57 +0000 (19:06 +0000)]
[mips] Define method MipsSubtarget::enableLongBranchPass.

llvm-svn: 192122

11 years agoRevert r191834 until we measure the effect of this benchmarks and maybe find a better...
Alexey Samsonov [Mon, 7 Oct 2013 19:03:24 +0000 (19:03 +0000)]
Revert r191834 until we measure the effect of this benchmarks and maybe find a better way to fix it

llvm-svn: 192121

11 years agoFix objectsize tests after r192117
Matt Arsenault [Mon, 7 Oct 2013 19:00:18 +0000 (19:00 +0000)]
Fix objectsize tests after r192117

llvm-svn: 192120

11 years ago[mips] Fix definition of mfhi and mflo instructions to read from the whole
Akira Hatanaka [Mon, 7 Oct 2013 18:49:46 +0000 (18:49 +0000)]
[mips] Fix definition of mfhi and mflo instructions to read from the whole
accumulator instead of its sub-registers, $hi and $lo.

We need this change to prevent a mflo following a mtlo from reading an
unpredictable/undefined value, as shown in the following example:

mult $6, $7 // result of $6 * $7 is written to $lo and $hi.
mflo $2     // read lower 32-bit result from $lo.
mtlo $4     // write to $lo. the content of $hi becomes unpredictable.
mfhi $3     // read higher 32-bit from $hi, which has an unpredictable value.

I don't have a test case for this change that reliably reproduces the problem.

llvm-svn: 192119

11 years agoFormally added an explicit enum for DWARF TLS support. No functionality change.
Richard Mitton [Mon, 7 Oct 2013 18:39:18 +0000 (18:39 +0000)]
Formally added an explicit enum for DWARF TLS support. No functionality change.

llvm-svn: 192118

11 years agoChange objectsize intrinsic to accept different address spaces.
Matt Arsenault [Mon, 7 Oct 2013 18:06:48 +0000 (18:06 +0000)]
Change objectsize intrinsic to accept different address spaces.

Bitcasting everything to i8* won't work. Autoupgrade the old
intrinsic declarations to use the new mangling.

llvm-svn: 192117

11 years ago--raw was not always doing the right thing w.r.t. one-lining children. This checkin...
Enrico Granata [Mon, 7 Oct 2013 17:59:03 +0000 (17:59 +0000)]
--raw was not always doing the right thing w.r.t. one-lining children. This checkin fixes that

llvm-svn: 192116

11 years agoObjectiveC: Warn when 'readonly' property has explicit
Fariborz Jahanian [Mon, 7 Oct 2013 17:20:02 +0000 (17:20 +0000)]
ObjectiveC: Warn when 'readonly' property has explicit
ownership attribute (such as 'copy', 'assign' etc.)
// rdar://15131088

llvm-svn: 192115

11 years ago[analyzer] ArrayRef-ize BugReporter::EmitBasicReport.
Jordan Rose [Mon, 7 Oct 2013 17:16:59 +0000 (17:16 +0000)]
[analyzer] ArrayRef-ize BugReporter::EmitBasicReport.

No functionality change.

llvm-svn: 192114

11 years ago[analyzer] RetainCountChecker: add support for CFAutorelease.
Jordan Rose [Mon, 7 Oct 2013 17:16:52 +0000 (17:16 +0000)]
[analyzer] RetainCountChecker: add support for CFAutorelease.

<rdar://problems/13710586&13710643>

llvm-svn: 192113

11 years ago[AArch64] Add support for NEON scalar arithmetic instructions:
Chad Rosier [Mon, 7 Oct 2013 17:07:17 +0000 (17:07 +0000)]
[AArch64] Add support for NEON scalar arithmetic instructions:
SQDMULH, SQRDMULH, FMULX, FRECPS, and FRSQRTS.

llvm-svn: 192112

11 years ago[ARM] Improve build attributes emission.
Amara Emerson [Mon, 7 Oct 2013 16:55:23 +0000 (16:55 +0000)]
[ARM] Improve build attributes emission.

llvm-svn: 192111

11 years agouse -polly-codegen-isl in tests under test/Isl
Sebastian Pop [Mon, 7 Oct 2013 16:43:04 +0000 (16:43 +0000)]
use -polly-codegen-isl in tests under test/Isl

llvm-svn: 192110

11 years agodo not use -polly-cloog in a ScopInfo testcase
Sebastian Pop [Mon, 7 Oct 2013 16:43:00 +0000 (16:43 +0000)]
do not use -polly-cloog in a ScopInfo testcase

llvm-svn: 192109

11 years ago[libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.
Argyrios Kyrtzidis [Mon, 7 Oct 2013 16:38:40 +0000 (16:38 +0000)]
[libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.

llvm-svn: 192108

11 years ago[AArch64] Add support for NEON scalar arithmetic instructions:
Chad Rosier [Mon, 7 Oct 2013 16:36:15 +0000 (16:36 +0000)]
[AArch64] Add support for NEON scalar arithmetic instructions:
SQDMULH, SQRDMULH, FMULX, FRECPS, and FRSQRTS.

llvm-svn: 192107

11 years ago[ARMv8] Add some disassembly tests for Thumb sevl/sevl.w
Joey Gouly [Mon, 7 Oct 2013 16:13:03 +0000 (16:13 +0000)]
[ARMv8] Add some disassembly tests for Thumb sevl/sevl.w

llvm-svn: 192106

11 years agoUpdate clang-modernizer docs
Edwin Vane [Mon, 7 Oct 2013 15:56:25 +0000 (15:56 +0000)]
Update clang-modernizer docs

Summary: Docs updated to reflect new behaviour and new options.

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

llvm-svn: 192105

11 years agoRevert r191088, corresponding to r191823 to re-enable llvm-lto on cygming.
NAKAMURA Takumi [Mon, 7 Oct 2013 15:42:22 +0000 (15:42 +0000)]
Revert r191088, corresponding to r191823 to re-enable llvm-lto on cygming.

r191088 is "llvm/tools/Makefile: Suppress building llvm-lto on cygming, for now, probably due to LTO.dll."

llvm-svn: 192104

11 years agoWindows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is zero.
NAKAMURA Takumi [Mon, 7 Oct 2013 15:33:30 +0000 (15:33 +0000)]
Windows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is zero.

llvm-svn: 192103

11 years agoFix typo.
Rafael Espindola [Mon, 7 Oct 2013 13:57:59 +0000 (13:57 +0000)]
Fix typo.

Thanks to Sean Silva for noticing it.

llvm-svn: 192102

11 years agoRemove dead code.
Rafael Espindola [Mon, 7 Oct 2013 13:54:50 +0000 (13:54 +0000)]
Remove dead code.

Support for exception handling in the legacy JIT was removed in r181354 and
this code was dead since then.

Thanks to Yaron Keren for noticing it.

llvm-svn: 192101

11 years agoclang-modernize: Fixing doxygen warnings
Edwin Vane [Mon, 7 Oct 2013 13:40:19 +0000 (13:40 +0000)]
clang-modernize: Fixing doxygen warnings

llvm-svn: 192100

11 years agoRemove getEHExceptionRegister and getEHHandlerRegister.
Rafael Espindola [Mon, 7 Oct 2013 13:39:22 +0000 (13:39 +0000)]
Remove getEHExceptionRegister and getEHHandlerRegister.

They haven't been used for a long time. Patch by MathOnNapkins.

llvm-svn: 192099

11 years agoFix the documentation of getDefaultSubtargetFeatures.
Rafael Espindola [Mon, 7 Oct 2013 13:34:05 +0000 (13:34 +0000)]
Fix the documentation of getDefaultSubtargetFeatures.

Patch by David Nadlinger.

llvm-svn: 192098

11 years agoARM: allow cortex-m0 to use hint instructions
Tim Northover [Mon, 7 Oct 2013 11:10:47 +0000 (11:10 +0000)]
ARM: allow cortex-m0 to use hint instructions

The hint instructions ("nop", "yield", etc) are mostly Thumb2-only, but have
been ported across to the v6M architecture. Fortunately, v6M seems to sit
nicely between v6 (thumb-1 only) and v6T2, so we can add a feature for it
fairly easily.

rdar://problem/15144406

llvm-svn: 192097

11 years agoWindows: Be more explicit with Win32 APIs
David Majnemer [Mon, 7 Oct 2013 09:52:36 +0000 (09:52 +0000)]
Windows: Be more explicit with Win32 APIs

This addresses several issues in a similar vein:
 - Use the Unicode APIs when possible, running nm on clang shows that we
   only use Unicode APIs except for FormatMessage, CreateSemaphore, and
   GetModuleHandle.  AFAICT, the latter two are coming from MinGW and
   not LLVM itself.
 - Make getMainExecutable more resilient.  It previously considered
   return values of zero from ::GetModuleFileNameA to be acceptable.

llvm-svn: 192096

11 years agoSema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock...
NAKAMURA Takumi [Mon, 7 Oct 2013 09:32:50 +0000 (09:32 +0000)]
Sema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock, and IsLambda. [-Wunused-variable]

llvm-svn: 192095

11 years agoFix incorrect detection of class definitions with alignas specification.
Manuel Klimek [Mon, 7 Oct 2013 09:15:41 +0000 (09:15 +0000)]
Fix incorrect detection of class definitions with alignas specification.

llvm-svn: 192094

11 years ago[Mips] Teach llvm-readobj to print MIPS-specific ELF program headers.
Simon Atanasyan [Mon, 7 Oct 2013 08:58:27 +0000 (08:58 +0000)]
[Mips] Teach llvm-readobj to print MIPS-specific ELF program headers.

The patch reviewed by Michael Spencer.
http://llvm-reviews.chandlerc.com/D1846

llvm-svn: 192093

11 years agoWhen merging class definitions across modules in C++, merge together fields.
Richard Smith [Mon, 7 Oct 2013 08:02:11 +0000 (08:02 +0000)]
When merging class definitions across modules in C++, merge together fields.
This change doesn't go all the way to making fields redeclarable; instead, it
makes them 'mergeable', which means we can find the canonical declaration, but
not much else (and for a declaration that's not from a module, the canonical
declaration is always that declaration).

llvm-svn: 192092

11 years agoDriver: Use the canonical command line arguments.
David Majnemer [Mon, 7 Oct 2013 07:33:27 +0000 (07:33 +0000)]
Driver: Use the canonical command line arguments.

Summary:
Use the arguments given to the OS at process creation-time instead of
the arguments passed into main() by the C runtime environment.  The ones
that main() received may not be suitable (e.g. not Unicode).

Depends on D1834

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1835

llvm-svn: 192091

11 years agoRemove some instructions that seem to only exist to trick the filtering checks in...
Craig Topper [Mon, 7 Oct 2013 07:19:47 +0000 (07:19 +0000)]
Remove some instructions that seem to only exist to trick the filtering checks in the disassembler table creation. Just fix up the filter to let the real instruction through instead.

llvm-svn: 192090

11 years agoRemove FsMOVAPSrr and friends. They have no patterns and are no longer selected anywhere.
Craig Topper [Mon, 7 Oct 2013 06:10:45 +0000 (06:10 +0000)]
Remove FsMOVAPSrr and friends. They have no patterns and are no longer selected anywhere.

llvm-svn: 192089

11 years agoTeach X86 asm parser that VMOVAPSrr and other VEX-encoded register to register moves...
Craig Topper [Mon, 7 Oct 2013 05:42:48 +0000 (05:42 +0000)]
Teach X86 asm parser that VMOVAPSrr and other VEX-encoded register to register moves should be switched from using the MRMSrcReg form to the MRMDestReg form if the source register is a 64-bit extended register and the destination register is not.

This allows the instruction to be encoded using the 2-byte VEX form instead of the 3-byte VEX form. The GNU assembler has similar behavior and instruction selection already does this.

llvm-svn: 192088

11 years agoRefactor tryCaptureVar using ExtractMethod. No functionality change.
Faisal Vali [Mon, 7 Oct 2013 05:13:48 +0000 (05:13 +0000)]
Refactor tryCaptureVar using ExtractMethod.  No functionality change.

In chicago, Doug had requested that I go ahead and commit the refactor  as a separate change, if all the tests passed.

Lets hope the buildbots stay quiet.

Thanks!

llvm-svn: 192087

11 years agoAdd disassembler support for long encodings for INC/DEC in 32-bit mode.
Craig Topper [Mon, 7 Oct 2013 04:28:06 +0000 (04:28 +0000)]
Add disassembler support for long encodings for INC/DEC in 32-bit mode.

llvm-svn: 192086

11 years agoMarked issue 2284 as complete
Marshall Clow [Mon, 7 Oct 2013 03:26:42 +0000 (03:26 +0000)]
Marked issue 2284 as complete

llvm-svn: 192085

11 years ago[lld][Darwin] Fix unused field warning.
Shankar Easwaran [Mon, 7 Oct 2013 03:18:33 +0000 (03:18 +0000)]
[lld][Darwin] Fix unused field warning.

This field would eventually be used.

llvm-svn: 192084

11 years ago[lld][inputgraph] Fix build failure on Darwin/Windows
Shankar Easwaran [Mon, 7 Oct 2013 03:06:04 +0000 (03:06 +0000)]
[lld][inputgraph] Fix build failure on Darwin/Windows

llvm-svn: 192083

11 years ago[lld] Add FileArchive
Shankar Easwaran [Mon, 7 Oct 2013 02:55:42 +0000 (02:55 +0000)]
[lld] Add FileArchive

Fix adding a missed file in the previous commit.

llvm-svn: 192082

11 years ago[lld][InputGraph] Change the Resolver to use inputGraph
Shankar Easwaran [Mon, 7 Oct 2013 02:47:09 +0000 (02:47 +0000)]
[lld][InputGraph] Change the Resolver to use inputGraph

Changes :-

a) Functionality in InputGraph to insert Input elements at any position
b) Functionality in the Resolver to use nextFile
c) Move the functionality of assigning file ordinals to InputGraph
d) Changes all inputs to MemoryBuffers
e) Remove LinkerInput, InputFiles, ReaderArchive

llvm-svn: 192081

11 years agoApparently, I don't know the difference between 'left' and 'right'. Swap parameters...
Marshall Clow [Mon, 7 Oct 2013 02:37:18 +0000 (02:37 +0000)]
Apparently, I don't know the difference between 'left' and 'right'. Swap parameters named 'lhs' and 'rhs' so that they correctly refer to the 'left hand side' and 'right hand side' of comparisons. No functionality change. Thanks to Arthur O'Dwyer for pointing this out to me.

llvm-svn: 192080

11 years agoRevert "Revert "Windows: Add support for unicode command lines""
David Majnemer [Mon, 7 Oct 2013 01:00:07 +0000 (01:00 +0000)]
Revert "Revert "Windows: Add support for unicode command lines""

This reverts commit r192070 which reverted r192069, I forgot to
regenerate the configure scripts.

llvm-svn: 192079

11 years agoFix some assert messages to say the correct opcode name. Looks like one assert got...
Craig Topper [Sun, 6 Oct 2013 22:38:19 +0000 (22:38 +0000)]
Fix some assert messages to say the correct opcode name. Looks like one assert got copy and pasted to many places.

llvm-svn: 192078

11 years agoSilence the unused function warning in exception.cpp.
Peter Collingbourne [Sun, 6 Oct 2013 22:13:24 +0000 (22:13 +0000)]
Silence the unused function warning in exception.cpp.

Rather than try to protect the function behind a precise,
ever-changing #if expression, just inline it into every caller.

llvm-svn: 192077

11 years agoImplement std::exception_ptr under libsupc++.
Peter Collingbourne [Sun, 6 Oct 2013 22:13:21 +0000 (22:13 +0000)]
Implement std::exception_ptr under libsupc++.

libsupc++ does not implement the dependent EH ABI and the
functionality it uses to implement std::exception_ptr (which it
declares as an alias of std::__exception_ptr::exception_ptr) is not
directly exported to clients. So we have little choice but to hijack
std::__exception_ptr::exception_ptr's (which fortunately has the
same layout as our std::exception_ptr) copy constructor, assignment
operator and destructor (which are part of its stable ABI), and its
rethrow_exception(std::__exception_ptr::exception_ptr) function.

Also, remove some out of date comments.

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

llvm-svn: 192076

11 years agoMake it possible to link against libstdc++ as well as libsupc++ with CMake.
Peter Collingbourne [Sun, 6 Oct 2013 22:13:19 +0000 (22:13 +0000)]
Make it possible to link against libstdc++ as well as libsupc++ with CMake.

Linking against libstdc++, rather than libsupc++, is probably better
for people who need to link against clients of libstdc++.  Because
libsupc++ is provided only as a static library, its globals are not
shared between the static library and the copy linked into libstdc++.
This has been found to cause at least one test failure.

This also removes a number of symbols which were multiply defined
between libstdc++ and libc++, only when linking with libstdc++.

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

llvm-svn: 192075

11 years agoEliminate more symbols multiply defined between libsupc++ and libc++.
Peter Collingbourne [Sun, 6 Oct 2013 22:13:16 +0000 (22:13 +0000)]
Eliminate more symbols multiply defined between libsupc++ and libc++.

The remaining multiple definitions were flushed out by attempting to
link libsupc++ and libc++ into the same executable with --whole-archive,
e.g.

clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt

(The same technique was used to flush out multiple definitions in
libstdc++.)

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

llvm-svn: 192074

11 years agoG M: 1. It changes the temp file handling to use the template and the current directo...
Howard Hinnant [Sun, 6 Oct 2013 21:14:05 +0000 (21:14 +0000)]
G M: 1. It changes the temp file handling to use the template and the current directory for windows, matching how it works on other platforms.
2. It re-enables the temp file handling for mingw that regressed.

llvm-svn: 192073

11 years agoG M: Rename local variable from __except to avoid MSVC keyword clash.
Howard Hinnant [Sun, 6 Oct 2013 21:00:29 +0000 (21:00 +0000)]
G M: Rename local variable from __except to avoid MSVC keyword clash.

llvm-svn: 192072

11 years agoUse _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.
Howard Hinnant [Sun, 6 Oct 2013 20:53:24 +0000 (20:53 +0000)]
Use _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.

llvm-svn: 192071

11 years agoRevert "Windows: Add support for unicode command lines"
David Majnemer [Sun, 6 Oct 2013 20:44:34 +0000 (20:44 +0000)]
Revert "Windows: Add support for unicode command lines"

This is causing MinGW bots to fail.
This reverts commit r192069.

llvm-svn: 192070

11 years agoWindows: Add support for unicode command lines
David Majnemer [Sun, 6 Oct 2013 20:25:49 +0000 (20:25 +0000)]
Windows: Add support for unicode command lines

Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name.  Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.

This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
 - It doesn't work on cygwin.
 - It only work on MinGW with caveats and only then on certain versions.
 - We get to keep our entry point as main(). :)

N.B.  This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G.  clang spawning clang -cc1 would want to give it Unicode arguments.

Reviewers: aaron.ballman, Bigcheese, rnk, ruiu

Reviewed By: rnk

CC: llvm-commits, ygao
Differential Revision: http://llvm-reviews.chandlerc.com/D1834

llvm-svn: 192069

11 years agoYaron Keren: Add missing comment.
Howard Hinnant [Sun, 6 Oct 2013 19:48:40 +0000 (19:48 +0000)]
Yaron Keren:  Add missing comment.

llvm-svn: 192068

11 years agoFix PR17382 - properly group virtual method overloads in the vftable
Timur Iskhodzhanov [Sun, 6 Oct 2013 15:31:37 +0000 (15:31 +0000)]
Fix PR17382 - properly group virtual method overloads in the vftable

llvm-svn: 192067

11 years agoAdd support for aliases with linkonce_odr.
Rafael Espindola [Sun, 6 Oct 2013 15:10:43 +0000 (15:10 +0000)]
Add support for aliases with linkonce_odr.

This will be used to extend constructor aliases in clang.

llvm-svn: 192066

11 years agoForce a CPU that doesn't have AVX, otherwise this test fails.
Benjamin Kramer [Sun, 6 Oct 2013 13:52:41 +0000 (13:52 +0000)]
Force a CPU that doesn't have AVX, otherwise this test fails.

llvm-svn: 192065

11 years agoX86: Don't fold spills into SSE operations if the stack is unaligned.
Benjamin Kramer [Sun, 6 Oct 2013 13:48:22 +0000 (13:48 +0000)]
X86: Don't fold spills into SSE operations if the stack is unaligned.

Regalloc can emit unaligned spills nowadays, but we can't fold the
spills into SSE ops if we can't guarantee alignment. PR12250.

llvm-svn: 192064

11 years agoAVX-512: added scalar convert instructions and intrinsics.
Elena Demikhovsky [Sun, 6 Oct 2013 13:11:09 +0000 (13:11 +0000)]
AVX-512: added scalar convert instructions and intrinsics.
Fixed load folding in VPERM2I instruction.

llvm-svn: 192063

11 years agoclang-format: Remove empty lines after visibility modifiers.
Daniel Jasper [Sun, 6 Oct 2013 11:40:08 +0000 (11:40 +0000)]
clang-format: Remove empty lines after visibility modifiers.

Formatting:
  class C {
  public:

    f();
  };

Now leads to:
  class C {
  public:
    f();
  };

llvm-svn: 192062

11 years agoremove a dead assignment. The variables are set just right after. Found by scan-build...
Sylvestre Ledru [Sun, 6 Oct 2013 09:54:18 +0000 (09:54 +0000)]
remove a dead assignment. The variables are set just right after. Found by scan-build buildd-clang.debian.net/scan-build/

llvm-svn: 192061

11 years agoValue stored to 'pid' was never read. Found by scan-build http://buildd-clang.debian...
Sylvestre Ledru [Sun, 6 Oct 2013 09:51:02 +0000 (09:51 +0000)]
Value stored to 'pid' was never read. Found by scan-build buildd-clang.debian.net/scan-build/

llvm-svn: 192060

11 years ago[Mips] Add MIPS program header types.
Simon Atanasyan [Sun, 6 Oct 2013 08:49:41 +0000 (08:49 +0000)]
[Mips] Add MIPS program header types.

llvm-svn: 192059

11 years agoLWG Issue 2247
Marshall Clow [Sun, 6 Oct 2013 07:19:23 +0000 (07:19 +0000)]
LWG Issue 2247

llvm-svn: 192058

11 years agoUpdated status post-Chicago
Marshall Clow [Sun, 6 Oct 2013 07:10:55 +0000 (07:10 +0000)]
Updated status post-Chicago

llvm-svn: 192057

11 years ago[Sparc] Do not emit nop after fcmp* instruction with V9.
Venkatraman Govindaraju [Sun, 6 Oct 2013 07:06:44 +0000 (07:06 +0000)]
[Sparc] Do not emit nop after fcmp* instruction with V9.

llvm-svn: 192056

11 years agoAVX-512: fixed shuffle lowering
Elena Demikhovsky [Sun, 6 Oct 2013 06:11:18 +0000 (06:11 +0000)]
AVX-512: fixed shuffle lowering
in case of BLEND and added VSHUFPS patterns.

llvm-svn: 192055

11 years ago[Sparc] Custom lower addc/adde/subc/sube on i64 in sparc64.
Venkatraman Govindaraju [Sun, 6 Oct 2013 03:36:18 +0000 (03:36 +0000)]
[Sparc] Custom lower addc/adde/subc/sube on i64 in sparc64.
This is required because i64 is a legal type but addxcc/subxcc reads icc carry bit, which are 32 bit conditional codes.

llvm-svn: 192054

11 years ago[Sparc] Use addxcc/subxcc for adde/sube instead of addx/subx.
Venkatraman Govindaraju [Sun, 6 Oct 2013 02:11:10 +0000 (02:11 +0000)]
[Sparc] Use addxcc/subxcc for adde/sube instead of addx/subx.
addx/subx does not modify conditional codes whereas addxcc/subxx does.

llvm-svn: 192053

11 years agoPass CGCXXABIs around directly.
Mark Lacey [Sun, 6 Oct 2013 01:33:34 +0000 (01:33 +0000)]
Pass CGCXXABIs around directly.

In functions that only need to use the CGCXXABI member of a CodeGenTypes
class, pass that reference around directly rather than a reference to
a CodeGenTypes class.

This makes the actual dependence on CGCXXABI clear at the call sites.

llvm-svn: 192052

11 years agoAdd tests making sure that optional<T>s can be compared at compile time; this functio...
Marshall Clow [Sat, 5 Oct 2013 23:29:16 +0000 (23:29 +0000)]
Add tests making sure that optional<T>s can be compared at compile time; this functionality was enabled by N3789

llvm-svn: 192051

11 years agoSwitching the CallableWhen attribute over to using the string literal helper function...
Aaron Ballman [Sat, 5 Oct 2013 22:45:34 +0000 (22:45 +0000)]
Switching the CallableWhen attribute over to using the string literal helper function instead of custom logic.

llvm-svn: 192050

11 years agoLWG Issue 2247: Implement type trait 'is_null_pointer'
Marshall Clow [Sat, 5 Oct 2013 21:21:17 +0000 (21:21 +0000)]
LWG Issue 2247: Implement type trait 'is_null_pointer'

llvm-svn: 192049

11 years agoImplement literal suffixes for compled
Marshall Clow [Sat, 5 Oct 2013 21:19:49 +0000 (21:19 +0000)]
Implement literal suffixes for compled

llvm-svn: 192048

11 years agoMark namespaces for user defined literals as 'inline'
Marshall Clow [Sat, 5 Oct 2013 21:18:32 +0000 (21:18 +0000)]
Mark namespaces for user defined literals as 'inline'

llvm-svn: 192047

11 years agoAdd TBM instructions to loading folding tables.
Craig Topper [Sat, 5 Oct 2013 20:20:51 +0000 (20:20 +0000)]
Add TBM instructions to loading folding tables.

llvm-svn: 192046

11 years agoAdd support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
Nick Lewycky [Sat, 5 Oct 2013 20:14:27 +0000 (20:14 +0000)]
Add support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
it is enabled. Also enable it on the same architectures that GCC does.

llvm-svn: 192045

11 years agoRename this feature to "cx16" to match gcc's flag name. Apparently these strings
Nick Lewycky [Sat, 5 Oct 2013 20:11:44 +0000 (20:11 +0000)]
Rename this feature to "cx16" to match gcc's flag name. Apparently these strings
are directly tied to the flag names in clang with no remapping in between?

llvm-svn: 192044

11 years agoSilencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.
Aaron Ballman [Sat, 5 Oct 2013 19:56:07 +0000 (19:56 +0000)]
Silencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.

llvm-svn: 192043

11 years agoSilencing an MSVC warning.
Aaron Ballman [Sat, 5 Oct 2013 19:41:41 +0000 (19:41 +0000)]
Silencing an MSVC warning.

llvm-svn: 192042

11 years agoEmit a better error when running out of registers on inline asm.
Benjamin Kramer [Sat, 5 Oct 2013 19:33:37 +0000 (19:33 +0000)]
Emit a better error when running out of registers on inline asm.

The most likely case where this error happens is when the user specifies
too many register operands. Don't make it look like an internal LLVM bug
when we can see that the error is coming from an inline asm instruction.
For other instructions we keep the "ran out of registers" error.

llvm-svn: 192041

11 years agoRemove underscores from TBM instruction names for consistency with other instruction...
Craig Topper [Sat, 5 Oct 2013 19:27:26 +0000 (19:27 +0000)]
Remove underscores from TBM instruction names for consistency with other instruction naming.

llvm-svn: 192040