platform/upstream/llvm.git
9 years agoCOFF: /libpath should not take precedence over the current directory.
Rui Ueyama [Sun, 31 May 2015 20:20:37 +0000 (20:20 +0000)]
COFF: /libpath should not take precedence over the current directory.

llvm-svn: 238683

9 years agoCOFF: Add /libpath option.
Rui Ueyama [Sun, 31 May 2015 20:10:11 +0000 (20:10 +0000)]
COFF: Add /libpath option.

llvm-svn: 238682

9 years agoCOFF: Add /include option.
Rui Ueyama [Sun, 31 May 2015 19:55:40 +0000 (19:55 +0000)]
COFF: Add /include option.

It does not involve notions of virtual archives or virtual files,
nor store a list of undefined symbols somewhere else to consume them later.
We did that before. In this patch, undefined symbols are just added to
the symbol table, which now can be done in very few lines of code.

llvm-svn: 238681

9 years agoARM: recommit r237590: allow jump tables to be placed as constant islands.
Tim Northover [Sun, 31 May 2015 19:22:07 +0000 (19:22 +0000)]
ARM: recommit r237590: allow jump tables to be placed as constant islands.

The original version didn't properly account for the base register
being modified before the final jump, so caused miscompilations in
Chromium and LLVM. I've fixed this and tested with an LLVM self-host
(I don't have the means to build & test Chromium).

The general idea remains the same: in pathological cases jump tables
can be too far away from the instructions referencing them (like other
constants) so they need to be movable.

Should fix PR23627.

llvm-svn: 238680

9 years agoCOFF: Add /nodefaultlib option.
Rui Ueyama [Sun, 31 May 2015 19:17:14 +0000 (19:17 +0000)]
COFF: Add /nodefaultlib option.

llvm-svn: 238679

9 years agoCOFF: Refactor functions to find files from search paths.
Rui Ueyama [Sun, 31 May 2015 19:17:12 +0000 (19:17 +0000)]
COFF: Refactor functions to find files from search paths.

llvm-svn: 238678

9 years agoCOFF: Create LinkerDriver class.
Rui Ueyama [Sun, 31 May 2015 19:17:09 +0000 (19:17 +0000)]
COFF: Create LinkerDriver class.

Previously the main linker routine is just a non-member function.
We store some context information to the Config object.
This patch makes it belong to Driver.

llvm-svn: 238677

9 years ago[MC] Simplify code. No functionality change intended.
Benjamin Kramer [Sun, 31 May 2015 18:49:28 +0000 (18:49 +0000)]
[MC] Simplify code. No functionality change intended.

llvm-svn: 238676

9 years agoCOFF: Use range-based for loop.
Rui Ueyama [Sun, 31 May 2015 16:10:50 +0000 (16:10 +0000)]
COFF: Use range-based for loop.

llvm-svn: 238675

9 years agoRemove debugging code
Marshall Clow [Sun, 31 May 2015 14:01:54 +0000 (14:01 +0000)]
Remove debugging code

llvm-svn: 238674

9 years ago[Format] Move UnwrappedLines instead of copying.
Benjamin Kramer [Sun, 31 May 2015 11:18:05 +0000 (11:18 +0000)]
[Format] Move UnwrappedLines instead of copying.

No functional change intended.

llvm-svn: 238673

9 years agoclang-format: NFC. Cleanup after r237895.
Daniel Jasper [Sun, 31 May 2015 08:51:54 +0000 (08:51 +0000)]
clang-format: NFC. Cleanup after r237895.

Specifically adhere to LLVM Coding Standards (no 'else' after
return/break/continue) and remove yet another implementation of
paren counting. We already have enough of those in the
UnwrappedLineParser.

No functional changes intended.

llvm-svn: 238672

9 years agoclang-format: [JS] Fix line breaks in computed property names.
Daniel Jasper [Sun, 31 May 2015 08:40:37 +0000 (08:40 +0000)]
clang-format: [JS] Fix line breaks in computed property names.

Before:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

After:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2,
    [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

llvm-svn: 238671

9 years agoCOFF: Remove redundant options from tests.
Rui Ueyama [Sun, 31 May 2015 04:21:30 +0000 (04:21 +0000)]
COFF: Remove redundant options from tests.

llvm-svn: 238670

9 years agoFix unsafe memory access.
Rui Ueyama [Sun, 31 May 2015 03:57:30 +0000 (03:57 +0000)]
Fix unsafe memory access.

llvm-svn: 238669

9 years agoCOFF: Implement subsystem inference.
Rui Ueyama [Sun, 31 May 2015 03:55:46 +0000 (03:55 +0000)]
COFF: Implement subsystem inference.

llvm-svn: 238668

9 years agoCOFF: Infer entry symbol name if /entry is not given.
Rui Ueyama [Sun, 31 May 2015 03:34:08 +0000 (03:34 +0000)]
COFF: Infer entry symbol name if /entry is not given.

`main` is not the only main function in Windows. You can choose one
from these four -- {w,}{WinMain,main}. There are four different entry
point functions for them, {w,}{WinMain,main}CRTStartup, respectively.
The linker needs to choose the right one depending on which `main`
function is defined.

llvm-svn: 238667

9 years agoDon't try to memcpy zero bytes; sometimes the source pointer is NULL, and that's...
Marshall Clow [Sun, 31 May 2015 03:13:31 +0000 (03:13 +0000)]
Don't try to memcpy zero bytes; sometimes the source pointer is NULL, and that's UB. Thanks to Nuno Lopes for the catch.

llvm-svn: 238666

9 years agoClarify how the binary file checked in was generated.
Davide Italiano [Sat, 30 May 2015 22:43:36 +0000 (22:43 +0000)]
Clarify how the binary file checked in was generated.

llvm-svn: 238665

9 years ago[Hexagon] Adding override specifier and removing erroneous assertion
Colin LeMahieu [Sat, 30 May 2015 20:03:07 +0000 (20:03 +0000)]
[Hexagon] Adding override specifier and removing erroneous assertion

llvm-svn: 238664

9 years agoAdd RelocVisitor support for MachO
Keno Fischer [Sat, 30 May 2015 19:44:53 +0000 (19:44 +0000)]
Add RelocVisitor support for MachO

This commit adds partial support for MachO relocations to RelocVisitor.
A simple test case is added to show that relocations are indeed being
applied and that using llvm-dwarfdump on MachO files no longer errors.
Correctness is not yet tested, due to an unrelated bug in DebugInfo,
which will be fixed with appropriate testcase in a followup commit.

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

llvm-svn: 238663

9 years agoUse initializer instead of memset to zero out.
Rui Ueyama [Sat, 30 May 2015 19:28:58 +0000 (19:28 +0000)]
Use initializer instead of memset to zero out.

llvm-svn: 238662

9 years agoCOFF: Support long section name.
Rui Ueyama [Sat, 30 May 2015 19:09:50 +0000 (19:09 +0000)]
COFF: Support long section name.

Section names were truncated to 8 bytes because the section table's
name field is 8 byte long. This patch creates the string table to
store long names.

llvm-svn: 238661

9 years ago[Hexagon] Adding basic relaxation functionality.
Colin LeMahieu [Sat, 30 May 2015 18:55:47 +0000 (18:55 +0000)]
[Hexagon] Adding basic relaxation functionality.

llvm-svn: 238660

9 years ago[MC] Allow backends to decide relaxation for unresolved fixups.
Colin LeMahieu [Sat, 30 May 2015 18:42:22 +0000 (18:42 +0000)]
[MC] Allow backends to decide relaxation for unresolved fixups.

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

llvm-svn: 238659

9 years ago[lib/Fuzzer] make assertions more informative and update comments for the user-suppli...
Kostya Serebryany [Sat, 30 May 2015 17:33:13 +0000 (17:33 +0000)]
[lib/Fuzzer] make assertions more informative and update comments for the user-supplied mutator

llvm-svn: 238658

9 years agoubsan: Check for null pointers given to certain builtins, such
Nuno Lopes [Sat, 30 May 2015 16:11:40 +0000 (16:11 +0000)]
ubsan: Check for null pointers given to certain builtins, such
as memcpy, memset, memmove, and bzero.

Reviewed by: Richard Smith

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

llvm-svn: 238657

9 years agoCode cleanup: Reindent statements.
Logan Chien [Sat, 30 May 2015 14:00:39 +0000 (14:00 +0000)]
Code cleanup: Reindent statements.

llvm-svn: 238656

9 years ago[MC] Reorder MCSymbol members to reduce padding.
Benjamin Kramer [Sat, 30 May 2015 13:52:30 +0000 (13:52 +0000)]
[MC] Reorder MCSymbol members to reduce padding.

sizeof(MCSymbol) goes from 72 to 64 bytes on x86_64.

llvm-svn: 238655

9 years agoStripped trailing whitespace. NFC.
Simon Pilgrim [Sat, 30 May 2015 13:01:42 +0000 (13:01 +0000)]
Stripped trailing whitespace. NFC.

llvm-svn: 238654

9 years agoComment change. NFC
Renato Golin [Sat, 30 May 2015 10:44:07 +0000 (10:44 +0000)]
Comment change. NFC

That comment misleads the current discussions in mentioned bug. Leave
the discussions to the bug. Also, adding a future change FIXME.

llvm-svn: 238653

9 years ago[x86] Unify the horizontal adding used for popcount lowering taking the
Chandler Carruth [Sat, 30 May 2015 10:35:03 +0000 (10:35 +0000)]
[x86] Unify the horizontal adding used for popcount lowering taking the
best approach of each.

For vNi16, we use SHL + ADD + SRL pattern that seem easily the best.

For vNi32, we use the PUNPCK + PSADBW + PACKUSWB pattern. In some cases
there is a huge improvement with this in IACA's estimated throughput --
over 2x higher throughput!!!! -- but the measurements are too good to be
true. In one narrow case, the SHL + ADD + SHL + ADD + SRL pattern looks
slightly faster, but I'm not sure I believe any of the measurements at
this point. Both are the exact same uops though. Hard to be confident of
anything past that.

If anyone wants to collect very detailed (Agner-level) timings with the
result of this patch, or with the i32 case replaced with SHL + ADD + SHl
+ ADD + SRL, I'd be very interested. Note that you'll need to test it on
both Ivybridge and Haswell, with both SSE3, SSSE3, and AVX selected as
I saw unique behavior in each of these buckets with IACA all of which
should be checked against measured performance.

But this patch is still a useful improvement by dropping duplicate work
and getting the much nicer PSADBW lowering for v2i64.

I'd still like to rephrase this in terms of generic horizontal sum. It's
a bit lame to have a special case of that just for popcount.

llvm-svn: 238652

9 years ago[ARMTargetParser] Move IAS arch ext parser. NFC
Renato Golin [Sat, 30 May 2015 10:30:02 +0000 (10:30 +0000)]
[ARMTargetParser] Move IAS arch ext parser. NFC

The plan was to move the whole table into the already existing ArchExtNames
but some fields depend on a table-generated file, and we don't yet have this
feature in the generic lib/Support side.

Once the minimum target-specific table-generated files are available in a
generic fashion to these libraries, we'll have to keep it in the ASM parser.

llvm-svn: 238651

9 years ago[x86] Split out the horizontal byte sum lowering component of the LUT
Chandler Carruth [Sat, 30 May 2015 09:46:16 +0000 (09:46 +0000)]
[x86] Split out the horizontal byte sum lowering component of the LUT
lowering into a helper function.

NFC.

llvm-svn: 238650

9 years ago[CodeGen] Indirect fields can initialize a union
David Majnemer [Sat, 30 May 2015 09:12:07 +0000 (09:12 +0000)]
[CodeGen] Indirect fields can initialize a union

The first named data member is the field used to default initialize the
union.  An IndirectFieldDecl can introduce the first named data member
of a union.

llvm-svn: 238649

9 years ago[TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFC
Craig Topper [Sat, 30 May 2015 07:36:01 +0000 (07:36 +0000)]
[TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFC

typeIsConvertibleTo was just calling baseClassOf(this) on the argument passed to it, but there weren't different signatures for baseClassOf so passing 'this' didn't really do anything interesting. typeIsConvertibleTo could have just been a non-virtual method in RecTy. But since that would be kind of a silly method, I instead re-distributed the logic from baseClassOf into typeIsConvertibleTo.

llvm-svn: 238648

9 years agoFix indentation. NFC.
Craig Topper [Sat, 30 May 2015 07:35:21 +0000 (07:35 +0000)]
Fix indentation. NFC.

llvm-svn: 238647

9 years ago[TableGen] Remove all the variations of RecTy::convertValue and just handle the conve...
Craig Topper [Sat, 30 May 2015 07:34:51 +0000 (07:34 +0000)]
[TableGen] Remove all the variations of RecTy::convertValue and just handle the conversions in convertInitializerTo directly. This saves a bunch of vtable entries. NFC

llvm-svn: 238646

9 years agoDump YAML schedule tree as properly indented tree in DEBUG output
Tobias Grosser [Sat, 30 May 2015 06:46:59 +0000 (06:46 +0000)]
Dump YAML schedule tree as properly indented tree in DEBUG output

llvm-svn: 238645

9 years agoAdd DEBUG output to -polly-scops pass
Tobias Grosser [Sat, 30 May 2015 06:26:21 +0000 (06:26 +0000)]
Add DEBUG output to -polly-scops pass

llvm-svn: 238644

9 years agoAdd indvar pass to canonicalization sequence
Tobias Grosser [Sat, 30 May 2015 06:16:41 +0000 (06:16 +0000)]
Add indvar pass to canonicalization sequence

Running indvar before Polly is useful as this eliminates zexts as they commonly
appear when a 32 bit induction variable (type int) was used on a 64 bit system.
These zexts confuse our delinearization and prevent for example the successful
delinearization of the nussinov kernel in polybench-c-4.1.

This fixes http://llvm.org/PR23426

Suggested-by: Xing Su <xsu.llvm@outlook.com>
llvm-svn: 238643

9 years ago[x86] Update the order of instructions after I switched to a bitcast
Chandler Carruth [Sat, 30 May 2015 06:02:37 +0000 (06:02 +0000)]
[x86] Update the order of instructions after I switched to a bitcast
helper that skips creating a cast when it isn't necessary.

It's really somewhat concerning that this was caused by the the presence
of a no-op bitcast, but...

llvm-svn: 238642

9 years ago[WinCOFF] Add support for the .safeseh directive
David Majnemer [Sat, 30 May 2015 04:56:02 +0000 (04:56 +0000)]
[WinCOFF] Add support for the .safeseh directive

.safeseh adds an entry to the .sxdata section to register all the
appropriate functions which may handle an exception.  This entry is not
a relocation to the symbol but instead the symbol table index of the
function.

llvm-svn: 238641

9 years ago[x86] Replace the long spelling of getting a bitcast with the *much*
Chandler Carruth [Sat, 30 May 2015 04:23:13 +0000 (04:23 +0000)]
[x86] Replace the long spelling of getting a bitcast with the *much*
shorter one. NFC.

In addition to being much shorter to type and requiring fewer arguments,
this change saves over 30 lines from this one file, all wasted on total
boilerplate...

llvm-svn: 238640

9 years ago[x86] Replace the long spelling of getting a bitcast with the new short
Chandler Carruth [Sat, 30 May 2015 04:19:57 +0000 (04:19 +0000)]
[x86] Replace the long spelling of getting a bitcast with the new short
spelling. NFC.

llvm-svn: 238639

9 years ago[sdag] Add the helper I most want to the DAG -- building a bitcast
Chandler Carruth [Sat, 30 May 2015 04:14:10 +0000 (04:14 +0000)]
[sdag] Add the helper I most want to the DAG -- building a bitcast
around a value using its existing SDLoc.

Start using this in just one function to save omg lines of code.

llvm-svn: 238638

9 years ago[x86] Restore the bitcasts I removed when refactoring this to avoid
Chandler Carruth [Sat, 30 May 2015 04:05:11 +0000 (04:05 +0000)]
[x86] Restore the bitcasts I removed when refactoring this to avoid
shifting vectors of bytes as x86 doesn't have direct support for that.

This removes a bunch of redundant masking in the generated code for SSE2
and SSE3.

In order to avoid the really significant code size growth this would
have triggered, I also factored the completely repeatative logic for
shifting and masking into two lambdas which in turn makes all of this
much easier to read IMO.

llvm-svn: 238637

9 years ago[x86] Implement a faster vector population count based on the PSHUFB
Chandler Carruth [Sat, 30 May 2015 03:20:59 +0000 (03:20 +0000)]
[x86] Implement a faster vector population count based on the PSHUFB
in-register LUT technique.

Summary:
A description of this technique can be found here:
http://wm.ite.pl/articles/sse-popcount.html

The core of the idea is to use an in-register lookup table and the
PSHUFB instruction to compute the population count for the low and high
nibbles of each byte, and then to use horizontal sums to aggregate these
into vector population counts with wider element types.

On x86 there is an instruction that will directly compute the horizontal
sum for the low 8 and high 8 bytes, giving vNi64 popcount very easily.
Various tricks are used to get vNi32 and vNi16 from the vNi8 that the
LUT computes.

The base implemantion of this, and most of the work, was done by Bruno
in a follow up to D6531. See Bruno's detailed post there for lots of
timing information about these changes.

I have extended Bruno's patch in the following ways:

0) I committed the new tests with baseline sequences so this shows
   a diff, and regenerated the tests using the update scripts.

1) Bruno had noticed and mentioned in IRC a redundant mask that
   I removed.

2) I introduced a particular optimization for the i32 vector cases where
   we use PSHL + PSADBW to compute the the low i32 popcounts, and PSHUFD
   + PSADBW to compute doubled high i32 popcounts. This takes advantage
   of the fact that to line up the high i32 popcounts we have to shift
   them anyways, and we can shift them by one fewer bit to effectively
   divide the count by two. While the PSHUFD based horizontal add is no
   faster, it doesn't require registers or load traffic the way a mask
   would, and provides more ILP as it happens on different ports with
   high throughput.

3) I did some code cleanups throughout to simplify the implementation
   logic.

