platform/upstream/llvm.git
11 years agoFix linkage calculation of auto member functions returning lambdas
Faisal Vali [Tue, 8 Oct 2013 04:15:04 +0000 (04:15 +0000)]
Fix linkage calculation of auto member functions returning lambdas

As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ

we should allow:

template<typename S>
struct A {

template<typename T> static auto default_lambda() {
  return [](const T&) { return 42; };
}

template<class U = decltype(default_lambda<S>())>
  U func(U u = default_lambda<S>()) { return u; }

};

int run2 = A<double>{}.func()(3.14);

int run3 = A<char>{}.func()('a');

This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.

Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.

llvm-svn: 192166

11 years agoUse size_t instead of uint64_t to represent the vector length.
Rui Ueyama [Tue, 8 Oct 2013 03:59:50 +0000 (03:59 +0000)]
Use size_t instead of uint64_t to represent the vector length.

llvm-svn: 192165

11 years agoRemove an unnecessary local variable.
Rui Ueyama [Tue, 8 Oct 2013 03:59:48 +0000 (03:59 +0000)]
Remove an unnecessary local variable.

llvm-svn: 192164

11 years agoMake bitmask an unsigned type.
Rui Ueyama [Tue, 8 Oct 2013 03:59:45 +0000 (03:59 +0000)]
Make bitmask an unsigned type.

llvm-svn: 192163

11 years agoExpand auto for readability.
Rui Ueyama [Tue, 8 Oct 2013 03:59:42 +0000 (03:59 +0000)]
Expand auto for readability.

llvm-svn: 192162

11 years agoAdd entries for arm6m to ArchSpec's g_macho_arch_entries.
Jason Molenda [Tue, 8 Oct 2013 03:01:08 +0000 (03:01 +0000)]
Add entries for arm6m to ArchSpec's g_macho_arch_entries.
<rdar://problem/15099306>

llvm-svn: 192161

11 years ago[Sparc] Do not hardcode nop in the delay slot of TLS_CALL. Use DelaySlotFiller to...
Venkatraman Govindaraju [Tue, 8 Oct 2013 02:50:29 +0000 (02:50 +0000)]
[Sparc] Do not hardcode nop in the delay slot of TLS_CALL. Use DelaySlotFiller to fill the delay slot instead.

llvm-svn: 192160

11 years agoClarify how to handle a thread register context with a gap
Jason Molenda [Tue, 8 Oct 2013 02:42:39 +0000 (02:42 +0000)]
Clarify how to handle a thread register context with a gap
in the middle because of alignment rules.

llvm-svn: 192159

11 years agotypo.
Adrian Prantl [Tue, 8 Oct 2013 02:30:54 +0000 (02:30 +0000)]
typo.

llvm-svn: 192158

11 years agotypo.
Adrian Prantl [Tue, 8 Oct 2013 02:28:20 +0000 (02:28 +0000)]
typo.

llvm-svn: 192157

11 years agoReduce testcase from 1r92011.
Adrian Prantl [Tue, 8 Oct 2013 02:21:44 +0000 (02:21 +0000)]
Reduce testcase from 1r92011.

llvm-svn: 192156

11 years agoFix build break: clang no longer supports -ast-dump-xml.
Richard Smith [Tue, 8 Oct 2013 02:19:45 +0000 (02:19 +0000)]
Fix build break: clang no longer supports -ast-dump-xml.

llvm-svn: 192155

11 years agofix typos
Nick Kledzik [Tue, 8 Oct 2013 02:07:19 +0000 (02:07 +0000)]
fix typos

llvm-svn: 192154

11 years agofix all EXPECT_EQ(.address) tests
Nick Kledzik [Tue, 8 Oct 2013 01:27:03 +0000 (01:27 +0000)]
fix all EXPECT_EQ(.address) tests

llvm-svn: 192153

11 years agofix test case failing on bot
Nick Kledzik [Tue, 8 Oct 2013 01:12:35 +0000 (01:12 +0000)]
fix test case failing on bot

llvm-svn: 192152

11 years agoupdate mach-o EXPORT_SYMBOL_* names
Nick Kledzik [Tue, 8 Oct 2013 00:59:13 +0000 (00:59 +0000)]
update mach-o EXPORT_SYMBOL_* names

llvm-svn: 192151

11 years ago[ms-cxxabi] Fix the calling convention for operator new in records
Reid Kleckner [Tue, 8 Oct 2013 00:58:57 +0000 (00:58 +0000)]
[ms-cxxabi] Fix the calling convention for operator new in records

