platform/upstream/llvm.git
9 years agoAdd a helper to printing BE of LE depending on the format.
Rafael Espindola [Thu, 9 Jul 2015 15:13:41 +0000 (15:13 +0000)]
Add a helper to printing BE of LE depending on the format.

The gnu ar format uses BE numbers. The BSD one uses LE. Add a helper for one or the
other. NFC for now, just removes some noise from the following patch.

llvm-svn: 241808

9 years agoRe-instate the EVT parameter to getScalarShiftAmountTy() for OOT user
Mehdi Amini [Thu, 9 Jul 2015 15:12:23 +0000 (15:12 +0000)]
Re-instate the EVT parameter to getScalarShiftAmountTy() for OOT user

A documentation for this function would be nice by the way.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241807

9 years agoReapply fixed r241790: Fix shift legalization and lowering for big constants.
Pawel Bylica [Thu, 9 Jul 2015 14:58:04 +0000 (14:58 +0000)]
Reapply fixed r241790: Fix shift legalization and lowering for big constants.

Summary: If shift amount is a constant value > 64 bit it is handled incorrectly during type legalization and X86 lowering. This patch the type of shift amount argument in function DAGTypeLegalizer::ExpandShiftByConstant from unsigned to APInt.

Reviewers: nadav, majnemer, sanjoy, RKSimon

Subscribers: RKSimon, llvm-commits

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

llvm-svn: 241806

9 years agoExtract printBSDMemberHeader.
Rafael Espindola [Thu, 9 Jul 2015 14:54:12 +0000 (14:54 +0000)]
Extract printBSDMemberHeader.

It will get another use in the following patch. Also rename the other helper to
printGNUSmallMemberHeader for consistency.

llvm-svn: 241805

9 years ago[Hexagon] Add support for atomic RMW operations
Krzysztof Parzyszek [Thu, 9 Jul 2015 14:51:21 +0000 (14:51 +0000)]
[Hexagon] Add support for atomic RMW operations

llvm-svn: 241804

9 years ago[AArch64] Select SBFIZ or UBFIZ instead of left + right shifts
Arnaud A. de Grandmaison [Thu, 9 Jul 2015 14:33:38 +0000 (14:33 +0000)]
[AArch64] Select SBFIZ or UBFIZ instead of left + right shifts

And rename LSB to Immr / MSB to Imms to match the ARM ARM terminology.

llvm-svn: 241803

9 years ago[ARM] Thumb1 3 to 2 operand convertion for commutative operations
Scott Douglass [Thu, 9 Jul 2015 14:13:55 +0000 (14:13 +0000)]
[ARM] Thumb1 3 to 2 operand convertion for commutative operations

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

llvm-svn: 241802

9 years ago[ARM] Don't be overzealous converting Thumb1 3 to 2 operands
Scott Douglass [Thu, 9 Jul 2015 14:13:48 +0000 (14:13 +0000)]
[ARM] Don't be overzealous converting Thumb1 3 to 2 operands

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

llvm-svn: 241801

9 years ago[ARM] Add Thumb2 ADD with PC narrowing from 3 operand to 2
Scott Douglass [Thu, 9 Jul 2015 14:13:41 +0000 (14:13 +0000)]
[ARM] Add Thumb2 ADD with PC narrowing from 3 operand to 2

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

llvm-svn: 241800

9 years ago[ARM] Refactor converting Thumb1 from 3 to 2 operand (nfc)
Scott Douglass [Thu, 9 Jul 2015 14:13:34 +0000 (14:13 +0000)]
[ARM] Refactor converting Thumb1 from 3 to 2 operand (nfc)

Also adds some test cases.

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

llvm-svn: 241799

9 years ago[ARM] Add ADD tests for Thumb2 narrowing (nfc)
Scott Douglass [Thu, 9 Jul 2015 14:13:22 +0000 (14:13 +0000)]
[ARM] Add ADD tests for Thumb2 narrowing (nfc)

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

llvm-svn: 241798

9 years agoTest for 241794 (nest attribute in AArch64)
Renato Golin [Thu, 9 Jul 2015 13:29:35 +0000 (13:29 +0000)]
Test for 241794 (nest attribute in AArch64)

Forgot to git add the test.

Patch by Stephen Cross.

llvm-svn: 241797

9 years agoAvoid going through Platform when creating a NativeProcessProtocol instance
Pavel Labath [Thu, 9 Jul 2015 11:51:11 +0000 (11:51 +0000)]
Avoid going through Platform when creating a NativeProcessProtocol instance

