platform/upstream/llvm.git
9 years agoEmit warning if define or undef reserved identifier or keyword.
Serge Pavlov [Tue, 2 Dec 2014 11:06:09 +0000 (11:06 +0000)]
Emit warning if define or undef reserved identifier or keyword.

Summary:
This change implements warnings if macro name is identical to a keyword or
reserved identifier. The warnings are different depending on the "danger"
of the operation. Defining macro that replaces a keyword is on by default.
Other cases produce warning that is off by default but can be turned on
using option -Wreserved-id-macro.

This change fixes PR11488.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

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

llvm-svn: 223114

9 years agoAdd support for ARM modified-immediate assembly syntax.
Asiri Rathnayake [Tue, 2 Dec 2014 10:53:20 +0000 (10:53 +0000)]
Add support for ARM modified-immediate assembly syntax.

Certain ARM instructions accept 32-bit immediate operands encoded as a 8-bit
integer value (0-255) and a 4-bit rotation (0-30, even). Current ARM assembly
syntax support in LLVM allows the decoded (32-bit) immediate to be specified
as a single immediate operand for such instructions:

mov r0, #4278190080

The ARMARM defines an extended assembly syntax allowing the encoding to be made
more explicit, as in:

mov r0, #255, #8 ; (same 32-bit value as above)

The behaviour of the two instructions can be different w.r.t flags, which is
documented under "Modified immediate constants" in ARMARM. This patch enables
support for this extended syntax at the MC layer.

llvm-svn: 223113

9 years agoAdd ARM relocations to ELFYAML
Will Newton [Tue, 2 Dec 2014 09:49:09 +0000 (09:49 +0000)]
Add ARM relocations to ELFYAML

Tested with check-all with no regressions.

llvm-svn: 223112

9 years agoclang-format: precedence-based indentation when breaking before operators.
Daniel Jasper [Tue, 2 Dec 2014 09:46:56 +0000 (09:46 +0000)]
clang-format: precedence-based indentation when breaking before operators.

Before:
  bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                  + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
               && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  > ccccccccccccccccccccccccccccccccccccccccc;

After:
  bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                       + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                       + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                   == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                              * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                          + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
               && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                          * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                      > ccccccccccccccccccccccccccccccccccccccccc;

Not particularly pretty, but can probably help to uncover bugs. And if this
bugs somebody, parentheses can help.

llvm-svn: 223111

9 years agoEmit Tag_ABI_FP_denormal correctly in fast-math mode.
Charlie Turner [Tue, 2 Dec 2014 08:22:29 +0000 (08:22 +0000)]
Emit Tag_ABI_FP_denormal correctly in fast-math mode.

The default ARM floating-point mode does not support IEEE 754 mode exactly. Of
relevance to this patch is that input denormals are flushed to zero. The way in
which they're flushed to zero depends on the architecture,

  * For VFPv2, it is implementation defined as to whether the sign of zero is
    preserved.
  * For VFPv3 and above, the sign of zero is always preserved when a denormal
    is flushed to zero.

When FP support has been disabled, the strategy taken by this patch is to
assume the software support will mirror the behaviour of the hardware support
for the target *if it existed*. That is, for architectures which can only have
VFPv2, it is assumed the software will flush to positive zero. For later
architectures it is assumed the software will flush to zero preserving sign.

Change-Id: Icc5928633ba222a4ba3ca8c0df44a440445865fd
llvm-svn: 223110

9 years ago[signext.ll] Removal Of Duplicate Test Cases
Sonam Kumari [Tue, 2 Dec 2014 05:29:47 +0000 (05:29 +0000)]
[signext.ll] Removal Of Duplicate Test Cases

Removed the duplicate test case existing in signext.ll file.

llvm-svn: 223109

9 years agoRe-apply "Revert r166370 and r166540 now that Xcode 4.6 has been available for a...
Bob Wilson [Tue, 2 Dec 2014 05:17:21 +0000 (05:17 +0000)]
Re-apply "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while."

This reverts commit r176892.

I had reverted this a while back to give Chromium more time to update, and
Nico says it should be OK now.

llvm-svn: 223108

9 years agoclang/test/Modules/malformed.cpp REQUIRES shell due to "cd".
NAKAMURA Takumi [Tue, 2 Dec 2014 03:55:16 +0000 (03:55 +0000)]
clang/test/Modules/malformed.cpp REQUIRES shell due to "cd".

llvm-svn: 223107

9 years agoCMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268)
Hans Wennborg [Tue, 2 Dec 2014 03:08:38 +0000 (03:08 +0000)]
CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268)

If the output of 'ld -v' didn't match the regexes, CMake would previously error
with a message like:

  CMake Error at tools/clang/CMakeLists.txt:269 (string):
    string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
    an empty string.

llvm-svn: 223106

9 years agoTry to fix the MSVC build.
Hans Wennborg [Tue, 2 Dec 2014 02:13:09 +0000 (02:13 +0000)]
Try to fix the MSVC build.

llvm-svn: 223105

9 years ago[mach-o] Fix TrieEdge leak
Nick Kledzik [Tue, 2 Dec 2014 01:50:44 +0000 (01:50 +0000)]
[mach-o] Fix TrieEdge leak

In PR21682 Jean-Daliel Dupas found a leak in the trie builder and suggested
a fix was to use a list instead of SmallVector so that the list elements
could be allocated in the BumpPtrAllocator.

llvm-svn: 223104

9 years ago[mach-o] add support for arm64 compact unwind info
Nick Kledzik [Tue, 2 Dec 2014 01:50:38 +0000 (01:50 +0000)]
[mach-o] add support for arm64 compact unwind info

Tim previously added generic compact unwind processing and x86_64 support.
This patch adds arm64 support.

llvm-svn: 223103