Summary:
Operator new, new[], delete, and delete[] are all implicitly static when
declared inside a record.  CXXMethodDecl already knows this, but we need
to account for that before we pick the calling convention for the
function type.

Fixes PR17371.

Reviewers: rsmith

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

llvm-svn: 192150

11 years agoAdd comments. Early return.
Rui Ueyama [Tue, 8 Oct 2013 00:43:53 +0000 (00:43 +0000)]
Add comments. Early return.

llvm-svn: 192149

11 years agoConvert error code structs to scoped enums.
Rui Ueyama [Tue, 8 Oct 2013 00:43:50 +0000 (00:43 +0000)]
Convert error code structs to scoped enums.

Summary:
The original code with enum "_" is intended to emulate scoped enums.
Now we have real scoped enums, so use it.

Reviewers: Bigcheese

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

llvm-svn: 192148

11 years agoSupoort mach-o encoded in yaml.
Nick Kledzik [Tue, 8 Oct 2013 00:43:34 +0000 (00:43 +0000)]
Supoort mach-o encoded in yaml.

This is the first step in how I plan to get mach-o object files support into
lld. We need to be able to test the mach-o Reader and Write on systems without
a mach-o tools. Therefore, we want to support a textual way (YAML) to represent
mach-o files.

MachONormalizedFile.h defines an in-memory abstraction of the content of mach-o
files. The in-memory data structures are always native endianess and always
use 64-bit sizes. That internal data structure can then be converted to or
from three different formats: 1) yaml (text) encoded mach-o, 2) binary mach-o
files, 3) lld Atoms.

This patch defines the internal model and uses YAML I/O to implement the
conversion to and from the model to yaml. The next patch will implement
the conversion from normalized to binary mach-o.

This patch includes unit tests to validate the yaml conversion APIs.

llvm-svn: 192147

11 years agoSema: Only merge typedef attributes if the previous decl is a typedef
Justin Bogner [Tue, 8 Oct 2013 00:19:09 +0000 (00:19 +0000)]
Sema: Only merge typedef attributes if the previous decl is a typedef

In r186373, we started merging attributes on typedefs, but this causes
us to try to merge attributes even if the previous declaration was not
a typedef.

Only merge the attributes if the previous decl was also a typedef.

Fixes rdar://problem/15044218

llvm-svn: 192146

11 years agoTBAA: use the same format for scalar TBAA and struct-path aware TBAA.
Manman Ren [Tue, 8 Oct 2013 00:08:49 +0000 (00:08 +0000)]
TBAA: use the same format for scalar TBAA and struct-path aware TBAA.

An updated version of r191586 with bug fix.

Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.

We should not generate a TBAA tag with null being the first field. When
a TBAA type node is null, the tag should be null too. Make sure we
don't decorate an instruction with a null TBAA tag.

Added a testing case for the bug reported by Richard with -relaxed-aliasing
and -fsanitizer=thread.

llvm-svn: 192145

11 years agoSplit test to test -Wshadow with emmintrin.h more portable.
Ted Kremenek [Tue, 8 Oct 2013 00:03:41 +0000 (00:03 +0000)]
Split test to test -Wshadow with emmintrin.h more portable.

llvm-svn: 192144

11 years agoSuppress useless -Wshadow warning when using _mm* macros from emmintrin.h
Ted Kremenek [Mon, 7 Oct 2013 23:51:11 +0000 (23:51 +0000)]
Suppress useless -Wshadow warning when using _mm* macros from emmintrin.h

Fixes <rdar://problem/10679282>.

I'm not completely satisfied with this patch.  Sprinkling "diagnostic ignored"
_Pragmas throughout this file is gross, but I couldn't suppress
it for the entire file.

llvm-svn: 192143

11 years agoFix LWG Issue 2141: common_type trait produces reference types
Marshall Clow [Mon, 7 Oct 2013 23:43:33 +0000 (23:43 +0000)]
Fix LWG Issue 2141: common_type trait produces reference types

llvm-svn: 192142

11 years agoclang-cl: Accept and mostly ignore /vm*, /GF, /GF-, /Zm, and /bigobj
Reid Kleckner [Mon, 7 Oct 2013 23:19:01 +0000 (23:19 +0000)]
clang-cl: Accept and mostly ignore /vm*, /GF, /GF-, /Zm, and /bigobj

Patch by David Ziman!

llvm-svn: 192141

11 years agoAdd a triple to unbreak buildbots where size_t is not 'unsigned long'.
Richard Smith [Mon, 7 Oct 2013 22:58:25 +0000 (22:58 +0000)]
Add a triple to unbreak buildbots where size_t is not 'unsigned long'.

llvm-svn: 192140

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