4) I refactored it to continue to use the parallel bitmath lowering when
   SSSE3 is not available to preserve the performance of that version on
   SSE2 targets where it is still much better than scalarizing as we'll
   still do a bitmath implementation of popcount even in scalar code
   there.

With #1 and #2 above, I analyzed the result in IACA for sandybridge,
ivybridge, and haswell. In every case I measured, the throughput is the
same or better using the LUT lowering, even v2i64 and v4i64, and even
compared with using the native popcnt instruction! The latency of the
LUT lowering is often higher than the latency of the scalarized popcnt
instruction sequence, but I think those latency measurements are deeply
misleading. Keeping the operation fully in the vector unit and having
many chances for increased throughput seems much more likely to win.

With this, we can lower every integer vector popcount implementation
using the LUT strategy if we have SSSE3 or better (and thus have
PSHUFB). I've updated the operation lowering to reflect this. This also
fixes an issue where we were scalarizing horribly some AVX lowerings.

Finally, there are some remaining cleanups. There is duplication between
the two techniques in how they perform the horizontal sum once the byte
population count is computed. I'm going to factor and merge those two in
a separate follow-up commit.

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

llvm-svn: 238636

9 years ago[x86] Restructure the parallel bitmath lowering of popcount into
Chandler Carruth [Sat, 30 May 2015 03:20:55 +0000 (03:20 +0000)]
[x86] Restructure the parallel bitmath lowering of popcount into
a separate routine, generalize it to work for all the integer vector
sizes, and do general code cleanups.