Summary:
This commit avoids the Platform instance when spawning or attaching to a process in lldb-server.
Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason
for this is that I believe that NativeProcessProtocol should be decoupled from the Platform
(after all, it always knows which platform it is running on, unlike the rest of lldb).
Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ
greatly from the platform actions of the lldb client, so I think the separation makes sense.

After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable
method, which needs additional refactoring.

This is a resubmit of r241672, after it was reverted due to build failueres on non-linux
platforms.

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241796

9 years agoFix TestStopHookMultipleThreads and TestNamespace after r241751
Pavel Labath [Thu, 9 Jul 2015 10:57:54 +0000 (10:57 +0000)]
Fix TestStopHookMultipleThreads and TestNamespace after r241751

The mentioned commit introduced a subtle change in behavior when printing variable names. This
occured when we have a variable, for which we only know the demangled name, because the compiler
has failed to provide one (this typically happens for variables in anonymous namespaces). A
Mangled class which contains only a demangled name considers itself to be invalid (this could
possibly be a bug), but it's GetName() method still returns a valid demangled name. The previous
commit introduced the check for the validity of the class, and if it failed, it would fall back
to printing the bare name (without the namespace prefixes, as the tests were expecting). I revert
this part of the commit and check the validity of the string returned by GetName() instead.

llvm-svn: 241795

9 years agoAdd support for nest attribute to AArch64 backend
Renato Golin [Thu, 9 Jul 2015 10:18:02 +0000 (10:18 +0000)]
Add support for nest attribute to AArch64 backend

The nest attribute is currently supported on the x86 (32-bit) and x86-64
backends, but not on ARM (32-bit) or AArch64. This patch adds support for
nest to the AArch64 backend.

Register x18 is used by GCC for this purpose and hence is used here.
As discussed on the GCC mailing list the register choice is an ABI issue
and so choosing the same register as GCC means __builtin_call_with_static_chain
is compatible.

Patch by Stephen Cross.

llvm-svn: 241794

9 years agoAdd getSizeInBits function to the APFloat class
Tamas Berghammer [Thu, 9 Jul 2015 10:13:39 +0000 (10:13 +0000)]
Add getSizeInBits function to the APFloat class

The newly added function returns the size of the specified floating
point semantics in bits.

Differential revision: http://reviews.llvm.org/D8413

llvm-svn: 241793

9 years agoRevert r241790: Fix shift legalization and lowering for big constants.
Pawel Bylica [Thu, 9 Jul 2015 09:50:54 +0000 (09:50 +0000)]
Revert r241790: Fix shift legalization and lowering for big constants.

llvm-svn: 241792

9 years ago[lldb-mi] Remove unused typedefs.
Bruce Mitchener [Thu, 9 Jul 2015 08:45:26 +0000 (08:45 +0000)]
[lldb-mi] Remove unused typedefs.

Summary: [lldb-mi] Remove unused typedefs.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241791

9 years agoFix shift legalization and lowering for big constants.
Pawel Bylica [Thu, 9 Jul 2015 08:01:36 +0000 (08:01 +0000)]
Fix shift legalization and lowering for big constants.

Summary: If shift amount is a constant value > 64 bit it is handled incorrectly during type legalization and X86 lowering. This patch the type of shift amount argument in function DAGTypeLegalizer::ExpandShiftByConstant from unsigned to APInt.

Reviewers: nadav, majnemer, sanjoy, RKSimon

Subscribers: RKSimon, llvm-commits

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

llvm-svn: 241790

9 years agoAdd clang_free to libclang to free memory allocated in libclang.
Yaron Keren [Thu, 9 Jul 2015 07:53:23 +0000 (07:53 +0000)]
Add clang_free to libclang to free memory allocated in libclang.

One of the problems libclang tests has running under Windows is memory
allocated in libclang.dll but being freed in the test executable, possibly
by a different memory manager. This patch exposes a new export function,
clang_free(), used to free any allocated memory with the same libclang.dll
memory manager that allocated the memory.

http://reviews.llvm.org/D10949

Reviewed by Reid Kleckner, Douglas Gregor.

llvm-svn: 241789

9 years agoExtended syntax of vector version of getelementptr instruction.
Elena Demikhovsky [Thu, 9 Jul 2015 07:42:48 +0000 (07:42 +0000)]
Extended syntax of vector version of getelementptr instruction.

The justification of this change is here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/082989.html

According to the current GEP syntax, vector GEP requires that each index must be a vector with the same number of elements.

%A = getelementptr i8, <4 x i8*> %ptrs, <4 x i64> %offsets