9 years agoRely on fewer features of the 'env' command. Darwin only supports '-i'.
Chandler Carruth [Tue, 2 Dec 2014 01:24:52 +0000 (01:24 +0000)]
Rely on fewer features of the 'env' command. Darwin only supports '-i'.
I'm explicitly setting LC_ALL=C somewhat for documentation, but
hopefully this also removes some host variation from the test results.

llvm-svn: 223102

9 years agoFix variable used only in assertion.
Nick Lewycky [Tue, 2 Dec 2014 01:09:56 +0000 (01:09 +0000)]
Fix variable used only in assertion.

llvm-svn: 223101

9 years agoAdd a test that ensures the Clang driver behaves itself when the PATH
Chandler Carruth [Tue, 2 Dec 2014 00:53:20 +0000 (00:53 +0000)]
Add a test that ensures the Clang driver behaves itself when the PATH
environment variable is changed to strange things out from under it.
Prior to r223099 in LLVM, these test cases would crash in various ways
(assert fails, stack exhaustion, etc.).

llvm-svn: 223100

9 years agoFix several bugs in r221220's new program finding code.
Chandler Carruth [Tue, 2 Dec 2014 00:52:01 +0000 (00:52 +0000)]
Fix several bugs in r221220's new program finding code.

In both the Unix and Windows variants, std::getenv was called and the
result passed directly to a function accepting a StringRef. This isn't
OK because it might return a null pointer and that causes the StringRef
constructor to assert (and generally produces crash-prone code if
asserts are disabled). Fix this by independently testing the result as
non-null prior to splitting things.

This in turn uncovered another bug in the Unix variant where it would
infinitely recurse if PATH="", or after this fix if PATH isn't set.
There is no need to recurse at all. Slightly re-arrange the code to make
it clear that we can just fixup the Paths argument based on the
environment if we find anything.

I don't know of a particularly useful way to test these routines in
LLVM. I'll commit a test to Clang that ensures that its driver correctly
handles various settings of PATH. However, I have no idea how to
correctly write a Windows test for the PATHEXT change. Any Windows
developers who could provide such a test, please have at. =D

Many thanks to Nick Lewycky and others for helping debug this. =/ It was
quite nasty for us to track down.

llvm-svn: 223099

9 years agoUpdate and simplify to match Clang r223095.
Richard Smith [Tue, 2 Dec 2014 00:32:02 +0000 (00:32 +0000)]
Update and simplify to match Clang r223095.

llvm-svn: 223098

9 years agoRemove special case for aarch64 static vs. PIC code in iOS kernel code.
Bob Wilson [Tue, 2 Dec 2014 00:27:35 +0000 (00:27 +0000)]
Remove special case for aarch64 static vs. PIC code in iOS kernel code.

I added this check a while back but then made a note to myself that it
should be completely unnecessary since iOS always uses PIC code-gen for
aarch64. Since I could never come up with any reason why it would be
necessary, I'm just going to remove it and we'll see if anything breaks.
rdar://problem/13627985

llvm-svn: 223097

9 years agoFix the behavior of ${current-pc-arrow} in the default disassembly
Jason Molenda [Tue, 2 Dec 2014 00:26:21 +0000 (00:26 +0000)]
Fix the behavior of ${current-pc-arrow} in the default disassembly
format for the not-current-stack-frame.  This was causing
test/functionalities/inferior-assert to fail.

Also document the new additions to the format specifications used
in the disassembly-format changes to formats.html.

<rdar://problem/19102757>

llvm-svn: 223096

9 years ago[modules] Track how 'header' directives were written in module map files,
Richard Smith [Tue, 2 Dec 2014 00:08:08 +0000 (00:08 +0000)]
[modules] Track how 'header' directives were written in module map files,
rather than trying to extract this information from the FileEntry after the
fact.

This has a number of beneficial effects. For instance, diagnostic messages for
failed module builds give a path relative to the "module root" rather than an
absolute file path, and the contents of the module includes file is no longer
dependent on what files the including TU happened to inspect prior to
triggering the module build.

llvm-svn: 223095

9 years agoAdd override specifiers to Symbolizer methods. NFC.
Alexey Samsonov [Mon, 1 Dec 2014 23:47:51 +0000 (23:47 +0000)]
Add override specifiers to Symbolizer methods. NFC.

llvm-svn: 223094

9 years agoSimplify pointer comparisons involving memory allocation functions
Hal Finkel [Mon, 1 Dec 2014 23:38:06 +0000 (23:38 +0000)]
Simplify pointer comparisons involving memory allocation functions

System memory allocation functions, which are identified at the IR level by the
noalias attribute on the return value, must return a pointer into a memory region
disjoint from any other memory accessible to the caller. We can use this
property to simplify pointer comparisons between allocated memory and local
stack addresses and the addresses of global variables. Neither the stack nor
global variables can overlap with the region used by the memory allocator.

Fixes PR21556.

llvm-svn: 223093

9 years agoTry to fix a bot failure due to a variable used only in an assert.
Philip Reames [Mon, 1 Dec 2014 23:27:45 +0000 (23:27 +0000)]
Try to fix a bot failure due to a variable used only in an assert.

Specifically, bot lld-x86_64-darwin13.  Resulting from change 223085.

llvm-svn: 223092

9 years agoFix several test failures on Linux/FreeBSD caused by compiler configuration and inval...
Oleksiy Vyalov [Mon, 1 Dec 2014 23:21:18 +0000 (23:21 +0000)]
Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms.
http://reviews.llvm.org/D6392

llvm-svn: 223091

9 years agoPerform correct lookup when '__super' is used in class with dependent base.
Nikola Smiljanic [Mon, 1 Dec 2014 23:15:01 +0000 (23:15 +0000)]
Perform correct lookup when '__super' is used in class with dependent base.

llvm-svn: 223090

