Commit Graph

203024 Commits

Author SHA1 Message Date
Davide Italiano d106ab263a [COFF] Spell the namespace correctly.
llvm-svn: 239641
2015-06-12 21:37:55 +00:00
Lang Hames 2e36ddf671 [Orc] Fix a bug in the CompileOnDemand layer where stub decls were not cloned
into partitions. Also, add an option to clone stub definitions (not just decls)
into partitions: these definitions could be inlined in some places to avoid the
overhead of calling via the stub.

Found by inspection - no test case yet, although I plan to add a unit test for
this once the CompileOnDemand layer refactoring settles down.

llvm-svn: 239640
2015-06-12 21:31:15 +00:00
Hans Wennborg b274738725 [ms] Don't try to delay lookup for failures in SFINAE context (PR23823)
The underlying problem in PR23823 already existed before my recent change
in r239558, but that change made it worse (failing not only for undeclared
symbols, but also failed overload resolution). This makes Clang not try to
delay the lookup in SFINAE context. I assume no current code is relying on
SFINAE working with lookups that need to be delayed, because that never
seems to have worked.

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

llvm-svn: 239639
2015-06-12 21:23:23 +00:00
Alexey Samsonov 1054420ba3 [CGCall] Fix potential invalid iterator decrement in findDominatingStoreToReturnValue.
If llvm.lifetime.end turns out to be the first instruction in the last
basic block, we can decrement the iterator twice, going past rend.
At the moment, this can never happen because llvm.lifetime.end always
goes immediately after bitcast, but relying on this is very brittle.

llvm-svn: 239638
2015-06-12 21:05:32 +00:00
Tom Stellard 12a1910e87 R600/SI: Add assembler support for FLAT instructions
- Add glc, slc, and tfe operands to flat instructions
- Add missing flat instructions
- Fix the encoding of flat_load_dwordx3 and flat_store_dwordx3.

llvm-svn: 239637
2015-06-12 20:47:06 +00:00
Yaron Keren 4c20debe3c Rangify several for loops in ValueEnumerator constructor.
llvm-svn: 239636
2015-06-12 20:18:20 +00:00
Eric Christopher 0ee1c8cd0b Quote the user provided string in the warning message and update
tests accordingly.