In this implementation I let each index be or vector or scalar. All vector indices must have the same number of elements. The scalar value will mean the splat vector value.

(1) %A = getelementptr i8, i8* %ptr, <4 x i64> %offsets
or
(2) %A = getelementptr i8, <4 x i8*> %ptrs, i64 %offset

In all cases the %A type is <4 x i8*>

In the case (2) we add the same offset to all pointers.

The case (1) covers C[B[i]] case, when we have the same base C and different offsets B[i].

The documentation is updated.

http://reviews.llvm.org/D10496

llvm-svn: 241788

9 years agoMake non-affine statement names isl compatible
Tobias Grosser [Thu, 9 Jul 2015 07:31:45 +0000 (07:31 +0000)]
Make non-affine statement names isl compatible

Named isl sets can generally have any name if they remain within Polly, but only
certain strings can be parsed by isl. The new names we create ensure that we
can always copy-past isl strings from Polly to other isl tools, e.g. for
debugging.

llvm-svn: 241787

9 years agoDriver: Include the driver arguments in crash reports
Justin Bogner [Thu, 9 Jul 2015 06:58:31 +0000 (06:58 +0000)]
Driver: Include the driver arguments in crash reports

Similarly to r231989, the driver arguments can be quite helpful in
diagnosing a crash.

llvm-svn: 241786

9 years ago[LAA] Fix line break in comment
Adam Nemet [Thu, 9 Jul 2015 06:47:21 +0000 (06:47 +0000)]
[LAA] Fix line break in comment

llvm-svn: 241785

9 years ago[LAA] Rename IsRTNeeded to IsRTCheckAnalysisNeeded
Adam Nemet [Thu, 9 Jul 2015 06:47:18 +0000 (06:47 +0000)]
[LAA] Rename IsRTNeeded to IsRTCheckAnalysisNeeded

The original name was too close to NeedRTCheck which is what the actual
memcheck analysis returns.  This flag, as the new name suggests, is only
used to whether to initiate that analysis.

Also a comment is added to answer one question I had about this code for
a long time.  Namely, how does this flag differ from
isDependencyCheckNeeded since they are seemingly set at the same time.

llvm-svn: 241784

9 years agollvm-readobj: Fix an unused variable after r241764
Justin Bogner [Thu, 9 Jul 2015 04:27:36 +0000 (04:27 +0000)]
llvm-readobj: Fix an unused variable after r241764

llvm-svn: 241783

9 years agoRevert r241770 and add Basic to the dependencies of clang-check instead.
Adrian Prantl [Thu, 9 Jul 2015 02:53:05 +0000 (02:53 +0000)]
Revert r241770 and add Basic to the dependencies of clang-check instead.
PR24067.

llvm-svn: 241782

9 years agoTemporarily reverting 241765, 241768, and 241772 to unbreak the build bots.
Adrian Prantl [Thu, 9 Jul 2015 02:14:49 +0000 (02:14 +0000)]
Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.

llvm-svn: 241781

9 years agoRemove getDataLayout() from TargetSelectionDAGInfo (had no users)
Mehdi Amini [Thu, 9 Jul 2015 02:10:08 +0000 (02:10 +0000)]
Remove getDataLayout() from TargetSelectionDAGInfo (had no users)

Summary:
Remove empty subclass in the process.

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren, ted

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241780

9 years agoRemove getDataLayout() from TargetLowering
Mehdi Amini [Thu, 9 Jul 2015 02:09:52 +0000 (02:09 +0000)]
Remove getDataLayout() from TargetLowering

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241779

9 years agoMake isLegalAddressingMode() taking DataLayout as an argument
Mehdi Amini [Thu, 9 Jul 2015 02:09:40 +0000 (02:09 +0000)]
Make isLegalAddressingMode() taking DataLayout as an argument

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241778

9 years agoMake getByValTypeAlignment() taking DataLayout as an argument
Mehdi Amini [Thu, 9 Jul 2015 02:09:28 +0000 (02:09 +0000)]
Make getByValTypeAlignment() taking DataLayout as an argument

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241777

9 years agoMake TargetLowering::getShiftAmountTy() taking DataLayout as an argument
Mehdi Amini [Thu, 9 Jul 2015 02:09:20 +0000 (02:09 +0000)]
Make TargetLowering::getShiftAmountTy() taking DataLayout as an argument

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241776