9 years agoEnable enabling and disabling breakpoints on Windows.
Zachary Turner [Mon, 1 Dec 2014 23:13:52 +0000 (23:13 +0000)]
Enable enabling and disabling breakpoints on Windows.

llvm-svn: 223089

9 years agoLink test executables with LLD on Windows.
Zachary Turner [Mon, 1 Dec 2014 23:13:41 +0000 (23:13 +0000)]
Link test executables with LLD on Windows.

Clang generates DWARF debug info with section names longer
than 8 characters.  This is only supported by an extension
to PE/COFF which the MSVC linker doesn't implement.  So
trying to link DWARF-enabled object files with MSVC will
lead to corrupt debug information in the executable.

llvm-svn: 223088

9 years agoOnly normalize FileSpec paths *after* resolving them.
Zachary Turner [Mon, 1 Dec 2014 23:13:32 +0000 (23:13 +0000)]
Only normalize FileSpec paths *after* resolving them.

Normalizing paths before resolving them can cause the path to
become denormalized after resolution.

llvm-svn: 223087

9 years agoMake -fuse-ld=lld work properly on Windows.
Zachary Turner [Mon, 1 Dec 2014 23:06:47 +0000 (23:06 +0000)]
Make -fuse-ld=lld work properly on Windows.

Using lld on Windows requires calling link-lld.exe instead of
lld.exe.  This patch puts this knowledge into clang so that when
using the GCC style clang driver, it can properly delegate to
lld.

Differential Revision: http://reviews.llvm.org/D6428
Reviewed by: Reid Kleckner, Rui Ueyama

llvm-svn: 223086

