platform/upstream/llvm.git
9 years agoAllow CMAKE_OSX_ARCHITECTURES to build fat library.
Jonathan Peyton [Fri, 29 May 2015 16:13:56 +0000 (16:13 +0000)]
Allow CMAKE_OSX_ARCHITECTURES to build fat library.

The CMAKE_OSX_ARCHITECTURES CMake variable allows users to build
universal fat libraries that contain both i386 and x86_64 code.  These
changes allow this build by having the z_Linux_asm.s file detect the architecture
itself instead of receiving it through the build system.

Also, there was a LIBOMP_OSX_ARCHITECTURES CMake variable added to allow
people to only build libomp as a fat library and not the entire LLVM/Clang system.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-May/000626.html

llvm-svn: 238566

9 years agoCOFF: Add /help option.
Rui Ueyama [Fri, 29 May 2015 16:11:52 +0000 (16:11 +0000)]
COFF: Add /help option.

llvm-svn: 238565

9 years agoCOFF: Add /machine option.
Rui Ueyama [Fri, 29 May 2015 16:06:00 +0000 (16:06 +0000)]
COFF: Add /machine option.

llvm-svn: 238564

9 years agoCOFF: Move Windows-specific function under Windows-specific marker.
Rui Ueyama [Fri, 29 May 2015 15:49:09 +0000 (15:49 +0000)]
COFF: Move Windows-specific function under Windows-specific marker.

llvm-svn: 238563

9 years agoCOFF: Fill imort table HintName field.
Rui Ueyama [Fri, 29 May 2015 15:45:35 +0000 (15:45 +0000)]
COFF: Fill imort table HintName field.

Currently we set the field to zero, but as per the spec, we should
set numbers we read from import library files. The loader uses the
values as starting offsets for binary search when looking up imported
symbols from DLL.

llvm-svn: 238562

9 years agolibcxx: Switch to use __gnu_unwind_frame() for libunwind.
Logan Chien [Fri, 29 May 2015 15:34:24 +0000 (15:34 +0000)]
libcxx: Switch to use __gnu_unwind_frame() for libunwind.

As a step to fix libunwind unw_step(), a new function
__gnu_unwind_frame() has been introduced to libunwind, and it is
required to use this function so that some libunwind internal data
structure can be updated properly.

llvm-svn: 238561

9 years agolibunwind: Fix unw_step() for ARM EHABI.
Logan Chien [Fri, 29 May 2015 15:33:38 +0000 (15:33 +0000)]
libunwind: Fix unw_step() for ARM EHABI.

This commit fixes the unw_step() for ARM EHABI.  However, this commit
also changes the implementation details for ARM EHABI.

The first change is that the personality function should call
__gnu_unwind_frame() for default (or de facto) frame unwinding based on
the ARM-defined unwind opcode.  The function __gnu_unwind_frame() will
in turn calls unw_step() which actually unwinds the frame.

The second change is that the implementation _Unwind_Backtrace() should
no longer calls unw_step() to unwind the frame; since according to ARM
EHABI, the personality function should unwind the frame for us.

Special thanks to Anton for helpful suggestion on the initial version of
this patch.

llvm-svn: 238560

9 years agoSimplify now that symbols contain the correct section.
Rafael Espindola [Fri, 29 May 2015 15:07:27 +0000 (15:07 +0000)]
Simplify now that symbols contain the correct section.

The complexity in here was because before r233995 variable symbols would report
the incorrect section.

llvm-svn: 238559

9 years agoXFAIL two tests for android
Pavel Labath [Fri, 29 May 2015 14:54:46 +0000 (14:54 +0000)]
XFAIL two tests for android

bug #23694

llvm-svn: 238558

9 years ago[Objdump] Removing unused parameter.
Colin LeMahieu [Fri, 29 May 2015 14:48:25 +0000 (14:48 +0000)]
[Objdump] Removing unused parameter.

llvm-svn: 238557