9 years agoMake TargetLowering::getPointerTy() taking DataLayout as an argument
Mehdi Amini [Thu, 9 Jul 2015 02:09:04 +0000 (02:09 +0000)]
Make TargetLowering::getPointerTy() taking DataLayout as an argument

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, ted, yaron.keren, rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241775

9 years agoMake TargetTransformInfo keeping a reference to the Module DataLayout
Mehdi Amini [Thu, 9 Jul 2015 02:08:42 +0000 (02:08 +0000)]
Make TargetTransformInfo keeping a reference to the Module DataLayout

DataLayout is no longer optional. It was initialized with or without
a DataLayout, and the DataLayout when supplied could have been the
one from the TargetMachine.

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241774

9 years agoRedirect DataLayout from TargetMachine to Module in ComputeValueVTs()
Mehdi Amini [Thu, 9 Jul 2015 01:57:34 +0000 (01:57 +0000)]
Redirect DataLayout from TargetMachine to Module in ComputeValueVTs()

Summary:
Avoid using the TargetMachine owned DataLayout and use the Module owned
one instead. This requires passing the DataLayout up the stack to
ComputeValueVTs().

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: jholewinski, yaron.keren, rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241773

9 years agoSilence a warning, trying to unbreak the build after r241765.
Davide Italiano [Thu, 9 Jul 2015 01:45:02 +0000 (01:45 +0000)]
Silence a warning, trying to unbreak the build after r241765.

llvm-svn: 241772

9 years agoCOFF: Fix import thunks and name mangling for x86.
Rui Ueyama [Thu, 9 Jul 2015 01:25:49 +0000 (01:25 +0000)]
COFF: Fix import thunks and name mangling for x86.

With this patch, LLD is now able to correctly link a "hello world"
program written in assembly for 32-bit x86.

llvm-svn: 241771

9 years agoMove the definition of ~PCHContainerOperations from Basic into Frontend.
Adrian Prantl [Thu, 9 Jul 2015 01:01:52 +0000 (01:01 +0000)]
Move the definition of ~PCHContainerOperations from Basic into Frontend.

Fixes PR24067.

llvm-svn: 241770

9 years agoFix typename issues.
Michael J. Spencer [Thu, 9 Jul 2015 00:46:24 +0000 (00:46 +0000)]
Fix typename issues.

llvm-svn: 241768

9 years agoCOFF: Support 32-bit x86 DLL import table.
Rui Ueyama [Thu, 9 Jul 2015 00:45:50 +0000 (00:45 +0000)]
COFF: Support 32-bit x86 DLL import table.

llvm-svn: 241767

9 years ago[Object][ELF] Support dumping hash-tables from files with no section table.
Michael J. Spencer [Thu, 9 Jul 2015 00:21:06 +0000 (00:21 +0000)]
[Object][ELF] Support dumping hash-tables from files with no section table.

llvm-svn: 241765

9 years ago[CodeView] Add support for emitting column information
David Majnemer [Thu, 9 Jul 2015 00:19:51 +0000 (00:19 +0000)]
[CodeView] Add support for emitting column information

Column information is present in CodeView when the line table subsection
has bit 0 set to 1 in it's flags field.  The column information is
represented as a pair of 16-bit quantities: a starting and ending
column.  This information is present at the end of the chunk, after all
the line-PC pairs.

llvm-svn: 241764

9 years ago[LAA] Fix misleading use of word 'consecutive'
Adam Nemet [Thu, 9 Jul 2015 00:03:22 +0000 (00:03 +0000)]
[LAA] Fix misleading use of word 'consecutive'

Fix some places where the word consecutive is used but the code really
means constant-stride (i.e. not just unit stride).

llvm-svn: 241763

9 years agoMIR Serialization: Serialize the 'undef' register machine operand flag.
Alex Lorenz [Wed, 8 Jul 2015 23:58:31 +0000 (23:58 +0000)]
MIR Serialization: Serialize the 'undef' register machine operand flag.

llvm-svn: 241762

9 years agoDisable 32-bit SEH, again
Reid Kleckner [Wed, 8 Jul 2015 23:57:03 +0000 (23:57 +0000)]
Disable 32-bit SEH, again

Move the diagnostic back to codegen so that we can compile ATL on the
self-host bot. We don't actually end up emitting code for the __try, so
the diagnostic won't be hit.

llvm-svn: 241761

9 years ago[SLPVectorizer] Try different vectorization factors for store chains
Sanjay Patel [Wed, 8 Jul 2015 23:40:55 +0000 (23:40 +0000)]
[SLPVectorizer] Try different vectorization factors for store chains
...and set max vector register size based on target