9 years ago[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend
Philip Reames [Mon, 1 Dec 2014 22:52:56 +0000 (22:52 +0000)]
[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend

This is the second patch in a small series.  This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints.  It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code.  I will be submitting the SelectionDAG parts within the next 24-48 hours.  Since those pieces are by far the most complicated, I wanted to minimize the size of that patch.  That patch will include the tests which exercise the functionality in this patch.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.

The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots.  The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes.  The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT.  (Doing so would break relocation semantics for collectors which wish to relocate roots.)

The implementation of STATEPOINT is closely modeled on PATCHPOINT.  Eventually, much of the code in this patch will be removed.  The long term plan is to merge the functionality provided by statepoints and patchpoints.  Merging their implementations in the backend is likely to be a good starting point.

Reviewed by: atrick, ributzka

llvm-svn: 223085

9 years agoThe register keyword is deprecated in C++11, so clang complains strongly about swig...
Enrico Granata [Mon, 1 Dec 2014 22:51:03 +0000 (22:51 +0000)]
The register keyword is deprecated in C++11, so clang complains strongly about swig generating register declarations. Abuse the preprocessor to define the keyword away

llvm-svn: 223084

9 years agolldb can deadlock when launched with an non-existing executable:
Greg Clayton [Mon, 1 Dec 2014 22:41:27 +0000 (22:41 +0000)]
lldb can deadlock when launched with an non-existing executable:

% lldb /bin/nonono
(lldb) target create "/bin/nonono"
error: unable to find executable for '/usr/bin/nonono'
<deadlock>

The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with:

void
CommandInterpreter::RunCommandInterpreter(bool auto_handle_events,
                                          bool spawn_thread,
                                          CommandInterpreterRunOptions &options)
{
    // Always re-create the command intepreter when we run it in case
    // any file handles have changed.
    bool force_create = true;
    m_debugger.PushIOHandler(GetIOHandler(force_create, &options));
    m_stopped_for_crash = false;

    if (auto_handle_events)
        m_debugger.StartEventHandlerThread();

    if (spawn_thread)
    {
        m_debugger.StartIOHandlerThread();
    }
    else
    {
        m_debugger.ExecuteIOHanders();

        if (auto_handle_events)
            m_debugger.StopEventHandlerThread();
    }

}

If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute:

m_debugger.StartEventHandlerThread();
m_debugger.ExecuteIOHanders();
m_debugger.StopEventHandlerThread();

The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do:

void
Debugger::StopEventHandlerThread()
{
    if (m_event_handler_thread.IsJoinable())
    {
        GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived);
        m_event_handler_thread.Join(nullptr);
    }
}

The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet.

The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition.

This fixes radar:

<rdar://problem/19041192>

llvm-svn: 223083

9 years agoAdded a new regular expression to the "_regexp-break" command ("b" by default):
Greg Clayton [Mon, 1 Dec 2014 22:34:03 +0000 (22:34 +0000)]
Added a new regular expression to the "_regexp-break" command ("b" by default):

(lldb) b /break here/

This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be:

(lldb) breakpoint set --source-pattern-regexp 'break here'

llvm-svn: 223082

9 years agoAdded StringExtractor::DecodeHexU8 && GetHexBytesAvail
Vince Harron [Mon, 1 Dec 2014 22:19:33 +0000 (22:19 +0000)]
Added StringExtractor::DecodeHexU8 && GetHexBytesAvail

DecodeHexU8 returns a decoded hex character pair, returns -1 if a
valid hex pair is not available.

GetHexBytesAvail decodes all available hex pairs.

llvm-svn: 223081

9 years agoStringExtractor unit tests
Vince Harron [Mon, 1 Dec 2014 22:10:15 +0000 (22:10 +0000)]
StringExtractor unit tests

Unit tests to cover StringExtractor in advance of minor new
functionality & minor refactor

llvm-svn: 223080

9 years agoUse nullptr to silence -Wsentinel when self-hosting on Windows
Reid Kleckner [Mon, 1 Dec 2014 22:02:27 +0000 (22:02 +0000)]
Use nullptr to silence -Wsentinel when self-hosting on Windows

Richard rejected my Sema change to interpret an integer literal zero in
a varargs context as a null pointer, so -Wsentinel sees an integer
literal zero and fires off a warning. Only CodeGen currently knows that
it promotes integer literal zeroes in this context to pointer size on
Windows.  I didn't want to teach -Wsentinel about that compatibility
hack. Therefore, I'm migrating to C++11 nullptr.

llvm-svn: 223079

9 years ago[Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics
Philip Reames [Mon, 1 Dec 2014 21:18:12 +0000 (21:18 +0000)]
[Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics

The statepoint intrinsics are intended to enable precise root tracking through the compiler as to support garbage collectors of all types. The addition of the statepoint intrinsics to LLVM should have no impact on the compilation of any program which does not contain them. There are no side tables created, no extra metadata, and no inhibited optimizations.

A statepoint works by transforming a call site (or safepoint poll site) into an explicit relocation operation. It is the frontend's responsibility (or eventually the safepoint insertion pass we've developed, but that's not part of this patch series) to ensure that any live pointer to a GC object is correctly added to the statepoint and explicitly relocated. The relocated value is just a normal SSA value (as seen by the optimizer), so merges of relocated and unrelocated values are just normal phis. The explicit relocation operation, the fact the statepoint is assumed to clobber all memory, and the optimizers standard semantics ensure that the relocations flow through IR optimizations correctly.

This is the first patch in a small series.  This patch contains only the IR parts; the documentation and backend support will be following separately.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.

Reviewed by: atrick, ributzka

llvm-svn: 223078

9 years ago[NVPTX] Do not emit .weak symbols for NVPTX
Jingyue Wu [Mon, 1 Dec 2014 21:16:17 +0000 (21:16 +0000)]
[NVPTX] Do not emit .weak symbols for NVPTX

Summary:
".weak" symbols cannot be consumed by ptxas (PR21685). This patch makes the
weak directive in MCAsmPrinter customizable, and disables emitting ".weak"
symbols for NVPTX.

Test Plan: weak-linkage.ll

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: majnemer, jholewinski, llvm-commits

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

llvm-svn: 223077

9 years agoParse 'ghccc' in .ll files as the GHC convention (cc 10)
Reid Kleckner [Mon, 1 Dec 2014 21:04:44 +0000 (21:04 +0000)]
Parse 'ghccc' in .ll files as the GHC convention (cc 10)

Previously we just used "cc 10" in the .ll files, but that isn't very
human readable.

llvm-svn: 223076

9 years ago[AArch64] Don't combine "select (setcc i1 LHS, RHS), vL, vR".
Ahmed Bougacha [Mon, 1 Dec 2014 20:59:00 +0000 (20:59 +0000)]
[AArch64] Don't combine "select (setcc i1 LHS, RHS), vL, vR".

r208210 introduced an optimization that improves the vector select
codegen by doing the setcc on vectors directly.
This is a problem they the setcc operands are i1s, because the
optimization would create vectors of i1, which aren't legal.

Part of PR21549.

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

llvm-svn: 223075

9 years ago[AArch64] Fix v2i8->i16 bitcast legalization.
Ahmed Bougacha [Mon, 1 Dec 2014 20:52:32 +0000 (20:52 +0000)]
[AArch64] Fix v2i8->i16 bitcast legalization.

r213378 improved f16 bitcasts, so that they go directly through subregs,
instead of through the stack.  That code now causes an assertion failure
for bitcasts from other 16-bits types (most importantly v2i8).

Correct that by doing the custom lowering for i16 bitcasts only when the
input is an f16.

Part of PR21549.

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

llvm-svn: 223074

9 years ago[Core] Remove function to not override RoundTripPasses.
Shankar Easwaran [Mon, 1 Dec 2014 20:28:54 +0000 (20:28 +0000)]
[Core] Remove function to not override RoundTripPasses.

RoundTripPasses should always be called in DEBUG mode if the environment
variable "LLD_RUN_ROUNDTRIP_TEST" is set.

Flavors should not be able to override this behavior.

llvm-svn: 223073

9 years ago[OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.
Peter Zotov [Mon, 1 Dec 2014 19:50:39 +0000 (19:50 +0000)]
[OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.

This way most code won't link this (substantially large) library,
if compiled statically with LLVM.

llvm-svn: 223072

9 years ago[OCaml] [cmake] Add CMake buildsystem for OCaml.
Peter Zotov [Mon, 1 Dec 2014 19:50:23 +0000 (19:50 +0000)]
[OCaml] [cmake] Add CMake buildsystem for OCaml.

Closes PR15325.

llvm-svn: 223071

9 years agolibc++: add NaCl and PNaCl support for std::random_device
JF Bastien [Mon, 1 Dec 2014 19:19:55 +0000 (19:19 +0000)]
libc++: add NaCl and PNaCl support for std::random_device

Summary:
The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.

This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).

Test Plan: ninja check-libcxx

Reviewers: dschuff, mclow.lists, danalbert

Subscribers: jfb, cfe-commits

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

llvm-svn: 223068

9 years agoUse a continue to reduce indentation and clang-format. NFC.
Rafael Espindola [Mon, 1 Dec 2014 19:17:46 +0000 (19:17 +0000)]
Use a continue to reduce indentation and clang-format. NFC.

llvm-svn: 223067

9 years agoUse a range loop. NFC.
Rafael Espindola [Mon, 1 Dec 2014 19:08:07 +0000 (19:08 +0000)]
Use a range loop. NFC.

llvm-svn: 223066

9 years agoAdd missing 'break's, found by inspection. No functionality change; the
Richard Smith [Mon, 1 Dec 2014 18:59:10 +0000 (18:59 +0000)]
Add missing 'break's, found by inspection. No functionality change; the
fallthrough happened to do the right thing in both cases.

llvm-svn: 223064

9 years agoUse C++ typed enums instead of 'unsigned char' for MCInst Kind. NFC.
Pete Cooper [Mon, 1 Dec 2014 18:46:43 +0000 (18:46 +0000)]
Use C++ typed enums instead of 'unsigned char' for MCInst Kind.  NFC.

This makes it much easier to see the value of operands in the debugger.

llvm-svn: 223060

9 years ago[MachineVerifier] Accept a MBB with a single landing pad successor.
Ahmed Bougacha [Mon, 1 Dec 2014 18:43:53 +0000 (18:43 +0000)]
[MachineVerifier] Accept a MBB with a single landing pad successor.

The MachineVerifier used to check that there was always exactly one
unconditional branch to a non-landingpad (normal) successor.
If that normal successor to an invoke BB is unreachable, it seems
reasonable to only have one successor, the landing pad.
On targets other than AArch64 (and on AArch64 with a different testcase),
the branch folder turns the branch to the landing pad into a fallthrough.
The MachineVerifier, which relies on AnalyzeBranch, is unable to check
the condition, and doesn't complain. However, it does in this specific
testcase, where the branch to the landing pad remained.
Make the MachineVerifier accept it.

llvm-svn: 223059

9 years agoDrop SrcStructTypesSet. It is redundant.
Rafael Espindola [Mon, 1 Dec 2014 18:42:18 +0000 (18:42 +0000)]
Drop SrcStructTypesSet. It is redundant.

At the only point in the code it is used, we haven't added any of the src types
to DstStructTypesSet yet.

llvm-svn: 223057

9 years agoAdd a test for devirtualization of virtual operator calls.
Nico Weber [Mon, 1 Dec 2014 17:48:04 +0000 (17:48 +0000)]
Add a test for devirtualization of virtual operator calls.

There was no test coverage for this before: Modifiying
EmitCXXOperatorMemberCallee() to not call CanDevirtualizeMemberFunctionCall()
didn't make any test fail.

llvm-svn: 223056

9 years agoARM: lower tail calls correctly when using GHC calling convention.
Tim Northover [Mon, 1 Dec 2014 17:46:39 +0000 (17:46 +0000)]
ARM: lower tail calls correctly when using GHC calling convention.

Patch by Ben Gamari.

llvm-svn: 223055

9 years agoRevert r223049, r223050 and r223051 while investigating test failures.
Hans Wennborg [Mon, 1 Dec 2014 17:36:43 +0000 (17:36 +0000)]
Revert r223049, r223050 and r223051 while investigating test failures.

I didn't foresee affecting the Clang test suite :/

llvm-svn: 223054

9 years agoSimplifyCFG: Omit range checks for switch lookup tables when default is unreachable
Hans Wennborg [Mon, 1 Dec 2014 17:08:38 +0000 (17:08 +0000)]
SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable

They would get optimized away later, but we might as well not emit them.

llvm-svn: 223051

9 years agoSimplifyCFG: don't remove unreachable default switch destinations
Hans Wennborg [Mon, 1 Dec 2014 17:08:35 +0000 (17:08 +0000)]
SimplifyCFG: don't remove unreachable default switch destinations

An unreachable default destination can be exploited by other optimizations, and
SDag lowering is now prepared to handle them efficiently.

For example, branches to the unreachable destination will be optimized away,
such as in the case of range checks for switch lookup tables.

On 64-bit Linux, this reduces the size of a clang bootstrap by 80 kB (and
Chromium by 30 kB).

llvm-svn: 223050

9 years agoSelectionDAG switch lowering: Replace unreachable default with most popular case.
Hans Wennborg [Mon, 1 Dec 2014 17:08:32 +0000 (17:08 +0000)]
SelectionDAG switch lowering: Replace unreachable default with most popular case.

This can significantly reduce the size of the switch, allowing for more
efficient lowering.

I also worked with the idea of exploiting unreachable defaults by
omitting the range check for jump tables, but always ended up with a
non-neglible binary size increase. It might be worth looking into some more.

llvm-svn: 223049

9 years agoUpdate R600 address space map to include generic
Matt Arsenault [Mon, 1 Dec 2014 16:46:03 +0000 (16:46 +0000)]
Update R600 address space map to include generic

llvm-svn: 223046

9 years agoPartial revert of r222986.
Rafael Espindola [Mon, 1 Dec 2014 16:32:20 +0000 (16:32 +0000)]
Partial revert of r222986.

The explicit set of destination types is not fully redundant when lazy loading
since the TypeFinder will not find types used only in function bodies.

This keeps the logic to drop the name of mapped types since it still helps
with avoiding further renaming.

llvm-svn: 223043

9 years agoR600/SI: Various instruction format bit test cleanups
Matt Arsenault [Mon, 1 Dec 2014 15:52:46 +0000 (15:52 +0000)]
R600/SI: Various instruction format bit test cleanups

- Fix missing SALU format bits
- Remove unused isSALUInstr
- Add isVALU
- Switch isDS to use a bit like the others
- Move SIInstrInfo::is* functions to header
- Reorder so they are approximately sorted by type (SALU, VALU, memory)

llvm-svn: 223038

9 years agoMake the function pointer a template argument instead of a runtime value.
Samuel Benzaquen [Mon, 1 Dec 2014 14:46:14 +0000 (14:46 +0000)]
Make the function pointer a template argument instead of a runtime value.

Summary:
Speed up the variadic matchers by removing one indirect call.
Making the function pointer a template arguments allows the compiler to
inline the call instead of doing an runtime call by pointer.
Also, optimize the allOf() case to avoid redundant kind checks.
This speeds up our clang-tidy benchmark by ~2%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 223029

9 years ago[OPENMP] Formating and code improvement for codegen of 'omp critical' directive.
Alexey Bataev [Mon, 1 Dec 2014 11:32:38 +0000 (11:32 +0000)]
[OPENMP] Formating and code improvement for codegen of 'omp critical' directive.
No functional changes, only code improvements.

llvm-svn: 223010

9 years agoThe andi16, addiusp and jraddiusp micromips instructions were missing dedicated decod...
Vladimir Medic [Mon, 1 Dec 2014 11:12:04 +0000 (11:12 +0000)]
The andi16, addiusp and jraddiusp micromips instructions were missing dedicated decoder methods in MipsDisassembler.cpp to properly decode immediate operands. These methods are added together with corresponding tests.

llvm-svn: 223006

9 years ago[msan] Add compile-time checks for missing origins.
Evgeniy Stepanov [Mon, 1 Dec 2014 09:53:51 +0000 (09:53 +0000)]
[msan] Add compile-time checks for missing origins.

This change makes MemorySanitizer instrumentation a bit more strict
about instructions that have no origin id assigned to them.

This would have caught the bug that was fixed in r222918.

No functional change.

llvm-svn: 222997

9 years ago[PowerPC] Fix unwind info with dynamic stack realignment
Jay Foad [Mon, 1 Dec 2014 09:42:32 +0000 (09:42 +0000)]
[PowerPC] Fix unwind info with dynamic stack realignment

Summary:
PowerPC DWARF unwind info defined CFA as SP + offset even in a function
where the stack had been dynamically realigned. This clearly doesn't
work because the offset from SP to CFA is not a constant. Fix it by
defining CFA as BP instead.

This was causing the AddressSanitizer null_deref test to fail 50% of
the time, depending on whether SP happened to be 32-byte aligned on
entry to a particular function or not.

Reviewers: willschm, uweigand, hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 222996

9 years agoRevert "Remove threshold for lifetime marker insertion of named temporaries"
Arnaud A. de Grandmaison [Mon, 1 Dec 2014 09:30:16 +0000 (09:30 +0000)]
Revert "Remove threshold for lifetime marker insertion of named temporaries"

Revert r222993 while I investigate some MemorySanitizer failures.

llvm-svn: 222995

9 years agoRemoved extra whitespace. (Testing commit access). NFC.
Sonam Kumari [Mon, 1 Dec 2014 09:27:46 +0000 (09:27 +0000)]
Removed extra whitespace. (Testing commit access). NFC.

llvm-svn: 222994

9 years agoRemove threshold for lifetime marker insertion of named temporaries
Arnaud A. de Grandmaison [Mon, 1 Dec 2014 09:13:54 +0000 (09:13 +0000)]
Remove threshold for lifetime marker insertion of named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

llvm-svn: 222993

9 years agoAdd post-decode checking of HVC instruction.
Charlie Turner [Mon, 1 Dec 2014 08:50:27 +0000 (08:50 +0000)]
Add post-decode checking of HVC instruction.

Add checkDecodedInstruction for post-decode checking of instructions, to catch
the corner cases like HVC that don't fit into the general pattern. Needed to
check for an invalid condition field in instruction encoding despite HVC not
taking a predicate.

Patch by Matthew Wahab.

Change-Id: I48e28de981d7a9e43569594da3c45fb478b4f795
llvm-svn: 222992

9 years ago[asan] Change dynamic alloca instrumentation to only consider allocas that are domina...
Yury Gribov [Mon, 1 Dec 2014 08:47:58 +0000 (08:47 +0000)]
[asan] Change dynamic alloca instrumentation to only consider allocas that are dominating all exits from function.

Reviewed in http://reviews.llvm.org/D6412

llvm-svn: 222991

9 years agoAdd Thumb HVC and ERET virtualisation extension instructions.
Charlie Turner [Mon, 1 Dec 2014 08:39:19 +0000 (08:39 +0000)]
Add Thumb HVC and ERET virtualisation extension instructions.

Patch by Matthew Wahab.

Change-Id: I131f71c1150d5fa797066a18e09d526c19bf9016
llvm-svn: 222990

9 years agoAdd ARM ERET and HVC virtualisation extension instructions.
Charlie Turner [Mon, 1 Dec 2014 08:33:28 +0000 (08:33 +0000)]
Add ARM ERET and HVC virtualisation extension instructions.

Patch by Matthew Wahab.

Change-Id: Iad75f078fbaa4ecc7d7a4820ad9b3930679cbbbb
llvm-svn: 222989

9 years agoFix capitalization. NFC.
Akira Hatanaka [Mon, 1 Dec 2014 06:14:52 +0000 (06:14 +0000)]
Fix capitalization. NFC.

llvm-svn: 222988

9 years ago[stack protector] Set edge weights for newly created basic blocks.
Akira Hatanaka [Mon, 1 Dec 2014 04:27:03 +0000 (04:27 +0000)]
[stack protector] Set edge weights for newly created basic blocks.

This commit fixes a bug in stack protector pass where edge weights were not set
when new basic blocks were added to lists of successor basic blocks.

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

llvm-svn: 222987

9 years agoChange how we keep track of which types are in the dest module.
Rafael Espindola [Mon, 1 Dec 2014 04:15:59 +0000 (04:15 +0000)]
Change how we keep track of which types are in the dest module.

Instead of keeping an explicit set, just drop the names of types we choose
to map to some other type.

This has the advantage that the name of the unused will not cause the context
to rename types on module read.

llvm-svn: 222986

9 years agoAdd a test showing what the linker IdentifiedStructTypes is for.
Rafael Espindola [Mon, 1 Dec 2014 03:20:57 +0000 (03:20 +0000)]
Add a test showing what the linker IdentifiedStructTypes is for.

Without this it could just be deleted and all tests would pass.

llvm-svn: 222985

9 years agoRelax an assert a bit to avoid a crash on unreachable code.
Rafael Espindola [Mon, 1 Dec 2014 02:55:24 +0000 (02:55 +0000)]
Relax an assert a bit to avoid a crash on unreachable code.

Patch by Duncan Exon Smith with a small tweak by me.

llvm-svn: 222984

9 years ago[Core] Add flag to check if RoundTripPasses need to be run.
Shankar Easwaran [Mon, 1 Dec 2014 01:04:11 +0000 (01:04 +0000)]
[Core] Add flag to check if RoundTripPasses need to be run.

This would allow other flavor specific contexts to override the default value,
if they want to optionally run the round trip passes.

There is some information lost like the original file owner of the atom with
RoundTripPasses. The Gnu flavor needs this information inorder to implement
LinkerScript matching and for other diagnostic outputs such as Map files.

The flag also can be used to record information in the Atom if the information
to the Writer needs to be conveyed through References too.

llvm-svn: 222983

9 years ago[ELF] Fix layout of output sections.
Shankar Easwaran [Sun, 30 Nov 2014 22:36:29 +0000 (22:36 +0000)]
[ELF] Fix layout of output sections.

The AtomSections were improperly merging sections from various input files. This
patch fixes the problem, with an updated test that was provided by Simon.

Thanks to Simon Atanasyan for catching this issue.

llvm-svn: 222982

9 years ago[clang-tidy] google-explicit-constructor: don't match in template instantiations
Alexander Kornienko [Sun, 30 Nov 2014 19:41:41 +0000 (19:41 +0000)]
[clang-tidy] google-explicit-constructor: don't match in template instantiations

This helps avoiding false positives related to the recently added
std::initializer_list<> handling.

llvm-svn: 222981

9 years agoDrop unused enum value
Tobias Grosser [Sun, 30 Nov 2014 15:57:07 +0000 (15:57 +0000)]
Drop unused enum value

llvm-svn: 222980

9 years agoRemove Polly's IndVarSimplify pass
Tobias Grosser [Sun, 30 Nov 2014 14:33:41 +0000 (14:33 +0000)]
Remove Polly's IndVarSimplify pass

Polly had a copy of this pass to create the canonical induction variables
necessary for the non-scev-based code generation. As we now always use SCEV
based code generation, canonical induction variables are not needed any more.

llvm-svn: 222979

9 years agoRemove -polly-codegen-scev option and related code
Tobias Grosser [Sun, 30 Nov 2014 14:33:31 +0000 (14:33 +0000)]
Remove -polly-codegen-scev option and related code

SCEV based code generation has been the default for two weeks after having
been tested for a long time. We now drop the support the non-scev-based code
generation.

llvm-svn: 222978

9 years agocmake: Add polly libraries to LLVMExports
Tobias Grosser [Sun, 30 Nov 2014 12:45:44 +0000 (12:45 +0000)]
cmake: Add polly libraries to LLVMExports

This fixes LINK_POLLY_INTO_TOOLS=ON builds, which previously failed with:

CMake Error: install(EXPORT "LLVMExports" ...) includes target "opt" which
requires target "Polly" that is not in the export set.

CMake Error: install(EXPORT "LLVMExports" ...) includes target "bugpoint" which
requires target "Polly" that is not in the export set.

llvm-svn: 222977

9 years ago[PowerPC] Add asm support for cache-inhibited ld/st instructions
Hal Finkel [Sun, 30 Nov 2014 10:15:56 +0000 (10:15 +0000)]
[PowerPC] Add asm support for cache-inhibited ld/st instructions

Add assembler support for the fixed-point cache-inhibited load/store
instructions. These are hypervisor-level only, so don't get too excited ;)

Fixes PR21650.

llvm-svn: 222976

9 years ago[ELF] Rename align2 to alignment.
Shankar Easwaran [Sun, 30 Nov 2014 04:17:06 +0000 (04:17 +0000)]
[ELF] Rename align2 to alignment.

No change in functionality.

llvm-svn: 222975

9 years ago[ELF] Fix creation of segments.
Shankar Easwaran [Sun, 30 Nov 2014 04:01:14 +0000 (04:01 +0000)]
[ELF] Fix creation of segments.

Linker was creating a separate output segment in some cases if input sections
had huge alignments. This patch fixes the issue.

llvm-svn: 222974

9 years ago[ELF] Create input and output section names
Shankar Easwaran [Sun, 30 Nov 2014 03:43:38 +0000 (03:43 +0000)]
[ELF] Create input and output section names

No change in functionality.

llvm-svn: 222973

9 years ago[ELF] Rename MergedSection to OutputSection.
Shankar Easwaran [Sun, 30 Nov 2014 03:18:08 +0000 (03:18 +0000)]
[ELF] Rename MergedSection to OutputSection.

No change in functionality.

llvm-svn: 222972

9 years agoRevert r222957 "Replace std::map<K, V*> with std::map<K, V> to handle ownership and...
Craig Topper [Sun, 30 Nov 2014 01:20:17 +0000 (01:20 +0000)]
Revert r222957 "Replace std::map<K, V*> with std::map<K, V> to handle ownership and deletion of the values."

Upon further review I think the MultiClass is being copied into the map instead of being moved due to the copy constructor on the nested Record type. This ultimately got exposed when the vector in DefPrototype vector was changed to hold unique_ptrs in another commit. This caused gcc 4.7 to fail due to the use of the copy constructor on unique_ptr with the error pointing back to one of the insert calls from this commit. Not sure why clang was able to build.

This reverts commit 710cdf729f84b428bf41aa8d32dbdb35fff79fde.

llvm-svn: 222971

9 years agoRevert r222965 "Make MultiClass::DefPrototypes own their Records to fix memory leaks."
Hans Wennborg [Sun, 30 Nov 2014 00:43:50 +0000 (00:43 +0000)]
Revert r222965 "Make MultiClass::DefPrototypes own their Records to fix memory leaks."

The bots started failing with the error below. I suspect this revision was the cause.

FAILED: /home/bb/bin/g++47   -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -Ilib/TableGen -I/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen -Iinclude -I/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include    -fno-exceptions -fno-rtti -MMD -MT lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o -MF "lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o.d" -o lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o -c /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tempbuf.h:62:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_algo.h:64,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/algorithm:63,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/StringRef.h:13,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGLexer.h:17,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.h:17,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:14:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_construct.h: In instantiation of 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = std::unique_ptr<llvm::Record>; _Args = {const std::unique_ptr<llvm::Record, std::default_delete<llvm::Record> >&}]':
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:77:3:   required from 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*; bool _TrivialValueTypes = false]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:119:41:   required from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_uninitialized.h:260:63:   required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<llvm::Record>*, std::vector<std::unique_ptr<llvm::Record> > >; _ForwardIterator = std::unique_ptr<llvm::Record>*; _Tp = std::unique_ptr<llvm::Record>]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_vector.h:310:9:   required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::unique_ptr<llvm::Record>; _Alloc = std::allocator<std::unique_ptr<llvm::Record> >]'
/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/TableGen/Record.h:1664:8:   required from 'constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = std::basic_string<char>&; _U2 = llvm::MultiClass; <template-parameter-2-3> = void; _T1 = std::basic_string<char>; _T2 = llvm::MultiClass]'
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:273:72:   required from 'constexpr std::pair<typename std::__decay_and_strip<_T1>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = std::basic_string<char>&; _T2 = llvm::MultiClass; typename std::__decay_and_strip<_T2>::__type = llvm::MultiClass; typename std::__decay_and_strip<_T1>::__type = std::basic_string<char>]'
/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:2295:78:   required from here
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_construct.h:77:7: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = llvm::Record; _Dp = std::default_delete<llvm::Record>]'
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/memory:86:0,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/STLExtras.h:25,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:14,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/include/llvm/Support/SourceMgr.h:19,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.h:19,
                 from /home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/lib/TableGen/TGParser.cpp:14:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/unique_ptr.h:262:7: error: declared here