This dramatically improves lowerings of byte and short element vector
popcount, but more importantly it will make the introduction of the
LUT-approach much cleaner.

The biggest cleanup I've done is to just force the legalizer to do the
bitcasting we need. We run these iteratively now and it makes the code
much simpler IMO. Other changes were minor, and mostly naming and
splitting things up in a way that makes it more clear what is going on.

The other significant change is to use a different final horizontal sum
approach. This is the same number of instructions as the old method, but
shifts left instead of right so that we can clear everything but the
final sum with a single shift right. This seems likely better than
a mask which will usually have to read the mask from memory. It is
certaily fewer u-ops. Also, this will be temporary. This and the LUT
approach share the need of horizontal adds to finish the computation,
and we have more clever approaches than this one that I'll switch over
to.

llvm-svn: 238635

9 years agoMC: Clean up MCExpr naming. NFC.
Jim Grosbach [Sat, 30 May 2015 01:25:56 +0000 (01:25 +0000)]
MC: Clean up MCExpr naming. NFC.

llvm-svn: 238634

9 years ago[BitcodeReader] Change an assert to a call to a call to Error()
Filipe Cabecinhas [Sat, 30 May 2015 00:17:20 +0000 (00:17 +0000)]
[BitcodeReader] Change an assert to a call to a call to Error()