llvm-svn: 239635
2015-06-12 20:13:50 +00:00
Colin LeMahieu 79ec06525e [Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing intrinsic parameters to appropriate width.
llvm-svn: 239634
2015-06-12 19:57:32 +00:00
Tim Northover 018578c395 Driver: only set -mlinker-version based on host if it's valid
We were adding an extra "-mlinker-version" argument to the invocation
based on a value inferred from "ld -v". This is set by the build
systems to either a sane value or an empty string (e.g. for custom
built ld), which we don't want to pass on.

No test really possible because the value depends on both host system
and how CMake was invoked.

llvm-svn: 239633
2015-06-12 19:21:35 +00:00
Douglas Katzman 8f01f1cfc3 Wrap some long lines in LLVMBuild files. NFC
As suggested by jroelofs in a prior review (D9752),
it makes sense to generally prefer multi-line format.

llvm-svn: 239632
2015-06-12 18:44:57 +00:00
Douglas Katzman 1b5767f72b Add 'shave' processor name to Triple
Based on ArchType, Clang's driver can select a non-Clang compiler.
String parsing in Clang would have sufficed if it were only that,
however this change anticipates true llvm support.

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

llvm-svn: 239631
2015-06-12 18:31:38 +00:00
Ahmed Bougacha f190def830 [builtins] Hide long double fp_test.h helpers if it's not fp128.
Like we do for the various __*tf* tests, check that long double is the
128bit type we expect directly in the header. The latter is now used by
unrelated tests (__*hf* since r237161), and those tests will break for
no reason if uint128_t doesn't exist, and long double isn't fp128.

llvm-svn: 239630
2015-06-12 18:28:47 +00:00
David Blaikie 473b943ea8 Refix a use of explicit pointer types in GEP constant folding
In the glorious future of opaque pointer types, it won't be possible to
retrieve the pointee type of a pointer type which is what's being done
in this GEP loop - but the first iteration is always a pointer type and
the loop doesn't care about that case, except whether or not the index
is a constant.

So pull that special case out before the loop and start at the second
iteration (index 1) instead.

Originally committed in r236670 and reverted with a test case in
r239015. This change keeps the test case working while also avoiding
depending on pointee types.

llvm-svn: 239629
2015-06-12 18:22:03 +00:00
Matt Wala a4afccd8a8 Fix a typo in a comment in MemCpyOpt (test commit)
llvm-svn: 239628
2015-06-12 18:16:51 +00:00
Yaron Keren ef5e7addb3 Rangify two for loops in BitcodeReader.cpp.
llvm-svn: 239627
2015-06-12 18:13:20 +00:00
Pete Cooper 83a930c80b Remove unnecessary MCExpr.h include from MCSymbol.h
MCSymbol.h already forwards declares MCExpr and only uses MCExpr* so doesn't
need to include the header.

llvm-svn: 239626
2015-06-12 18:07:34 +00:00
David Majnemer fc22e4774b [MS ABI] Lock-in the derived memptr rep. for base-to-derived conversions
We would get this right in the case where an explicit cast was formed
but not when we were performing an implicit conversion.

This fixes PR23828.

llvm-svn: 239625
2015-06-12 17:55:44 +00:00
Pete Cooper 255d117d43 Remove a bunch of inline keywords from User. NFC.
This came up in the patch review for http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150608/281362.html.

llvm-svn: 239624
2015-06-12 17:48:21 +00:00
Pete Cooper b676b01b84 Move OperandList to be allocated prior to User for hung off subclasses.
For hung off uses, we need a Use* to tell use where the operands are.
This was User::OperandList but we want to remove that to save space
of all subclasses which aren't making use of 'hung off uses'.

Hung off uses now allocate their own 'OperandList' Use* in the
User::new which they call.

getOperandList() now uses the hung off uses bit to work out where the
Use* for the OperandList lives.  If a User has hung off uses, then this
bit tells them to go back a single Use* from the User* and use that
value as the OperandList.

If a User has no hung off uses, then we get the first operand by
subtracting (NumOperands * sizeof(Use)) from the User this pointer.

This saves a pointer from User and all subclasses.  Given the average
size of a subclass of User is 112 or 128 bytes, this saves around 7% of space
With malloc tending to align to 16-bytes the real saving is typically more like 3.5%.

On 'opt -O2 verify-uselistorder.lto.bc', peak memory usage prior to this change
is 149MB and after is 143MB so the savings are around 2.5% of peak.

Looking at some passes which allocate many Instructions and Values, parseIR drops
from 54.25MB to 52.21MB while the Inliner calls to Instruction::clone() drops
from 28.20MB to 27.05MB.

Reviewed by Duncan Exon Smith.

llvm-svn: 239623
2015-06-12 17:48:18 +00:00
Pete Cooper c91fda3b10 Added a version of User::new for hung off uses.
There are now 2 versions of User::new.  The first takes a size_t and is the current
implementation for subclasses which need 0 or more Use's allocated for their operands.

The new version takes no extra arguments to say that this subclass needs 'hung off uses'.
The HungOffUses bool is now set in this version of User::new and we can assert in
allocHungOffUses that we are allowed to have hung off uses.
This ensures we call the correct version of User::new for subclasses which need hung off uses.

A future commit will then allocate space for a single Use* which will be used
in place of User::OperandList once that field has been removed.

Reviewed by Duncan Exon Smith.

llvm-svn: 239622
2015-06-12 17:48:14 +00:00
Pete Cooper b4eede2c07 Rename NumOperands to make it clear its managed by the User. NFC.
This is to try make it very clear that subclasses shouldn't be changing
the value directly.  Now that OperandList for normal instructions is computed
using the NumOperands, its critical that the NumOperands is accurate or we
could compute the wrong offset to the first operand.

I looked over all places which update NumOperands and they are all safe.
Hung off use User's don't use NumOperands to compute the OperandList so they
are safe to continue to manipulate it.  The only other User which changed it
was GlobalVariable which has an optional init list but always allocated space
for a single Use.  It was correctly setting NumOperands to 1 before setting an
initializer, and setting it to 0 after clearing the init list, so the order was safe.

Added some comments to that code to make sure that this isn't changed in future
without being aware of this constraint.

Reviewed by Duncan Exon Smith.

llvm-svn: 239621
2015-06-12 17:48:10 +00:00
Pete Cooper 74510a409d Replace all accesses to User::OperandList with getter and setter methods. NFC.
We don't want anyone to access OperandList directly as its going to be removed
and computed instead.  This uses getter's and setter's instead in which we
can later change the underlying implementation of OperandList.

Reviewed by Duncan Exon Smith.

llvm-svn: 239620
2015-06-12 17:48:05 +00:00
Gabor Ballabas 726ce7fc57 Allow case-insensitive values for -mcpu for AArch64 target in line with GCC.
GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -mcpu option for the AArch64 target.

llvm-svn: 239619
2015-06-12 17:33:37 +00:00
Rafael Espindola c74ac023d8 Have the ELF symbol predicates match more directly the spec.
The underlaying issues is that this code can't really know if an OS specific or
processor specific section number should return true or false.

One option would be to assert or return an error, but that looks like over
engineering since extensions are not that common.

It seems better to have these be direct implementation of the ELF spec so that
they are natural for someone familiar with ELF reading the code.

Code that does have to handle OS/Architecture specific values can do it at
a higher level.

llvm-svn: 239618
2015-06-12 17:23:39 +00:00
Greg Bedwell 141e8bdfc2 Use Clang version numbers for the Windows VERSIONINFO resource.
When setting the VERSIONINFO resource to embed version information into exe and
DLL files on Windows, override the default LLVM version number values with their
clang equivalents.

llvm-svn: 239617
2015-06-12 16:33:38 +00:00
Pete Cooper 3664253c52 Don't create instructions from ConstantExpr's in CFLAliasAnalysis.
The CFLAA code currently calls ConstantExpr::getAsInstruction which creates an instruction from a constant expr.

We then pass that instruction to the InstVisitor to analyze it.

Its not necessary to create these instructions as we can just cast from Constant to Operator in the visitor.  This is how other InstVisitor’s such as SelectionDAGBuilder handle ConstantExpr.

llvm-svn: 239616
2015-06-12 16:13:54 +00:00
Simon Atanasyan 5f54812cb0 [Mips] Handle TLS relocations in -static linking mode
llvm-svn: 239615
2015-06-12 16:13:14 +00:00
Simon Atanasyan d5296b206b [Mips] Define _gpxxx symbols in both static/dynamic linking modes
llvm-svn: 239614
2015-06-12 16:13:00 +00:00
Simon Atanasyan 01cde9cf5a [Mips] Setup EI_ABIVERSION flag
- Set EI_ABIVERSION to '1' in case of non-PIC executable.
- Set EI_ABIVERSION to '3' in case of using FP64/FP64A floating point ABI.

llvm-svn: 239613
2015-06-12 16:12:50 +00:00
Greg Bedwell 95213c31f3 In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This reinstates my commits r238740/r238741 which I reverted due to a failure
in the clang-cl selfhost tests on Windows.  I've now fixed the issue in
clang-cl that caused the failure so hopefully all should be well now.

llvm-svn: 239612
2015-06-12 15:58:29 +00:00
Luke Cheeseman 7f5571a129 This patch makes the NEON intrinsics vget_lane_f16, vgetq_lane_f16,
vset_lane_f16 and vsetq_lane_f16 available in AArch32.

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

llvm-svn: 239610
2015-06-12 15:52:39 +00:00
Sylvestre Ledru f8a5ce35a4 scan-build: Remove useless whitespace in File path
Patch by Honggyu Kim

Summary:
This patch removes useless whitespace in File path in index.html
Previously, a File directory path is copied and pasted as below:
  arch /arm /kernel /stacktrace.c

It just removes the whitespace between directories and makes the
copied string as below:
  arch/arm/kernel/stacktrace.c

The output looks same in html format, but the copied directory path
can be pasted as it looks.

Reviewers: krememek, zaks.anna, sylvestre.ledru

Reviewed By: sylvestre.ledru

Subscribers: aemerson, cfe-commits

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

llvm-svn: 239609
2015-06-12 15:50:27 +00:00
Douglas Katzman 0024909c68 Allow ToolChain to decide if Clang is not the right C compiler.
Removed comment in Driver::ShouldUseClangCompiler implying that there
was an opt-out ability at that point - there isn't.

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

llvm-svn: 239608
2015-06-12 15:45:21 +00:00
Benjamin Kramer f367dd90cc push_back() loop -> append() for random access iterators.
append will resize the vector to the optimal size. No functional change
intended.

llvm-svn: 239607
2015-06-12 15:31:50 +00:00
Benjamin Kramer 133aa20e22 [clang-format] Use in-class initializers to simplify constructor.
Sadly C++11 doesn't let us use initializers on bitfield members (DR1341). NFC.

llvm-svn: 239606
2015-06-12 14:39:08 +00:00
Benjamin Kramer 8ad86fc644 [clang-format] Reorder and pack ParenState members to minimize padding
sizeof(ParenState) goes from 64 bytes to 52 bytes. NFC.

llvm-svn: 239605
2015-06-12 13:07:03 +00:00
Benjamin Kramer 3aa55db86d [clang-format] Hoist vector allocation out of loop. NFC.
llvm-svn: 239604
2015-06-12 13:06:57 +00:00
Rafael Espindola 0b9319edb0 Remove a hack that tries to align '*'.
The alignment is not required, so we can just remove it for now.

The old code is a hack as it depends on the buffer management to find
the current column.

If the alignment is really desirable, the proper way to do it is
to pass in a formatted_raw_stream that knows the current column.

llvm-svn: 239603
2015-06-12 12:42:13 +00:00
Rafael Espindola de28b7375f Don't depend on the interleaving of stdout and stderr.
That can change as we change the buffering.

llvm-svn: 239602
2015-06-12 12:20:03 +00:00
Alexander Potapenko f90556efb8 [ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC
llvm-svn: 239601
2015-06-12 11:27:06 +00:00
Daniel Jasper 60ba32d453 clang-format: Always add space before lambda-{
Before:
  int c = []() -> int *{ return 2; }();

After:
  int c = []() -> int * { return 2; }();

Based on patch by James Dennett (http://reviews.llvm.org/D10410), thank you!

llvm-svn: 239600
2015-06-12 09:59:16 +00:00
John Brawn d9e39d53b6 [ARM] Disabling vfp4 should disable fp16
ARMTargetParser::getFPUFeatures should disable fp16 whenever it
disables vfp4, as otherwise something like -mcpu=cortex-a7 -mfpu=none
leaves us with fp16 enabled (though the only effect that will have is
a wrong build attribute).

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

llvm-svn: 239599
2015-06-12 09:38:51 +00:00
Yaron Keren b5a87b256d Replace duplicated iplist<T> types with the corresponding typedefs.
llvm-svn: 239598
2015-06-12 08:19:32 +00:00
Daniel Jasper 554e49fe84 clang-format: Understand C-style case in case label.
Before:
  case (my_int) ONE:

After:
  case (my_int)ONE:

This fixed llvm.org/PR23760

llvm-svn: 239597
2015-06-12 07:15:33 +00:00
Yaron Keren 26ceb0845b Rangify for loops, NFC.
llvm-svn: 239596
2015-06-12 05:15:27 +00:00
Daniel Jasper 216c9cdb1d clang-format: [JS] Support "export enum" declarations.
llvm-svn: 239595
2015-06-12 05:08:18 +00:00
Daniel Jasper 4c0bf7034c clang-format: [JS] Add tests to ensure clang-format doesn't break code
by triggering automatic semicolon insertion changes.

NFC intended. Patch by Martin Probst.

llvm-svn: 239594
2015-06-12 04:58:27 +00:00
Daniel Jasper 259188b1b5 clang-format: [JS] Fix regression caused by r239592.
Without it, it would do:

  interface I {
    x: string;
  } var y;

llvm-svn: 239593
2015-06-12 04:56:34 +00:00
Daniel Jasper 910807d4b9 clang-format: [JS] fix incorrectly collapsed lines after export
statement.

When an exported function would follow a class declaration, it would not
be recognized as a stand-alone function. That would then collapse the
following line with the current one, e.g.

  class C {}
  export function f() {} var x;

llvm-svn: 239592
2015-06-12 04:52:02 +00:00
Nico Weber 9c39f83f80 Wrap to 80 columns. No behavior change.
llvm-svn: 239591
2015-06-12 04:44:52 +00:00