ninja: build stopped: subcommand failed.

llvm-svn: 222970

9 years agoclang/test/CodeGenOpenCL/opencl_types.cl: Appease i686-msvc.
NAKAMURA Takumi [Sun, 30 Nov 2014 00:32:02 +0000 (00:32 +0000)]
clang/test/CodeGenOpenCL/opencl_types.cl: Appease i686-msvc.

llvm-svn: 222969

9 years agoQualify one more make_unique call.
Hans Wennborg [Sun, 30 Nov 2014 00:31:49 +0000 (00:31 +0000)]
Qualify one more make_unique call.

The previous patch had effect, but missed this one. It seems MSVC
gets ADL-confused by the calls where the first argument is a function call?

llvm-svn: 222968

9 years agoSpeculatively qualify some llvm::make_unique calls trying to please MSVC
Hans Wennborg [Sun, 30 Nov 2014 00:24:43 +0000 (00:24 +0000)]
Speculatively qualify some llvm::make_unique calls trying to please MSVC

It was failing with this kind of error:

C:\b\build\slave\CrWinClang\build\src\third_party\llvm\lib\TableGen\TGParser.cpp(1243) : error C2668: 'llvm::make_unique' : ambiguous call to overloaded function

        C:\b\build\slave\CrWinClang\build\src\third_party\llvm\include\llvm/ADT/STLExtras.h(408): could be 'std::unique_ptr<llvm::Record,std::default_delete<_Ty>> llvm::make_unique<llvm::Record,std::string,llvm::SMLoc&,llvm::RecordKeeper&,bool>(std::string &&,llvm::SMLoc &,llvm::RecordKeeper &,bool &&)'
        with
        [
            _Ty=llvm::Record
        ]
        C:\b\depot_tools\win_toolchain\vs2013_files\win8sdk\bin\..\..\VC\include\memory(1637): or       'std::unique_ptr<llvm::Record,std::default_delete<_Ty>> std::make_unique<llvm::Record,std::string,llvm::SMLoc&,llvm::RecordKeeper&,bool>(std::string &&,llvm::SMLoc &,llvm::RecordKeeper &,bool &&)' [found using argument-dependent lookup]
        with
        [
            _Ty=llvm::Record
        ]
        while trying to match the argument list '(std::string, llvm::SMLoc, llvm::RecordKeeper, bool)'