This patch is based on discussion on the llvmdev mailing list:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-July/087405.html

and also solves:
https://llvm.org/bugs/show_bug.cgi?id=17170

Several FIXME/TODO items are noted in comments as potential improvements.

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

llvm-svn: 241760

9 years agoRegisterPressure: Add PressureDiff::dump()
Matthias Braun [Wed, 8 Jul 2015 23:40:27 +0000 (23:40 +0000)]
RegisterPressure: Add PressureDiff::dump()

Also display the pressure diff in the case of a
getMaxUpwardPressureDelta() verify failure.

llvm-svn: 241759

9 years agoUBSan: Simplify logic for locating the RTTI object.
Peter Collingbourne [Wed, 8 Jul 2015 23:22:39 +0000 (23:22 +0000)]
UBSan: Simplify logic for locating the RTTI object.

The image-relative complete object locator contains a reference to itself,
which we can use to compute the image base without using VirtualQuery.

Spotted by David Majnemer.

llvm-svn: 241758

9 years agoFix error string in test suite
Eric Fiselier [Wed, 8 Jul 2015 23:10:20 +0000 (23:10 +0000)]
Fix error string in test suite

llvm-svn: 241757

9 years ago[LAA] Revert a small part of r239295
Adam Nemet [Wed, 8 Jul 2015 22:58:48 +0000 (22:58 +0000)]
[LAA] Revert a small part of r239295

This commit ([LAA] Fix estimation of number of memchecks) regressed the
logic a bit.  We shouldn't quit the analysis if we encounter a pointer
without known bounds *unless* we actually need to emit a memcheck for
it.

The original code was using NumComparisons which is now computed
differently.  Instead I compute NeedRTCheck from NumReadPtrChecks and
NumWritePtrChecks.

As side note, I find the separation of NeedRTCheck and CanDoRT
confusing, so I will try to merge them in a follow-up patch.

llvm-svn: 241756

9 years ago[asan] relax the test case to allow either 'malloc' or '__interceptor_malloc' ; PR22681
Kostya Serebryany [Wed, 8 Jul 2015 22:57:03 +0000 (22:57 +0000)]
[asan] relax the test case to allow either 'malloc' or '__interceptor_malloc' ; PR22681

llvm-svn: 241755

9 years agoRun clang-format before making changes to StackMaps. NFC.
Juergen Ributzka [Wed, 8 Jul 2015 22:42:09 +0000 (22:42 +0000)]
Run clang-format before making changes to StackMaps. NFC.

llvm-svn: 241754

9 years agoRevert part of "Disallow Archive::child_iterator that don't point to an archive."
Rafael Espindola [Wed, 8 Jul 2015 22:41:41 +0000 (22:41 +0000)]
Revert part of "Disallow Archive::child_iterator that don't point to an archive."

This reverts parts of commit r241747. MSVC doesn't like it.

llvm-svn: 241753

9 years ago[x86] enable machine combiner reassociations for scalar single-precision multiplies
Sanjay Patel [Wed, 8 Jul 2015 22:35:20 +0000 (22:35 +0000)]
[x86] enable machine combiner reassociations for scalar single-precision multiplies

llvm-svn: 241752

9 years agoMake many mangled functions that might demangle a name be allowed to specify a langua...
Greg Clayton [Wed, 8 Jul 2015 22:32:23 +0000 (22:32 +0000)]
Make many mangled functions that might demangle a name be allowed to specify a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so.

llvm-svn: 241751

9 years agoDon't reject an archive with just a symbol table.
Rafael Espindola [Wed, 8 Jul 2015 22:27:54 +0000 (22:27 +0000)]
Don't reject an archive with just a symbol table.

It is pretty unambiguous how to interpret it and gnu ar accepts it too.

llvm-svn: 241750

9 years agoUnbreak the MacOSX build.
Greg Clayton [Wed, 8 Jul 2015 22:21:22 +0000 (22:21 +0000)]
Unbreak the MacOSX build.

llvm-svn: 241749

9 years agoDeclObjC: Move computing the type of self into a separate function (NFC).
Adrian Prantl [Wed, 8 Jul 2015 22:15:59 +0000 (22:15 +0000)]
DeclObjC: Move computing the type of self into a separate function (NFC).
This function will be used for emitting debug info.

llvm-svn: 241748

9 years agoDisallow Archive::child_iterator that don't point to an archive.
Rafael Espindola [Wed, 8 Jul 2015 22:15:07 +0000 (22:15 +0000)]
Disallow Archive::child_iterator that don't point to an archive.

NFC, just less error prone.