It's reachable from user input.

Bug found with AFL fuzz.

llvm-svn: 238633

9 years agoSelectionDAG: fix logic for promoting shift types
Fiona Glaser [Fri, 29 May 2015 23:37:22 +0000 (23:37 +0000)]
SelectionDAG: fix logic for promoting shift types

r238503 fixed the problem of too-small shift types by promoting them
during legalization, but the correct solution is to promote only the
operands that actually demand promotion.

This fixes a crash on an out-of-tree target caused by trying to
promote an operand that can't be promoted.

llvm-svn: 238632

9 years agoAdd TODO note about switching to __decltype
Eric Fiselier [Fri, 29 May 2015 23:21:03 +0000 (23:21 +0000)]
Add TODO note about switching to __decltype

llvm-svn: 238631

9 years agoFix 80-column violations.
Eric Christopher [Fri, 29 May 2015 23:09:49 +0000 (23:09 +0000)]
Fix 80-column violations.

llvm-svn: 238630

9 years agoFix inferior's i/o connections to its console window on Windows 7.
Adrian McCarthy [Fri, 29 May 2015 23:01:25 +0000 (23:01 +0000)]
Fix inferior's i/o connections to its console window on Windows 7.

llvm-svn: 238629

9 years agoclang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the...
NAKAMURA Takumi [Fri, 29 May 2015 22:58:05 +0000 (22:58 +0000)]
clang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the standalone configuration.