9 years ago[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a...
Colin LeMahieu [Fri, 29 May 2015 14:44:13 +0000 (14:44 +0000)]
[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a time which is the semantic unit for Hexagon.  Fixing tests to use the new format.  Disabling tests in the direct object emission path for a followup patch.

llvm-svn: 238556

9 years agoFix ELFObjectWriter::isLocal for signature symbols.
Rafael Espindola [Fri, 29 May 2015 14:20:40 +0000 (14:20 +0000)]
Fix ELFObjectWriter::isLocal for signature symbols.

And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.

No functionality change overall since the old code avoided the isLocal bug.

llvm-svn: 238555

9 years ago[mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.
Toma Tabacu [Fri, 29 May 2015 13:52:56 +0000 (13:52 +0000)]
[mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.

llvm-svn: 238554

9 years ago[ARM] Adjust -march checking
John Brawn [Fri, 29 May 2015 13:10:44 +0000 (13:10 +0000)]
[ARM] Adjust -march checking

getCanonicalArchName can return an empty string for an architecture
that is well-formed but meaningless. Use parseArch to determine if
it's actually valid or not.

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

llvm-svn: 238553

9 years agoRemoving a switch statement that only contains a default; NFC.
Aaron Ballman [Fri, 29 May 2015 13:00:07 +0000 (13:00 +0000)]
Removing a switch statement that only contains a default; NFC.

llvm-svn: 238552

9 years ago[NativeProcessLinux] clean up #includes
Pavel Labath [Fri, 29 May 2015 12:53:54 +0000 (12:53 +0000)]
[NativeProcessLinux] clean up #includes

llvm-svn: 238551

9 years agoFix assertion on C++ attributes in fillAttributedTypeLoc
Alexander Musman [Fri, 29 May 2015 11:24:32 +0000 (11:24 +0000)]
Fix assertion on C++ attributes in fillAttributedTypeLoc
this fixes http://llvm.org/PR17424
fillAttributedTypeLoc() function is only called with AttributeLists of either
DeclarationChunk (which is used for each type in a declarator being parsed) or
DeclSpec (which captures information about declaration specifiers).
As C++11 attributes actually appertain to declarators, they are moved straight
to the declarator’s attr list in distributeFunctionTypeAttrFromDeclSpec()
function.
'Put them wherever you like' semantics is not supported for C++11 attributes
(but is allowed for GNU attributes, for example). So when we meet an attribute
while parsing the declaration, we cannot be sure if it appertains to either
DeclarationChunk or DeclSpec.

This investigation correlates with the history of changes of SemaType.cpp:
• Asserts in fillAttributedTypeLoc() were added on 3 Mar 2011 in r126986
(http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20110228/039638.html);
• Distributing C++11 attrs to the declarator was added on 14 Jan 2013
in r172504 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20130114/071830.html).
Considering all written above I changed asserts in fillAttributedTypeLoc()
to nullptr checks.

This fixes PR17424 and related assertion on
[[gnu::fastcall]] void __stdcall foo();

Author: Alexey Frolov

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

llvm-svn: 238550

9 years agoReport inferior SIGSEGV as a signal instead of an exception on linux
Pavel Labath [Fri, 29 May 2015 10:13:03 +0000 (10:13 +0000)]
Report inferior SIGSEGV as a signal instead of an exception on linux

Summary:
Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception"
to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the
user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since
LLDB was unable to reinject this signal back into the inferior.

This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the
test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it
uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with
signal=SIGSEGV.

I have also added the ability to set the description of StopInfoUnixSignal using the description
field of the gdb-remote packet. The linux stub uses this to display additional information about
the segfault (invalid address, address access protected, etc.).

Test Plan: All tests pass on linux and osx.

Reviewers: ovyalov, clayborg, emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 238549

9 years ago[clang-tidy] Fix for llvm.org/PR23355
Szabolcs Sipos [Fri, 29 May 2015 09:49:59 +0000 (09:49 +0000)]
[clang-tidy] Fix for llvm.org/PR23355

misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly.

llvm-svn: 238548

9 years agoRefactor MacroInfo so macro arguments can be iterated with range-based for loops.
Daniel Marjamaki [Fri, 29 May 2015 09:15:24 +0000 (09:15 +0000)]
Refactor MacroInfo so macro arguments can be iterated with range-based for loops.

No functional change intended.

Patch by Sebastian Edman!

llvm-svn: 238547

9 years agoRun clang-format on MacroInfo.h
Daniel Marjamaki [Fri, 29 May 2015 08:26:48 +0000 (08:26 +0000)]
Run clang-format on MacroInfo.h

llvm-svn: 238546

9 years ago[ASan] Fix flaky tests (see https://llvm.org/bugs/show_bug.cgi?id=23230).
Yury Gribov [Fri, 29 May 2015 06:45:13 +0000 (06:45 +0000)]
[ASan] Fix flaky tests (see https://llvm.org/bugs/show_bug.cgi?id=23230).
Patch by Maria Guseva!

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

llvm-svn: 238545

9 years agoclang-format: [JS] Support ES6 computed property names.
Daniel Jasper [Fri, 29 May 2015 06:19:49 +0000 (06:19 +0000)]
clang-format: [JS] Support ES6 computed property names.

Before:
  var x = {
        [a]: 1,
    b: 2
  };

After:
  var x = {
    [a]: 1,
    b: 2
  };

llvm-svn: 238544

9 years ago[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit...
Craig Topper [Fri, 29 May 2015 05:51:32 +0000 (05:51 +0000)]
[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.

I don't think converting the inputs to the Ops was the right behavior anyway.

llvm-svn: 238543

9 years agoNFC: tab => spaces
Jingyue Wu [Fri, 29 May 2015 05:43:03 +0000 (05:43 +0000)]
NFC: tab => spaces

llvm-svn: 238542

9 years agoChange ProcessEventData over to use a std::weak_ptr to a process intead of a std...
Greg Clayton [Fri, 29 May 2015 03:20:37 +0000 (03:20 +0000)]
Change ProcessEventData over to use a std::weak_ptr to a process intead of a std::shared_ptr. Anyone consuming events for a process should have the process around long enough to grab the event and anyone that holds onto an event for too long won't keep the process around.

llvm-svn: 238541

9 years agoThis should have been a reference
Matthias Braun [Fri, 29 May 2015 02:59:59 +0000 (02:59 +0000)]
This should have been a reference

llvm-svn: 238540

9 years agoCodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands
Matthias Braun [Fri, 29 May 2015 02:56:46 +0000 (02:56 +0000)]
CodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands

MIOperands/ConstMIOperands are classes iterating over the MachineOperand
of a MachineInstr, however MachineInstr::mop_iterator does the same
thing.

I assume these two iterators exist to have a uniform interface to
iterate over the operands of a machine instruction bundle and a single
machine instruction. However in practice I find it more confusing to have 2
different iterator classes, so this patch transforms (nearly all) the
code to use mop_iterators.

The only exception being MIOperands::anlayzePhysReg() and
MIOperands::analyzeVirtReg() still needing an equivalent, I leave that
as an exercise for the next patch.

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

This version is slightly modified from the proposed revision in that it
introduces MachineInstr::getOperandNo to avoid the extra counting
variable in the few loops that previously used MIOperands::getOperandNo.

llvm-svn: 238539

9 years agowip: Remove some unused functions
Justin Bogner [Fri, 29 May 2015 02:42:14 +0000 (02:42 +0000)]
wip: Remove some unused functions

llvm-svn: 238538

9 years agoAdd a test for the MachineCopyPropagation change landed in r238518.
Quentin Colombet [Fri, 29 May 2015 01:40:00 +0000 (01:40 +0000)]
Add a test for the MachineCopyPropagation change landed in r238518.

llvm-svn: 238537

9 years ago[TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.
Ahmed Bougacha [Fri, 29 May 2015 01:03:37 +0000 (01:03 +0000)]
[TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.

Fixes PR23455, where, when TableGen generates the matcher from the
AsmString, it splits "cmp${cc}ss" into tokens, and the "ss" suffix
is recognized as the SS register.

I can't think of a situation where that's a feature, not a bug, hence:
when a token is "isolated", i.e., it is followed and preceded by
separators, it shouldn't be parsed as a register.

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

llvm-svn: 238536

9 years agoAdd '+' sign at the end of echo package
Ying Chen [Fri, 29 May 2015 01:02:07 +0000 (01:02 +0000)]
Add '+' sign at the end of echo package

Summary:
-Fix lldb test failures introduced by r238530
-This fix TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py

Test Plan:
./dotest -p TestGdbRemoteAuxvSupport.py
./dotest -p TestLldbGdbServer.py

Reviewers: clayborg, chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238535

9 years ago[TableGen][AsmMatcherEmitter] Factor out AsmOperand creation. NFC.
Ahmed Bougacha [Fri, 29 May 2015 00:55:55 +0000 (00:55 +0000)]
[TableGen][AsmMatcherEmitter] Factor out AsmOperand creation.  NFC.

llvm-svn: 238534

9 years agoAdd support for the qEcho command to lldb-server in the common packets.
Greg Clayton [Fri, 29 May 2015 00:15:15 +0000 (00:15 +0000)]
Add support for the qEcho command to lldb-server in the common packets.

llvm-svn: 238533

9 years ago[TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"
Siva Chandra [Fri, 29 May 2015 00:14:16 +0000 (00:14 +0000)]
[TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"

Summary:
Old Android devices, for example API 16, do not have the "readlink"
command. To take care of such devices, this commit changes to use "ls -l"
instead of "readlink" to get the lldb-server exe path.

The tests fixed with this change for an Android API 16 arm device are:

TestGdbRemoteAttach
TestGdbRemoteAuxvSupport
TestGdbRemoteExpeditedRegisters
TestGdbRemoteKill
TestGdbRemoteProcessInfo
TestGdbRemoteSegFault
TestGdbRemoteThreadsInStopReply
TestGdbRemote_qThreadStopInfo

Further, all tests in TestLldbGdbServer pass (previously erroring out),
except one which times out.

Test Plan:
Run dosep.py with 8 test threads targetting Android API 16
device.

Reviewers: vharron, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 238532

9 years ago[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
Ahmed Bougacha [Fri, 29 May 2015 00:04:30 +0000 (00:04 +0000)]
[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.

Double and single rounding can produce different results.
This is the IR counterpart to r228911.

llvm-svn: 238531

9 years agoAdd a new "qEcho" packet with the following format:
Greg Clayton [Fri, 29 May 2015 00:01:55 +0000 (00:01 +0000)]
Add a new "qEcho" packet with the following format:

qEcho:%s

where '%s' is any valid string. The response to this packet is the exact packet itself with no changes, just reply with what you received!

This will help us to recover from packets timing out much more gracefully. Currently if a packet times out, LLDB quickly will hose up the debug session. For example, if we send a "abc" packet and we expect "ABC" back in response, but the "abc" command takes longer than the current timeout value this will happen:

--> "abc"
<-- <<<error: timeout>>>

Now we want to send "def" and get "DEF" back:

--> "def"
<-- "ABC"

We got the wrong response for the "def" packet because we didn't sync up with the server to clear any current responses from previously issues commands.

The fix is to modify GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock() so that when it gets a timeout, it syncs itself up with the client by sending a "qEcho:%u" where %u is an increasing integer, one for each time we timeout. We then wait for 3 timeout periods to sync back up. So the above "abc" session would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- "abc"
<-- "qEcho:1"

The first timeout is from trying to get the response, then we know we timed out and we send the "qEcho:1" packet and wait for 3 timeout periods to get back in sync knowing that we might actually get the response for the "abc" packet in the mean time...

In this case we would actually succeed in getting the response for "abc". But lets say the remote GDB server is deadlocked and will never response, it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second

We then disconnect and say we lost connection.

We might also have a bad GDB server that just dropped the "abc" packet on the floor. We can still recover in this case and it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- "qEcho:1"

Then we know our remote GDB server is still alive and well, and it just dropped the "abc" response on the floor and we can continue to debug.

<rdar://problem/21082939>

llvm-svn: 238530

9 years agoFix TestMultithreaded.
Chaoren Lin [Fri, 29 May 2015 00:01:15 +0000 (00:01 +0000)]
Fix TestMultithreaded.

llvm-svn: 238529

9 years agoAdd "Failing Tests .." line to dosep logs
Ying Chen [Thu, 28 May 2015 23:51:49 +0000 (23:51 +0000)]
Add "Failing Tests .." line to dosep logs

Summary:
-Buildbot parser depends on this line as start flag
-Will remove the dependency from buildbot parser, but it takes some time to take effect
-Will remove this line from printout after buildbot master reconfig

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238527

9 years agoRemove dead code.
Richard Smith [Thu, 28 May 2015 23:38:53 +0000 (23:38 +0000)]
Remove dead code.

llvm-svn: 238526

9 years agoMachineFrameInfo: Simplify pristine register calculation.
Matthias Braun [Thu, 28 May 2015 23:20:35 +0000 (23:20 +0000)]
MachineFrameInfo: Simplify pristine register calculation.

About pristine regsiters:
Pristine registers "hold a value that is useless to the current
function, but that must be preserved - they are callee saved registers
that have not been saved." This concept saves compile time as it frees
the prologue/epilogue inserter from adding every such register to every
basic blocks live-in list.

However the current code in getPristineRegs is formulated in a
complicated way: Inside the function prologue and epilogue all callee
saves are considered pristine, while in the rest of the code only the
non-saved ones are considered pristine.  This requires logic to
differentiate between prologue/epilogue and the rest and in the presence
of shrink-wrapping this even becomes complicated/expensive.  It's also
unnecessary because the prologue epilogue inserters already mark
callee-save registers that are saved/restores properly in the respective
blocks in the prologue/epilogue (see updateLiveness() in
PrologueEpilogueInserter.cpp). So only declaring non-saved/restored
callee saved registers as pristine just works.

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

llvm-svn: 238524

9 years agoFix typos in variable/grammar names.
Eric Christopher [Thu, 28 May 2015 23:07:39 +0000 (23:07 +0000)]
Fix typos in variable/grammar names.

llvm-svn: 238523

9 years agoRemove warning when testing for timeout command.
Chaoren Lin [Thu, 28 May 2015 23:00:10 +0000 (23:00 +0000)]
Remove warning when testing for timeout command.

llvm-svn: 238522

9 years agoRename Win64Exception.(cpp|h) to WinException.(cpp|h)
Reid Kleckner [Thu, 28 May 2015 22:47:01 +0000 (22:47 +0000)]
Rename Win64Exception.(cpp|h) to WinException.(cpp|h)

This is in preparation for reusing this for 32-bit x86 EH table
emission.  Also updates the type name for consistency. NFC

llvm-svn: 238521

9 years ago[x86] Move the vector popcount tests into non-ISA files, and instead
Chandler Carruth [Thu, 28 May 2015 22:46:48 +0000 (22:46 +0000)]
[x86] Move the vector popcount tests into non-ISA files, and instead
organize them by the width of vector.

This makes it a lot easier to see that we're covering all of the vector
types but not doing so excessively. This also adds tests across the
spectrum of SSE versions in addition to the AVX versions.

If you're really tired of seeing the *massive* sprawl of scalarized code
for this, don't worry, I'm just about to land Bruno's patch that
dramatically improve the situation for SSSE3 and newer.

llvm-svn: 238520

9 years agoMIR Serialization: print and parse machine function names.
Alex Lorenz [Thu, 28 May 2015 22:41:12 +0000 (22:41 +0000)]
MIR Serialization: print and parse machine function names.

This commit introduces a serializable structure called
'llvm::yaml::MachineFunction' that stores the machine
function's name. This structure will mirror the machine
function's state in the future.

This commit prints machine functions as YAML documents
containing a YAML mapping that stores the state of a machine
function. This commit also parses the YAML documents
that contain the machine functions.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 238519

9 years ago[MachineCopyPropagation] Fix a bug with undef handling when the value is actualy...
Quentin Colombet [Thu, 28 May 2015 22:38:40 +0000 (22:38 +0000)]
[MachineCopyPropagation] Fix a bug with undef handling when the value is actualy alive.
Test case will follow.

llvm-svn: 238518

9 years agoAST: Fix printing GNU old-style field designators
Justin Bogner [Thu, 28 May 2015 22:19:36 +0000 (22:19 +0000)]
AST: Fix printing GNU old-style field designators

Allows StmtPrinter to print old style field designators in
initializers, fixing an issue where we would print the following
invalid code:

  struct A a = {b: = 3, .c = 4};

Patch by Nick Sumner. Thanks!

llvm-svn: 238517

9 years agoFixing broken bots after r238505.
Chris Bieneman [Thu, 28 May 2015 22:18:34 +0000 (22:18 +0000)]
Fixing broken bots after r238505.

Need non-const iterator inserts too. These failures seem to be due to differences in the versions of libstdc++ on various operating systems.

llvm-svn: 238516

9 years agoAdd testcase for r238503.
David Majnemer [Thu, 28 May 2015 22:12:27 +0000 (22:12 +0000)]
Add testcase for r238503.

llvm-svn: 238515

9 years ago[WinEH] Start inserting state number stores for C++ EH
Reid Kleckner [Thu, 28 May 2015 22:00:24 +0000 (22:00 +0000)]
[WinEH] Start inserting state number stores for C++ EH

This moves all the state numbering code for C++ EH to WinEHPrepare so
that we can call it from the X86 state numbering IR pass that runs
before isel.

Now we just call the same state numbering machinery and insert a bunch
of stores. It also populates MachineModuleInfo with information about
the current function.

llvm-svn: 238514

9 years agoDon't special case undefined symbol when deciding the symbol order.
Rafael Espindola [Thu, 28 May 2015 21:59:34 +0000 (21:59 +0000)]
Don't special case undefined symbol when deciding the symbol order.

ELF has no restrictions on where undefined symbols go relative to other defined
symbols. In fact, gas just sorts them together. Do the same.

This was there since r111174 probably just because the MachO writer has it.

llvm-svn: 238513

9 years agoAdded a test that makes sure that structs returned
Sean Callanan [Thu, 28 May 2015 21:58:52 +0000 (21:58 +0000)]
Added a test that makes sure that structs returned
from expressions return intact.

<rdar://problem/21146609>

llvm-svn: 238512

9 years agoUpdate documentation for llvm-profdata.
Diego Novillo [Thu, 28 May 2015 21:57:17 +0000 (21:57 +0000)]
Update documentation for llvm-profdata.

These options have been present for a while, but I had never updated the
documentation. Fixed.

llvm-svn: 238511

9 years agoSimplify regex in TestDataFormatterUnordered.py for better readability.
Chaoren Lin [Thu, 28 May 2015 21:52:07 +0000 (21:52 +0000)]
Simplify regex in TestDataFormatterUnordered.py for better readability.

Summary:
Using `(match){3}` instead of `matchmatchmatch`.
This is an update to D10078.

Test Plan: no change in test behavior.

Reviewers: clayborg, sivachandra

Reviewed By: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238510

9 years agoFixing the polly build.
Chris Bieneman [Thu, 28 May 2015 21:51:52 +0000 (21:51 +0000)]
Fixing the polly build.

I broke the polly build in r238505. This fixes the failure by adding non-const iterator erase methods to cl::list_storage.

llvm-svn: 238509

9 years agoRevise test to run llc and llvm-mc separately.
Andy Ayers [Thu, 28 May 2015 21:49:50 +0000 (21:49 +0000)]
Revise test to run llc and llvm-mc separately.

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

llvm-svn: 238508

9 years agoEnable exitValue rewrite only when the cost of expansion is low.
Wei Mi [Thu, 28 May 2015 21:49:07 +0000 (21:49 +0000)]
Enable exitValue rewrite only when the cost of expansion is low.

The patch evaluates the expansion cost of exitValue in indVarSimplify pass, and only does the rewriting when the expansion cost is low or loop can be deleted with the rewriting. It provides an option "-replexitval=" to control the default aggressiveness of the exitvalue rewriting. It also fixes some missing cases in SCEVExpander::isHighCostExpansionHelper to enhance the evaluation of SCEV expansion cost.

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

llvm-svn: 238507

9 years agoRemove a trivial forwarding function. NFC.
Rafael Espindola [Thu, 28 May 2015 21:36:02 +0000 (21:36 +0000)]
Remove a trivial forwarding function. NFC.

llvm-svn: 238506

9 years agoRe-landing "Refactoring cl::list_storage from "is a" to "has a" std::vector."
Chris Bieneman [Thu, 28 May 2015 21:31:22 +0000 (21:31 +0000)]
Re-landing "Refactoring cl::list_storage from "is a" to "has a" std::vector."

Originally landed r238485

MSVC resolves identifiers differently from Clang and GCC, this resulted in build bot failures. This pach re-lands r238485 and fixes the build failures.

llvm-svn: 238505

9 years agoImprove user documentation on profiling.
Diego Novillo [Thu, 28 May 2015 21:30:04 +0000 (21:30 +0000)]
Improve user documentation on profiling.

This clarifies the relationship between instrumentation and sampling based PGO,
code coverage analysis and the different formats supported by sample
profiling.

llvm-svn: 238504

9 years ago[SelectionDAG] Scalar shift amounts may require legalization
David Majnemer [Thu, 28 May 2015 21:29:59 +0000 (21:29 +0000)]
[SelectionDAG] Scalar shift amounts may require legalization

The shift amount may be too small to cope with promoted left hand side,
make sure to promote it as well.

This fixes PR23664.

llvm-svn: 238503

9 years agoRemove debug prints from r238487
Reid Kleckner [Thu, 28 May 2015 21:23:53 +0000 (21:23 +0000)]
Remove debug prints from r238487

llvm-svn: 238501

9 years ago[omp] Loosen the driver test enough so that overriding the defaults
Chandler Carruth [Thu, 28 May 2015 21:20:14 +0000 (21:20 +0000)]
[omp] Loosen the driver test enough so that overriding the defaults
works well for folks.

This isn't terribly clean (sadly) but after chatting with both Eric and
Richard, nothing cleaner really emerged. The clean way of doing this is
a *lot* of work for extremely little benefit here.

llvm-svn: 238500

9 years agoResubmitting r238459 and r238460 with fix for Linux.
Chaoren Lin [Thu, 28 May 2015 21:19:31 +0000 (21:19 +0000)]
Resubmitting r238459 and r238460 with fix for Linux.

llvm-svn: 238499

9 years ago[omp] Fix a typo in a comment and a line I forgot to clang-format that
Chandler Carruth [Thu, 28 May 2015 21:10:31 +0000 (21:10 +0000)]
[omp] Fix a typo in a comment and a line I forgot to clang-format that
Justin pointed out in post-commit review.

llvm-svn: 238498

9 years agoRevert "Move inlined cxa_demangle.cpp to a separate file."
Ying Chen [Thu, 28 May 2015 21:06:36 +0000 (21:06 +0000)]
Revert "Move inlined cxa_demangle.cpp to a separate file."

This reverts commit 8cb47a2140f3e93a34597fc9f11c8cd96130076d.

llvm-svn: 238497

9 years agoRevert "Allow both MSVC and Itanium mangling schemes."
Ying Chen [Thu, 28 May 2015 21:06:33 +0000 (21:06 +0000)]
Revert "Allow both MSVC and Itanium mangling schemes."
Cause build break.

This reverts commit 6d986061393f2863fec739e04412281148acc1f3.

llvm-svn: 238496

9 years agoSkip ThreadStateTestCase.test_state_after_continue_with_dwarf on Darwin
Ying Chen [Thu, 28 May 2015 21:03:26 +0000 (21:03 +0000)]
Skip ThreadStateTestCase.test_state_after_continue_with_dwarf on Darwin

Summary:
- This test cause Python crash randomly on darwin builder
- Tracked by bug 'llvm.org/pr23669'

Test Plan: ./dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestThreadStates.py

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238495

9 years ago[llvm] Adding vdtor to fix warning.
Colin LeMahieu [Thu, 28 May 2015 20:59:08 +0000 (20:59 +0000)]
[llvm] Adding vdtor to fix warning.

llvm-svn: 238494

9 years agoFix the Xcode build after the recent new demangling files were added.
Greg Clayton [Thu, 28 May 2015 20:57:55 +0000 (20:57 +0000)]
Fix the Xcode build after the recent new demangling files were added.

llvm-svn: 238493

9 years agoInline trivial method. NFC.
Rafael Espindola [Thu, 28 May 2015 20:53:09 +0000 (20:53 +0000)]
Inline trivial method. NFC.

llvm-svn: 238492

9 years agoRevert "Refactoring cl::list_storage from "is a" to "has a" std::vector."
Chris Bieneman [Thu, 28 May 2015 20:47:02 +0000 (20:47 +0000)]
Revert "Refactoring cl::list_storage from "is a" to "has a" std::vector."

This reverts commit 117715ca0613d3db144241499401f2ec5398f1d5.

llvm-svn: 238491

9 years agoDisable x86 tail call optimizations that jump through GOT
Reid Kleckner [Thu, 28 May 2015 20:44:28 +0000 (20:44 +0000)]
Disable x86 tail call optimizations that jump through GOT

For x86 targets, do not do sibling call optimization when materializing
the callee's address would require a GOT relocation. We can still do
tail calls to internal functions, hidden functions, and protected
functions, because they do not require this kind of relocation. It is
still possible to get GOT relocations when the user explicitly asks for
it with musttail or -tailcallopt, both of which are supposed to
guarantee TCO.

Based on a patch by Chih-hung Hsieh.

Reviewers: srhines, timmurray, danalbert, enh, void, nadav, rnk

Subscribers: joerg, davidxl, llvm-commits

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

llvm-svn: 238487

9 years agoCOFF: Return an error_code directly.
Rui Ueyama [Thu, 28 May 2015 20:39:29 +0000 (20:39 +0000)]
COFF: Return an error_code directly.

llvm-svn: 238486

9 years agoRefactoring cl::list_storage from "is a" to "has a" std::vector.
Chris Bieneman [Thu, 28 May 2015 20:38:12 +0000 (20:38 +0000)]
Refactoring cl::list_storage from "is a" to "has a" std::vector.

Summary: This isn't necessarily an ideal change, and I want to at least reduce the API surface area, but for the new API we really shouldn't be relying on cl::list being a std::vector.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 238485

9 years ago[asan] Add new(unsigned int) to ASan interface list.
Evgeniy Stepanov [Thu, 28 May 2015 20:37:50 +0000 (20:37 +0000)]
[asan] Add new(unsigned int) to ASan interface list.

Also, sized-delete with size_t == unsigned int.
These guys appear when building for Android with gnu-stl.

Fixes a number of ASan tests in that particular configuration.

llvm-svn: 238484

9 years agoRevert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read...
Daniel Sanders [Thu, 28 May 2015 20:30:32 +0000 (20:30 +0000)]
Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.

It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder.

llvm-svn: 238483

9 years agoCOFF: Split Driver.cpp to Driver.cpp and DriverUtils.cpp. NFC.
Rui Ueyama [Thu, 28 May 2015 20:30:06 +0000 (20:30 +0000)]
COFF: Split Driver.cpp to Driver.cpp and DriverUtils.cpp. NFC.

The previous implementation's driver file is cluttered by lots of
small functions, and it was hard to find important functions.
Make a separate file to prevent that issue.

llvm-svn: 238482

9 years agoObject, ELF: Use error code instead of calling report_fatal_error()
Alexey Samsonov [Thu, 28 May 2015 20:25:42 +0000 (20:25 +0000)]
Object, ELF: Use error code instead of calling report_fatal_error()

Make createELFObjectFile() return object_error::parse_failed on
encountering invalid ELF file, instead of crashing the program.

llvm-svn: 238481

9 years agoRemove structure field that can be computed just before use.
Rafael Espindola [Thu, 28 May 2015 20:25:29 +0000 (20:25 +0000)]
Remove structure field that can be computed just before use.

llvm-svn: 238480

9 years agoAvoid warnings when building without asserts.
Rafael Espindola [Thu, 28 May 2015 20:19:31 +0000 (20:19 +0000)]
Avoid warnings when building without asserts.

llvm-svn: 238479

9 years agoRename InputFile::Name -> InputFile::Filename.
Rui Ueyama [Thu, 28 May 2015 20:16:25 +0000 (20:16 +0000)]
Rename InputFile::Name -> InputFile::Filename.

Other local variables shadowed the member variable.
Rename to make that a bit longer.

llvm-svn: 238478

9 years agoMove these vectors to the only function where they are used.
Rafael Espindola [Thu, 28 May 2015 20:11:34 +0000 (20:11 +0000)]
Move these vectors to the only function where they are used.

llvm-svn: 238477

9 years agoIf we see an external function in the symbols, make
Sean Callanan [Thu, 28 May 2015 20:07:44 +0000 (20:07 +0000)]
If we see an external function in the symbols, make
it an extern "C" function instead of a C++ function
so that Clang doesn't emit a mangled function reference.

Also removed the hack in ClangExpressionDeclMap that
works around this.

llvm-svn: 238476

9 years agoDon't crash if we don't have a process and need
Sean Callanan [Thu, 28 May 2015 20:06:40 +0000 (20:06 +0000)]
Don't crash if we don't have a process and need
to check for alternate manglings.

llvm-svn: 238475

9 years agoFix non-debug build.
Rui Ueyama [Thu, 28 May 2015 20:04:51 +0000 (20:04 +0000)]
Fix non-debug build.

llvm-svn: 238474

9 years agoThumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM.
Peter Collingbourne [Thu, 28 May 2015 20:02:45 +0000 (20:02 +0000)]
Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM.

We were previously codegen'ing these as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach
the register allocator to allocate the registers in ascending order. This
never got implemented, and up to now we've been stuck with very poor codegen.

A much simpler approach for achiveing better codegen is to create LDM/STM
instructions with identical sets of virtual registers, let the register
allocator pick arbitrary registers and order register lists when printing an
MCInst. This approach also avoids the need to repeatedly calculate offsets
which ultimately ought to be eliminated pre-RA in order to decrease register
pressure.

This is implemented by lowering the memcpy intrinsic to a series of SD-only
MCOPY pseudo-instructions which performs a memory copy using a given number
of registers. During SD->MI lowering, we lower MCOPY to LDM/STM. This is a
little unusual, but it avoids the need to encode register lists in the SD,
and we can take advantage of SD use lists to decide whether to use the _UPD
variant of the instructions.

Fixes PR9199.

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

llvm-svn: 238473

9 years ago[WinEH] Remove debugging dump() call
Reid Kleckner [Thu, 28 May 2015 20:02:05 +0000 (20:02 +0000)]
[WinEH] Remove debugging dump() call

llvm-svn: 238472

9 years agoMerge redundant loops. NFC.
Rafael Espindola [Thu, 28 May 2015 20:00:13 +0000 (20:00 +0000)]
Merge redundant loops. NFC.

llvm-svn: 238471

9 years agoRemove unused #includes of ScriptInterpreterPython.h
Zachary Turner [Thu, 28 May 2015 19:57:03 +0000 (19:57 +0000)]
Remove unused #includes of ScriptInterpreterPython.h

llvm-svn: 238470

9 years agoIncluding <thread> with MSVC is buggy, use a workaround here.
Zachary Turner [Thu, 28 May 2015 19:56:43 +0000 (19:56 +0000)]
Including <thread> with MSVC is buggy, use a workaround here.

llvm-svn: 238469

9 years agoAsmPrinter: Stop exposing underlying DIE children list, NFC
Duncan P. N. Exon Smith [Thu, 28 May 2015 19:56:34 +0000 (19:56 +0000)]
AsmPrinter: Stop exposing underlying DIE children list, NFC

Update `DIE` API to hide the implementation of `DIE::Children` so we can
swap it out.

llvm-svn: 238468

9 years agoRefactor test runner to print sub-test-case pass/fail rate.
Zachary Turner [Thu, 28 May 2015 19:56:26 +0000 (19:56 +0000)]
Refactor test runner to print sub-test-case pass/fail rate.

llvm-svn: 238467

9 years ago[Format] Skip creating temporary std::strings when filling another string.
Benjamin Kramer [Thu, 28 May 2015 19:55:49 +0000 (19:55 +0000)]
[Format] Skip creating temporary std::strings when filling another string.

No functional change intended.

llvm-svn: 238466

9 years agoSimplify LastLocalSymbolIndex computation. NFC.
Rafael Espindola [Thu, 28 May 2015 19:46:36 +0000 (19:46 +0000)]
Simplify LastLocalSymbolIndex computation. NFC.

llvm-svn: 238465

9 years agoCOFF: Teach Chunk to write to a mmap'ed output file.
Rui Ueyama [Thu, 28 May 2015 19:45:43 +0000 (19:45 +0000)]
COFF: Teach Chunk to write to a mmap'ed output file.

Previously Writer directly handles writes to a file.
Chunks needed to give Writer a continuous chunk of memory.
That was inefficent if you construct data in chunks because
it would require two memory copies (one to construct a chunk
and the other is to write that to a file).

This patch teaches chunk to write directly to a file.
From readability point of view, this is also good because
you no longer have to call hasData() before calling getData().

llvm-svn: 238464

9 years agoUse range loops. NFC.
Rafael Espindola [Thu, 28 May 2015 19:43:20 +0000 (19:43 +0000)]
Use range loops. NFC.

llvm-svn: 238463

9 years agoAdd BranchProbabilityInfo::releaseMemory to clear the Weights field.
Pete Cooper [Thu, 28 May 2015 19:43:06 +0000 (19:43 +0000)]
Add BranchProbabilityInfo::releaseMemory to clear the Weights field.

BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'.  This was due to the Weights member not being cleared once the pass is no longer needed.

This adds the releaseMemory override to clear that field.  The other fields are cleared at the end of runOnFunction so can stay there.

llvm-svn: 238462

9 years agoRemove temporary FileSymbolData. NFC.
Rafael Espindola [Thu, 28 May 2015 19:29:15 +0000 (19:29 +0000)]
Remove temporary FileSymbolData. NFC.

llvm-svn: 238461