llvm-svn: 241747

9 years agoUpdate for upcoming llvm change.
Rafael Espindola [Wed, 8 Jul 2015 22:14:36 +0000 (22:14 +0000)]
Update for upcoming llvm change.

llvm-svn: 241746

9 years agoCFI: Get check-cfi passing on Windows.
Peter Collingbourne [Wed, 8 Jul 2015 22:10:34 +0000 (22:10 +0000)]
CFI: Get check-cfi passing on Windows.

Specifically:

- Start using %expect_crash.

- Provide an implementation of __ubsan::getDynamicTypeInfoFromVtable
  for the Microsoft C++ ABI. This is all that is needed for CFI
  diagnostics; UBSan's -fsanitize=vptr also requires an implementation of
  __ubsan::checkDynamicType.

- Build the sanitizer runtimes against the release version of the C
  runtime, even in debug builds.

- Accommodate demangling differences in tests.

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

llvm-svn: 241745

9 years agoFixed line-endings.
John Thompson [Wed, 8 Jul 2015 22:00:56 +0000 (22:00 +0000)]
Fixed line-endings.

llvm-svn: 241744

9 years ago[modules] Fix merging support for forward-declared enums with fixed underlying types...
Richard Smith [Wed, 8 Jul 2015 21:49:31 +0000 (21:49 +0000)]
[modules] Fix merging support for forward-declared enums with fixed underlying types. A visible declaration is enough to make the type complete, but not enough to make the definition visible.

llvm-svn: 241743

9 years ago[LoopVectorizer] Rename BypassBlock to VectorPH, and CheckBlock to NewVectorPH. NFCI.
Michael Zolotukhin [Wed, 8 Jul 2015 21:48:03 +0000 (21:48 +0000)]
[LoopVectorizer] Rename BypassBlock to VectorPH, and CheckBlock to NewVectorPH. NFCI.

llvm-svn: 241742

9 years ago[LoopVectorizer] Restructurize code for emitting RT checks. NFCI.
Michael Zolotukhin [Wed, 8 Jul 2015 21:47:59 +0000 (21:47 +0000)]
[LoopVectorizer] Restructurize code for emitting RT checks. NFCI.

Place all code corresponding to a run-time check in one place.
Previously we generated some code, then proceeded to a next check, then
finished the code for the first check (like splitting blocks and
generating branches). Now the code for generating a check is
self-contained.

llvm-svn: 241741

9 years ago[LoopVectorizer] Remove redundant variables PastOverflowCheck and OverflowCheckAnchor...
Michael Zolotukhin [Wed, 8 Jul 2015 21:47:56 +0000 (21:47 +0000)]
[LoopVectorizer] Remove redundant variables PastOverflowCheck and OverflowCheckAnchor. NFCI.

llvm-svn: 241740

9 years ago[LoopVectorizer] Move some code around to ease further refactoring. NFCI.
Michael Zolotukhin [Wed, 8 Jul 2015 21:47:53 +0000 (21:47 +0000)]
[LoopVectorizer] Move some code around to ease further refactoring. NFCI.

llvm-svn: 241739

9 years ago[LoopVectorizer] Remove redundant variable LastBypassBlock. NFC.
Michael Zolotukhin [Wed, 8 Jul 2015 21:47:47 +0000 (21:47 +0000)]
[LoopVectorizer] Remove redundant variable LastBypassBlock. NFC.

llvm-svn: 241738

9 years agoMIR Parser: Remove redundant TODO comment. NFC.
Alex Lorenz [Wed, 8 Jul 2015 21:30:21 +0000 (21:30 +0000)]
MIR Parser: Remove redundant TODO comment. NFC.

This TODO comment has been redundant since r240474.

llvm-svn: 241737

9 years agoAdd tests for the NVPTXLowerAggrCopies pass.
Eli Bendersky [Wed, 8 Jul 2015 21:29:28 +0000 (21:29 +0000)]
Add tests for the NVPTXLowerAggrCopies pass.