llvm-svn: 238628

9 years ago[WinEH] Adjust the 32-bit SEH prologue to better match reality
Reid Kleckner [Fri, 29 May 2015 22:57:46 +0000 (22:57 +0000)]
[WinEH] Adjust the 32-bit SEH prologue to better match reality

It turns out that _except_handler3 and _except_handler4 really use the
same stack allocation layout, at least today. They just make different
choices about encoding the LSDA.

This is in preparation for lowering the llvm.eh.exceptioninfo().

llvm-svn: 238627

9 years ago[sanitizer] Add -lrt to dyndd link line.
Evgeniy Stepanov [Fri, 29 May 2015 22:57:15 +0000 (22:57 +0000)]
[sanitizer] Add -lrt to dyndd link line.

llvm-svn: 238626

9 years ago[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.
Ahmed Bougacha [Fri, 29 May 2015 22:54:57 +0000 (22:54 +0000)]
[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.

We catch most of the various other __fp16 implicit conversions to
float, but not this one:

  __fp16 a;
  int i;
  ...
  a += i;

For which we used to generate something 'fun' like:

  %conv = sitofp i32 %i to float
  %1 = tail call i16 @llvm.convert.to.fp16.f32(float %conv)
  %add = add i16 %0, %1

Instead, when we have an __fp16 LHS and an integer RHS, we should
use float as the result type.

While there, add a bunch of missing tests for mixed
__fp16/integer expressions.

llvm-svn: 238625

9 years agoUse FileSpec::IsRelativeToCurrentWorkingDirectory instead of llvm::sys::path::is_rela...
Oleksiy Vyalov [Fri, 29 May 2015 22:54:45 +0000 (22:54 +0000)]
Use FileSpec::IsRelativeToCurrentWorkingDirectory instead of llvm::sys::path::is_relative in PlatformAndroid::GetFile.

http://reviews.llvm.org/D10141

llvm-svn: 238624

9 years agoLeave OS type and vendor as unspecified unknowns.
Oleksiy Vyalov [Fri, 29 May 2015 22:45:47 +0000 (22:45 +0000)]
Leave OS type and vendor as unspecified unknowns.

http://reviews.llvm.org/D10080

llvm-svn: 238623

9 years agoprofile: Fix link errors in this test on darwin
Justin Bogner [Fri, 29 May 2015 22:41:25 +0000 (22:41 +0000)]
profile: Fix link errors in this test on darwin

llvm-svn: 238622

9 years agoAdd descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.
Evgeniy Stepanov [Fri, 29 May 2015 22:31:28 +0000 (22:31 +0000)]
Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.

This is done by creating a named shared memory region, unlinking it
and setting up a private (i.e. copy-on-write) mapping of that instead
of a regular anonymous mapping. I've experimented with regular
(sparse) files, but they can not be scaled to the size of MSan shadow
mapping, at least on Linux/X86_64 and ext3 fs.

Controlled by a common flag, decorate_proc_maps, disabled by default.

This patch has a few shortcomings:
* not all mappings are annotated, especially in TSan.
* our handling of memset() of shadow via mmap() puts small anonymous
  mappings inside larger named mappings, which looks ugly and can, in
  theory, hit the mapping number limit.

llvm-svn: 238621

9 years ago[docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics
Jingyue Wu [Fri, 29 May 2015 22:18:03 +0000 (22:18 +0000)]
[docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics

Summary:
These intrinsics should take a generic input address space and outputs a
non-generic address space.

Test Plan: no

Reviewers: jholewinski, eliben

Reviewed By: eliben

Subscribers: eliben, jholewinski, llvm-commits

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

llvm-svn: 238620

9 years agoDisable FP elimination in funcs using 32-bit MSVC EH personalities
Reid Kleckner [Fri, 29 May 2015 21:58:11 +0000 (21:58 +0000)]
Disable FP elimination in funcs using 32-bit MSVC EH personalities

The value in 'ebp' acts as an implicit argument to the outlined
handlers, and is recovered with frameaddress(1).

llvm-svn: 238619

9 years agoCOFF: Move machine type auto-detection to SymbolTable.
Peter Collingbourne [Fri, 29 May 2015 21:47:36 +0000 (21:47 +0000)]
COFF: Move machine type auto-detection to SymbolTable.

The new mechanism is less code, and fixes the case where all inputs
are archives.

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

llvm-svn: 238618

9 years agoRemove getData.
Rafael Espindola [Fri, 29 May 2015 21:45:01 +0000 (21:45 +0000)]
Remove getData.

This completes the mechanical part of merging MCSymbol and MCSymbolData.

llvm-svn: 238617

9 years agoXFAIL additional signal vs exception tests failing on FreeBSD
Ed Maste [Fri, 29 May 2015 21:42:53 +0000 (21:42 +0000)]
XFAIL additional signal vs exception tests failing on FreeBSD

We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238616

9 years agoXFAIL TestHandleSegv on FreeBSD
Ed Maste [Fri, 29 May 2015 21:34:12 +0000 (21:34 +0000)]
XFAIL TestHandleSegv on FreeBSD

We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238615

9 years agoARM: fix ACLE predefine for iOS's "-arch armv7s".
Tim Northover [Fri, 29 May 2015 21:28:25 +0000 (21:28 +0000)]
ARM: fix ACLE predefine for iOS's "-arch armv7s".

We were getting "#define __ARM_ARCH_7 -S__ 1" which is really not a good idea.

llvm-svn: 238614

9 years agoOnly add the EH state insertion pass on 32-bit Windows
Reid Kleckner [Fri, 29 May 2015 20:43:10 +0000 (20:43 +0000)]
Only add the EH state insertion pass on 32-bit Windows

llvm-svn: 238612

9 years agoRemove the MCSymbolData typedef.
Rafael Espindola [Fri, 29 May 2015 20:41:47 +0000 (20:41 +0000)]
Remove the MCSymbolData typedef.

The getData member function is next.

llvm-svn: 238611

9 years agoFix build - GetRemoteWorkingDirectory returns FileSpec instead of ConstString.
Oleksiy Vyalov [Fri, 29 May 2015 20:32:26 +0000 (20:32 +0000)]
Fix build - GetRemoteWorkingDirectory returns FileSpec instead of ConstString.

llvm-svn: 238610

9 years agoMerge MCSymbol and MCSymbolData.
Rafael Espindola [Fri, 29 May 2015 20:31:23 +0000 (20:31 +0000)]
Merge MCSymbol and MCSymbolData.

As a transition hack leave MCSymbolData as a typedef of MCSymbol. I will be
removing that in a second.

llvm-svn: 238609

9 years ago[lib/Fuzzer] relax an assertion
Kostya Serebryany [Fri, 29 May 2015 20:31:17 +0000 (20:31 +0000)]
[lib/Fuzzer] relax an assertion

llvm-svn: 238608

9 years agoRename getOrCreateSymbolData to registerSymbol and return void.
Rafael Espindola [Fri, 29 May 2015 20:21:02 +0000 (20:21 +0000)]
Rename getOrCreateSymbolData to registerSymbol and return void.

Another step in merging MCSymbol and MCSymbolData.

llvm-svn: 238607

9 years agoFix PlatformAndroid::GetFile - check for relative source path and concatenate it...
Oleksiy Vyalov [Fri, 29 May 2015 20:02:07 +0000 (20:02 +0000)]
Fix PlatformAndroid::GetFile - check for relative source path and concatenate it with current working directory if needed.

llvm-svn: 238606

9 years agoWorking directory FileSpec should use remote path syntax to display correctly.
Chaoren Lin [Fri, 29 May 2015 19:52:37 +0000 (19:52 +0000)]
Working directory FileSpec should use remote path syntax to display correctly.

Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238605

9 years agoRefactor many file functions to use FileSpec over strings.
Chaoren Lin [Fri, 29 May 2015 19:52:29 +0000 (19:52 +0000)]
Refactor many file functions to use FileSpec over strings.

Summary:
This should solve the issue of sending denormalized paths over gdb-remote
if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the
server handle any denormalization.

Reviewers: ovyalov, zturner, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, emaste, lldb-commits

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

llvm-svn: 238604

9 years agoImprove test for g++ 4.6
Ed Maste [Fri, 29 May 2015 19:52:02 +0000 (19:52 +0000)]
Improve test for g++ 4.6

Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

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

llvm-svn: 238603

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:43:39 +0000 (19:43 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238602

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:42:19 +0000 (19:42 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238601

9 years agoTestHandleSegv: also assert that we have a thread
Ed Maste [Fri, 29 May 2015 19:38:41 +0000 (19:38 +0000)]
TestHandleSegv: also assert that we have a thread

If get_stopped_thread(... eStopReasonSignal) returns no thread, the
thread.IsValid assertion would throw AttributeError: 'NoneType' object
has no attribute 'IsValid'.

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

llvm-svn: 238600

9 years agoImplement snprintf for MSVC with correct return value.
Chaoren Lin [Fri, 29 May 2015 19:34:57 +0000 (19:34 +0000)]
Implement snprintf for MSVC with correct return value.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 238599

9 years agoMove Flags from MCSymbolData to MCSymbol.
Rafael Espindola [Fri, 29 May 2015 19:07:51 +0000 (19:07 +0000)]
Move Flags from MCSymbolData to MCSymbol.

llvm-svn: 238598

9 years agoFix build without asserts.
Rafael Espindola [Fri, 29 May 2015 19:04:38 +0000 (19:04 +0000)]
Fix build without asserts.

llvm-svn: 238597

9 years agoPass MCSymbols to the helper functions in MCELF.h.
Rafael Espindola [Fri, 29 May 2015 18:47:23 +0000 (18:47 +0000)]
Pass MCSymbols to the helper functions in MCELF.h.

llvm-svn: 238596

9 years agoAdd '+' sign at the end of echo message for debugserver
Ying Chen [Fri, 29 May 2015 18:44:08 +0000 (18:44 +0000)]
Add '+' sign at the end of echo message for debugserver

Summary:
-ammend to r238538
-Fix test failure of TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py on MacOSX

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

Reviewers: chaoren, clayborg

Subscribers: lldb-commits

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

llvm-svn: 238595

9 years agoFix hanging test suite when dosep.py is invoked directly.
Chaoren Lin [Fri, 29 May 2015 18:43:46 +0000 (18:43 +0000)]
Fix hanging test suite when dosep.py is invoked directly.

Reviewers: zturner, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238594

9 years ago[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Chris Bieneman [Fri, 29 May 2015 18:36:20 +0000 (18:36 +0000)]
[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions

Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 238593

9 years ago[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio
Chris Bieneman [Fri, 29 May 2015 18:34:41 +0000 (18:34 +0000)]
[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio

Summary: Multi-configuration builds put their binaries into ${CMAKE_BINARY_DIR}/Release/bin/. The table-gen cross-compilation support needs to take that into account.

Reviewers: yaron.keren

Reviewed By: yaron.keren

Subscribers: llvm-commits

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

llvm-svn: 238592

9 years agoUse an explicitly defaulted constructor.
Rafael Espindola [Fri, 29 May 2015 18:31:17 +0000 (18:31 +0000)]
Use an explicitly defaulted constructor.

llvm-svn: 238591

9 years agoUnbreak mac build.
Greg Clayton [Fri, 29 May 2015 18:28:01 +0000 (18:28 +0000)]
Unbreak mac build.

llvm-svn: 238590

9 years agoPass a MCSymbol to needsRelocateWithSymbol.
Rafael Espindola [Fri, 29 May 2015 18:26:09 +0000 (18:26 +0000)]
Pass a MCSymbol to needsRelocateWithSymbol.

llvm-svn: 238589

9 years agoMachineCopyPropagation: Remove the copies instead of using KILL instructions.
Matthias Braun [Fri, 29 May 2015 18:19:25 +0000 (18:19 +0000)]
MachineCopyPropagation: Remove the copies instead of using KILL instructions.

For some history here see the commit messages of r199797 and r169060.

The original intent was to fix cases like:

%EAX<def> = COPY %ECX<kill>, %RAX<imp-def>
%RCX<def> = COPY %RAX<kill>

where simply removing the copies would have RCX undefined as in terms of
machine operands only the ECX part of it is defined. The machine
verifier would complain about this so 169060 changed such COPY
instructions into KILL instructions so some super-register imp-defs
would be preserved. In r199797 it was finally decided to always do this
regardless of super-register defs.

But this is wrong, consider:
R1 = COPY R0
...
R0 = COPY R1
getting changed to:
R1 = KILL R0
...
R0 = KILL R1

It now looks like R0 dies at the first KILL and won't be alive until the
second KILL, while in reality R0 is alive and must not change in this
part of the program.

As this only happens after register allocation there is not much code
still performing liveness queries so the issue was not noticed.  In fact
I didn't manage to create a testcase for this, without unrelated changes
I am working on at the moment.

The fix is simple: As of r223896 the MachineVerifier allows reads from
partially defined registers, so the whole transforming COPY->KILL thing
is not necessary anymore. This patch also changes a similar (but more
benign case as the def and src are the same register) case in the
VirtRegRewriter.

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

llvm-svn: 238588

9 years agoRe-add #include "lldb-python.h" back in two places.
Zachary Turner [Fri, 29 May 2015 18:18:26 +0000 (18:18 +0000)]
Re-add #include "lldb-python.h" back in two places.

Fixing these two instances will require some work, so for now
I'm adding these 2 includes back to get the build working.

llvm-svn: 238587

9 years agoYAML traits need to be in the llvm::yaml namespace.
Frederic Riss [Fri, 29 May 2015 18:14:55 +0000 (18:14 +0000)]
YAML traits need to be in the llvm::yaml namespace.

Hope this fixes the bits, eg:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/27147

llvm-svn: 238586

9 years agoUse sanitizer_atomic_clang.h with clang-cl instead of the MSVC variant
Reid Kleckner [Fri, 29 May 2015 17:56:39 +0000 (17:56 +0000)]
Use sanitizer_atomic_clang.h with clang-cl instead of the MSVC variant

llvm-svn: 238585

9 years ago[YAMLIO] Make line-wrapping configurable and test it.
Frederic Riss [Fri, 29 May 2015 17:56:28 +0000 (17:56 +0000)]
[YAMLIO] Make line-wrapping configurable and test it.

Summary:
We would wrap flow mappings and sequences when they go over a hardcoded 70
characters limit. Make the wrapping column configurable (and default to 70
co the change should be NFC for current users). Passing 0 allows to completely
suppress the wrapping which makes it easier to handle in tools like FileCheck.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 238584

9 years agoMove common symbol related information from MCSectionData to MCSymbol.
Rafael Espindola [Fri, 29 May 2015 17:48:04 +0000 (17:48 +0000)]
Move common symbol related information from MCSectionData to MCSymbol.

llvm-svn: 238583