llvm-svn: 222967

9 years agoUse an unsigned type because there seems to be no reason for it to be signed.
Craig Topper [Sun, 30 Nov 2014 00:24:32 +0000 (00:24 +0000)]
Use an unsigned type because there seems to be no reason for it to be signed.

llvm-svn: 222966

9 years agoMake MultiClass::DefPrototypes own their Records to fix memory leaks.
Craig Topper [Sun, 30 Nov 2014 00:19:28 +0000 (00:19 +0000)]
Make MultiClass::DefPrototypes own their Records to fix memory leaks.

llvm-svn: 222965

9 years agoFix typo.
Nico Weber [Sat, 29 Nov 2014 23:57:35 +0000 (23:57 +0000)]
Fix typo.

llvm-svn: 222964

9 years agoFix grammar error in err_bad_reinterpret_cast_reference error message.
Nathan Sidwell [Sat, 29 Nov 2014 22:51:47 +0000 (22:51 +0000)]
Fix grammar error in err_bad_reinterpret_cast_reference error message.

llvm-svn: 222963

9 years agoSwitch lowering: reformat some for loops etc. NFC
Hans Wennborg [Sat, 29 Nov 2014 21:24:12 +0000 (21:24 +0000)]
Switch lowering: reformat some for loops etc. NFC

llvm-svn: 222962

9 years agoSwitch lowering: Fix broken 'Figure out which block is next' code
Hans Wennborg [Sat, 29 Nov 2014 21:17:05 +0000 (21:17 +0000)]
Switch lowering: Fix broken 'Figure out which block is next' code

This doesn't seem to have worked in a long time, but other optimizations
would clean it up.

llvm-svn: 222961