Note: not testing memmove lowering for now, as it's broken
[see https://llvm.org/bugs/show_bug.cgi?id=24056]

llvm-svn: 241736

9 years agoMIR Serialization: Serialize the 'killed' register machine operand flag.
Alex Lorenz [Wed, 8 Jul 2015 21:23:34 +0000 (21:23 +0000)]
MIR Serialization: Serialize the 'killed' register machine operand flag.

llvm-svn: 241734

9 years agoCleanup the doxygen comments in CGDebugInfo.cpp according to the coding
Adrian Prantl [Wed, 8 Jul 2015 21:18:34 +0000 (21:18 +0000)]
Cleanup the doxygen comments in CGDebugInfo.cpp according to the coding
standards. Remove several hilariously out-of-date and redundant comments
and move the non-redundant ones into the header file.

llvm-svn: 241733

9 years ago[modules] Fix crash when writing an update record for a redeclaration of an empty...
Richard Smith [Wed, 8 Jul 2015 21:15:32 +0000 (21:15 +0000)]
[modules] Fix crash when writing an update record for a redeclaration of an empty namespace.

llvm-svn: 241732

9 years agoAdd missing dependency to Hexagon target.
Diego Novillo [Wed, 8 Jul 2015 21:13:37 +0000 (21:13 +0000)]
Add missing dependency to Hexagon target.

A recent patch added calls to isInstructionTriviallyDead without the
corresponding dependency on TransformUtils.

llvm-svn: 241731

9 years ago[X86][SSE] Vector shift test cleanup. NFC.
Simon Pilgrim [Wed, 8 Jul 2015 21:11:17 +0000 (21:11 +0000)]
[X86][SSE] Vector shift test cleanup. NFC.

llvm-svn: 241730

9 years agoCodeGen: Fix off-by-one error in CFI class identification function for MS ABI.
Peter Collingbourne [Wed, 8 Jul 2015 21:08:08 +0000 (21:08 +0000)]
CodeGen: Fix off-by-one error in CFI class identification function for MS ABI.

We were previously ignoring classes laid out at offset zero.

llvm-svn: 241729

9 years agoDriver: enable support for -fsanitize=cfi on Windows.
Peter Collingbourne [Wed, 8 Jul 2015 21:08:05 +0000 (21:08 +0000)]
Driver: enable support for -fsanitize=cfi on Windows.

There are known issues, but the current implementation is good enough for
the check-cfi test suite.

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

llvm-svn: 241728

9 years agoUse a raw_svector_ostream and simplify a loop. NFC.
Rafael Espindola [Wed, 8 Jul 2015 21:07:18 +0000 (21:07 +0000)]
Use a raw_svector_ostream and simplify a loop. NFC.

llvm-svn: 241727

9 years agoFixed erroneous comments.
John Thompson [Wed, 8 Jul 2015 21:05:57 +0000 (21:05 +0000)]
Fixed erroneous comments.

llvm-svn: 241726

9 years ago[Win64] Only treat some functions as having the Win64 convention
Reid Kleckner [Wed, 8 Jul 2015 21:03:47 +0000 (21:03 +0000)]
[Win64] Only treat some functions as having the Win64 convention

All the usual X86 target-specific conventions are collapsed to the
normal Win64 convention, but the custom conventions like GHC and webkit
should not be.

Previously we would assume that the caller allocated 32 bytes of shadow
space for us, which is not how webkit_jscc or other custom conventions
are supposed to work.

Based on a patch by peavo@outlook.com.

Fixes PR24051.

llvm-svn: 241725

9 years agoFixed erroneous comment.
John Thompson [Wed, 8 Jul 2015 20:57:32 +0000 (20:57 +0000)]
Fixed erroneous comment.

llvm-svn: 241724

9 years agoCleanup the doxygen comments in CGDebugInfo.h according to the coding
Adrian Prantl [Wed, 8 Jul 2015 20:53:55 +0000 (20:53 +0000)]
Cleanup the doxygen comments in CGDebugInfo.h according to the coding
standards and clang-format the file.

llvm-svn: 241723

9 years agoFix the spelling of Objective-C.
Adrian Prantl [Wed, 8 Jul 2015 20:53:53 +0000 (20:53 +0000)]
Fix the spelling of Objective-C.

llvm-svn: 241722

9 years agoStart adding support for writing archives in BSD format.
Rafael Espindola [Wed, 8 Jul 2015 20:47:32 +0000 (20:47 +0000)]
Start adding support for writing archives in BSD format.

No support for the symbol table yet (but will hopefully add it today).
We always use the long filename format so that we can align the member,
which is an advantage of the BSD format.

llvm-svn: 241721

9 years agoCOFF: Remove dead code.
Rui Ueyama [Wed, 8 Jul 2015 20:35:29 +0000 (20:35 +0000)]
COFF: Remove dead code.

r241647 made Driver to infer machine type, so this code is not actually in use.

llvm-svn: 241720

9 years agoCOFF: Implement dllimported symbol name mangling.
Rui Ueyama [Wed, 8 Jul 2015 20:22:50 +0000 (20:22 +0000)]
COFF: Implement dllimported symbol name mangling.

Symbols exported by DLLs are listed in import library files.
Exported names may be mangled by "Import Name Type" field as
described in PE/COFF spec 7.3. This patch implements that
mangling scheme.

llvm-svn: 241719

9 years agoMIR Parser: Use source locations for MBB naming errors.
Alex Lorenz [Wed, 8 Jul 2015 20:22:20 +0000 (20:22 +0000)]
MIR Parser: Use source locations for MBB naming errors.

This commit changes the type of the field 'Name' in the struct
'yaml::MachineBasicBlock' from 'std::string' to 'yaml::StringValue'. This change
allows the MIR parser to report errors related to the MBB name with the proper
source locations.

llvm-svn: 241718

9 years agoearly exits -> less indenting; NFCI
Sanjay Patel [Wed, 8 Jul 2015 19:32:39 +0000 (19:32 +0000)]
early exits -> less indenting; NFCI

llvm-svn: 241716

9 years ago[Hexagon] Implement commoning of GetElementPtr instructions
Krzysztof Parzyszek [Wed, 8 Jul 2015 19:22:28 +0000 (19:22 +0000)]
[Hexagon] Implement commoning of GetElementPtr instructions

llvm-svn: 241714

9 years agoCOFF: Set parent name for bitcode files.
Peter Collingbourne [Wed, 8 Jul 2015 19:14:33 +0000 (19:14 +0000)]
COFF: Set parent name for bitcode files.

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

llvm-svn: 241713

9 years agoImplement qXfer:libraries:read.
Stephane Sezer [Wed, 8 Jul 2015 19:14:03 +0000 (19:14 +0000)]
Implement qXfer:libraries:read.

Summary:
This is used on non-unix platforms, where qXfer:libraries-svr4:read
doesn't make sense. Windows uses that for instance.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 241712

9 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Wed, 8 Jul 2015 19:10:43 +0000 (19:10 +0000)]
Remove unused diagnostics. NFC.

llvm-svn: 241711

9 years agoLibDriver: Fix output path inference.
Peter Collingbourne [Wed, 8 Jul 2015 19:00:46 +0000 (19:00 +0000)]
LibDriver: Fix output path inference.

The inferred output file name is based on the first input file, not the
first one with extension .obj. The output file was also being written to
the wrong directory; it needs to be written to whichever directory on the
libpath it was found in. This change fixes both issues.

llvm-svn: 241710

9 years ago[Driver] print-multi-os-directory is unsupported.
Davide Italiano [Wed, 8 Jul 2015 18:49:41 +0000 (18:49 +0000)]
[Driver] print-multi-os-directory is unsupported.

Until somebody writes the code for it, be loud about the fact that
it's not implemented yet.

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

llvm-svn: 241708

9 years ago[LAA] Add missing debug output after r239285
Adam Nemet [Wed, 8 Jul 2015 18:47:38 +0000 (18:47 +0000)]
[LAA] Add missing debug output after r239285

r239285 ([LoopAccessAnalysis] Teach LAA to check the memory dependence
between strided accesses.) introduced a new case under
MemoryDepChecker::isDependent.  We normally have debug output for each
case.

llvm-svn: 241707

9 years ago[Static Analyzer] Make the paths relative from the project root when generating refer...
Gabor Horvath [Wed, 8 Jul 2015 18:39:31 +0000 (18:39 +0000)]
[Static Analyzer] Make the paths relative from the project root when generating reference results in the test suite.

llvm-svn: 241706

9 years agoAST: Avoid reading an unitialized value
Justin Bogner [Wed, 8 Jul 2015 18:32:26 +0000 (18:32 +0000)]
AST: Avoid reading an unitialized value

Desugar doesn't necessarily initialize ShouldAKA, but as of r241542 it
may read it. Fix the misuse of the API and initialize this before
passing it in.

Found by ubsan.

llvm-svn: 241705

9 years ago[SEH] Re-enable SEH on x86 Windows after r241699
Reid Kleckner [Wed, 8 Jul 2015 18:27:10 +0000 (18:27 +0000)]
[SEH] Re-enable SEH on x86 Windows after r241699

llvm-svn: 241704

9 years agoObject/COFF: Fix import library's getNameType method.
Rui Ueyama [Wed, 8 Jul 2015 18:21:09 +0000 (18:21 +0000)]
Object/COFF: Fix import library's getNameType method.

This expression to extract bits were simply wrong.
I'm going to test this functionality from LLD.

llvm-svn: 241703