platform/upstream/llvm.git
9 years agoSwitch test from wchar_t to char32_t
David Majnemer [Sun, 5 Apr 2015 05:42:02 +0000 (05:42 +0000)]
Switch test from wchar_t to char32_t

Windows has a 16-bit wchar_t, most Unix platforms have a 32-bit wchar_t.
Use a char32_t to keep the test's output stable.

llvm-svn: 234111

9 years ago[AST] String literal operator templates have two template args, not one
David Majnemer [Sun, 5 Apr 2015 05:32:54 +0000 (05:32 +0000)]
[AST] String literal operator templates have two template args, not one

StmtPrinter assumed that the first template arg was the pack and
attempted to iterate it.  However, the GNU extension (which is really
just N3599), has two template arguments.  In this case, the second
argument is the pack containing the string contents.

Handle this by desugaring the call to the explicit operator.

For example:
"qux" _zombocom will be shown as
operator "" _zombocom<char, 'q', 'u', 'x'>() in diagnostics and AST
dumps.

N.B.  It is actually impossible to render the arguments back to the
source form without storing more information in the AST.  For example,
we cannot tell if the user wrote u8"qux" or "qux".  We also lose
fidelity when it comes to non-char types for this exact reason (e.g. it
is hard to render a list of wchar_t back to something that can be
printed to the screen even if you don't have to consider surrogate
pairs).

This fixes PR23120.

llvm-svn: 234110

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sat, 4 Apr 2015 21:07:17 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations

llvm-svn: 234109

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sat, 4 Apr 2015 21:07:10 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations

llvm-svn: 234108

9 years agoremove function/variable names from comments; NFC
Sanjay Patel [Sat, 4 Apr 2015 21:06:39 +0000 (21:06 +0000)]
remove function/variable names from comments; NFC

llvm-svn: 234107

9 years agoless space; NFC
Sanjay Patel [Sat, 4 Apr 2015 21:05:52 +0000 (21:05 +0000)]
less space; NFC

llvm-svn: 234106

9 years ago[Mips] Do not use array initializer to fix Windows build bots
Simon Atanasyan [Sat, 4 Apr 2015 19:48:29 +0000 (19:48 +0000)]
[Mips] Do not use array initializer to fix Windows build bots

llvm-svn: 234105

9 years agoRevert "Revert "Revert "Don't use unique section names by default if using the integr...
Rafael Espindola [Sat, 4 Apr 2015 19:32:41 +0000 (19:32 +0000)]
Revert "Revert "Revert "Don't use unique section names by default if using the integrated as."""

This reverts commit r234101. I will debug what went wrong with ARM.

llvm-svn: 234104

9 years ago[Mips] Support writing .reginfo section into the linked file
Simon Atanasyan [Sat, 4 Apr 2015 19:13:32 +0000 (19:13 +0000)]
[Mips] Support writing .reginfo section into the linked file

In case of MIPS O32 ABI linker should merge registers usage masks stored
in the input .reginfo sections and save result into the output .reginfo
section.

The ABI states that the .reginfo section should be put into the separate
segment. This requirement is not implemented in this patch.

llvm-svn: 234103

9 years agoCopy paste error in gdb-remote doc.
Chaoren Lin [Sat, 4 Apr 2015 19:09:18 +0000 (19:09 +0000)]
Copy paste error in gdb-remote doc.

llvm-svn: 234102

9 years agoRevert "Revert "Don't use unique section names by default if using the integrated...
Rafael Espindola [Sat, 4 Apr 2015 18:21:14 +0000 (18:21 +0000)]
Revert "Revert "Don't use unique section names by default if using the integrated as.""

This reverts commit r233398, bringing back 233393 now that LLVM is fixed.

Original message:

Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

llvm-svn: 234101

9 years agoDon't mix overload and default values.
Rafael Espindola [Sat, 4 Apr 2015 18:16:01 +0000 (18:16 +0000)]
Don't mix overload and default values.

It makes it hard to see which one is being called.

llvm-svn: 234100

9 years agoImplement unique sections with an unique ID.
Rafael Espindola [Sat, 4 Apr 2015 18:02:01 +0000 (18:02 +0000)]
Implement unique sections with an unique ID.

This allows the compiler/assembly programmer to switch back to a
section. This in turn fixes the bootstrap failure on powerpc (tested
on gcc110) without changing the ppc codegen at all.

I will try to cleanup the various getELFSection overloads in a  followup patch.
Just using a default argument now would lead to ambiguities.

llvm-svn: 234099

9 years agoRemove one more empty directory.
Simon Atanasyan [Sat, 4 Apr 2015 15:25:19 +0000 (15:25 +0000)]
Remove one more empty directory.

llvm-svn: 234098

9 years ago[opaque pointer type] more GEP API migrations
David Blaikie [Sat, 4 Apr 2015 15:12:29 +0000 (15:12 +0000)]
[opaque pointer type] more GEP API migrations

llvm-svn: 234097

9 years ago[opaque pointer type] More (constant, in this instance) GEP API migrations
David Blaikie [Sat, 4 Apr 2015 15:12:13 +0000 (15:12 +0000)]
[opaque pointer type] More (constant, in this instance) GEP API migrations

llvm-svn: 234096

9 years agoRemove empty directories.
Simon Atanasyan [Sat, 4 Apr 2015 15:10:17 +0000 (15:10 +0000)]
Remove empty directories.

llvm-svn: 234095

9 years ago[clang-tidy] Added a couple of tests for misc-static-assert.
Alexander Kornienko [Sat, 4 Apr 2015 14:54:53 +0000 (14:54 +0000)]
[clang-tidy] Added a couple of tests for misc-static-assert.

llvm-svn: 234094

9 years agoRemove the cl-no-signed-zeros cc1 option
Sanjay Patel [Sat, 4 Apr 2015 14:54:24 +0000 (14:54 +0000)]
Remove the cl-no-signed-zeros cc1 option

Use the driver flag -fno-signed-zeros instead.

This was recommended but not implemented in D6873:
http://reviews.llvm.org/D6873

which was checked in at r226915:
http://reviews.llvm.org/rL226915

llvm-svn: 234093

9 years ago[DAGCombiner] Canonicalize vector constants for ADD/MUL/AND/OR/XOR re-association
Simon Pilgrim [Sat, 4 Apr 2015 10:20:31 +0000 (10:20 +0000)]
[DAGCombiner] Canonicalize vector constants for ADD/MUL/AND/OR/XOR re-association

Scalar integers are commuted to move constants to the RHS for re-association - this ensures vectors do the same.

llvm-svn: 234092

9 years agoclang-format: [JS] Understand object literals with only methods.
Daniel Jasper [Sat, 4 Apr 2015 07:56:55 +0000 (07:56 +0000)]
clang-format: [JS] Understand object literals with only methods.

Before:
  let theObject = {someMethodName() {
    doTheThing();
    doTheOtherThing();
  },
                   someOtherMethodName() {
                     doSomething();
                     doSomethingElse();
                   }};

After:
  let theObject = {
    someMethodName() {
      doTheThing();
      doTheOtherThing();
    },
    someOtherMethodName() {
      doSomething();
      doSomethingElse();
    }
  };

llvm-svn: 234091

9 years ago[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void
David Majnemer [Sat, 4 Apr 2015 05:37:48 +0000 (05:37 +0000)]
[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void

Don't assume that all pointers are convertible to void pointer.
Instead correctly respect [conv.ptr]p2; only allow pointer types with an
object pointee type to be caught as pointer-to-void.

llvm-svn: 234090

9 years ago[Hexagon] Remove duplicated typedef
Simon Atanasyan [Sat, 4 Apr 2015 05:19:58 +0000 (05:19 +0000)]
[Hexagon] Remove duplicated typedef

The `HexagonELFType` is declared in the HexagonLinkingContext.h.

llvm-svn: 234089

9 years ago[Hexagon][Mips] Rename template arguments <arch>ELFType to ELFT
Simon Atanasyan [Sat, 4 Apr 2015 05:19:51 +0000 (05:19 +0000)]
[Hexagon][Mips] Rename template arguments <arch>ELFType to ELFT

In all other ELF related classes we use `ELFT` abbreviation.

llvm-svn: 234088

9 years agoELF: Use short variable names in <Arch>RelocationHandlers.cpp.
Rui Ueyama [Sat, 4 Apr 2015 04:22:27 +0000 (04:22 +0000)]
ELF: Use short variable names in <Arch>RelocationHandlers.cpp.

Functions in the files are hard to read because of line wrapping.
Use shorter names for local variables so that the lines fit
within 80 columns.

llvm-svn: 234087

9 years ago[X86] Apply AddedComplexity consistently for similar patterns. This keeps them togeth...
Craig Topper [Sat, 4 Apr 2015 04:22:12 +0000 (04:22 +0000)]
[X86] Apply AddedComplexity consistently for similar patterns. This keeps them together in the DAGISel tables and reduces table size slightly.

llvm-svn: 234086

9 years agoRemove redundant anonymous namespace.
Rui Ueyama [Sat, 4 Apr 2015 04:10:08 +0000 (04:10 +0000)]
Remove redundant anonymous namespace.

llvm-svn: 234085

9 years agoFix formatting and coding style.
Eric Christopher [Sat, 4 Apr 2015 03:53:25 +0000 (03:53 +0000)]
Fix formatting and coding style.

llvm-svn: 234084

9 years agoComplete comment. Reflow conditional.
Eric Christopher [Sat, 4 Apr 2015 03:34:43 +0000 (03:34 +0000)]
Complete comment. Reflow conditional.

llvm-svn: 234083

9 years agoELF: Merge ELFTargets.h with ELFLinkingContext.h.
Rui Ueyama [Sat, 4 Apr 2015 03:24:42 +0000 (03:24 +0000)]
ELF: Merge ELFTargets.h with ELFLinkingContext.h.

These functions are "constructors" of the LinkingContexts. We already
have auxiliary classes and functions for ELFLinkingContext in the header.
They fall in the same category.

llvm-svn: 234082

9 years agoELF: Return TargetRelocationHandler instead of <ArcH>TargetRelocationHandler.
Rui Ueyama [Sat, 4 Apr 2015 02:59:52 +0000 (02:59 +0000)]
ELF: Return TargetRelocationHandler instead of <ArcH>TargetRelocationHandler.

getRelocationHandler is a public interface to get an instance of
TargetRelocationHandler. We don't use any member function other than
applyRelocations to a returned instance. Returning a base class instance
suffices here. (If a return type is a derived class, it looks like we were
using derived classes features.)

llvm-svn: 234081

9 years agoRemove a parameter for file extension from canParse.
Rui Ueyama [Sat, 4 Apr 2015 02:44:36 +0000 (02:44 +0000)]
Remove a parameter for file extension from canParse.

canParse took three parameters -- file magic, filename extension and
memory buffer. All but YAMLReader ignored the second parameter.
This patch removes the parameter.

llvm-svn: 234080

9 years ago[X86] Add a comment about the change in r234075.
Craig Topper [Sat, 4 Apr 2015 02:31:43 +0000 (02:31 +0000)]
[X86] Add a comment about the change in r234075.

llvm-svn: 234079

9 years agoStrip trailing whitespace and reword explanatory comment.
Eric Christopher [Sat, 4 Apr 2015 02:26:47 +0000 (02:26 +0000)]
Strip trailing whitespace and reword explanatory comment.

llvm-svn: 234078

9 years agoELF: Make private members private.
Rui Ueyama [Sat, 4 Apr 2015 02:26:17 +0000 (02:26 +0000)]
ELF: Make private members private.

llvm-svn: 234077

9 years agoELF: Remove ELF{Object,DSO}Reader alias templates.
Rui Ueyama [Sat, 4 Apr 2015 02:16:26 +0000 (02:16 +0000)]
ELF: Remove ELF{Object,DSO}Reader alias templates.

Because of the previous change (r234074), ELFObjectReader became just
an alias for ELFReader. We can replace all occurrences of ELFObjectReader
with ELFReader.

In this patch, I also replaced ELFDSOReader to remove the alias template.

llvm-svn: 234076

9 years ago[X86] Don't use GR64 register 'and with immediate' instructions if the immediate...
Craig Topper [Sat, 4 Apr 2015 02:08:20 +0000 (02:08 +0000)]
[X86] Don't use GR64 register 'and with immediate' instructions if the immediate is zero in the upper 33-bits or upper 57-bits. Use GR32 instructions instead.

Previously the patterns didn't have high enough priority and we would only use the GR32 form if the only the upper 32 or 56 bits were zero.

Fixes PR23100.

llvm-svn: 234075

9 years agoELF: Teach File classes about their file magics.
Rui Ueyama [Sat, 4 Apr 2015 02:07:30 +0000 (02:07 +0000)]
ELF: Teach File classes about their file magics.

So that we can remove one template parameter from ELFReader.
ELF port is heavily templatized, and I want to reduce the usage
where possible.

llvm-svn: 234074

9 years agos/context/ctx/g on lib/Driver/Driver.cpp.
Rui Ueyama [Sat, 4 Apr 2015 01:37:25 +0000 (01:37 +0000)]
s/context/ctx/g on lib/Driver/Driver.cpp.

llvm-svn: 234073

9 years agoRemove unused member function declarations.
Rui Ueyama [Sat, 4 Apr 2015 01:37:23 +0000 (01:37 +0000)]
Remove unused member function declarations.

llvm-svn: 234072

9 years agoUse insert instead of append when adding to sys.path.
Chaoren Lin [Sat, 4 Apr 2015 01:11:31 +0000 (01:11 +0000)]
Use insert instead of append when adding to sys.path.

Similar problem as in the last part of r200486.

llvm-svn: 234071

9 years agoRemove unused includes and forward declarations.
Rui Ueyama [Sat, 4 Apr 2015 00:25:22 +0000 (00:25 +0000)]
Remove unused includes and forward declarations.

llvm-svn: 234070

9 years agoRemove unused functions.
Rui Ueyama [Sat, 4 Apr 2015 00:12:27 +0000 (00:12 +0000)]
Remove unused functions.

llvm-svn: 234069

9 years agoELF: Define mergeHeaderFlags to ELFLinkingContext.
Rui Ueyama [Sat, 4 Apr 2015 00:10:14 +0000 (00:10 +0000)]
ELF: Define mergeHeaderFlags to ELFLinkingContext.

Only MIPS defined the member function, but this feature is not actually
MIPS-specific. Also, the dependency to the MIPS-only member function
prevented us from merging <Arch>ELF{Object,DSO}Reader classes.

This patch moves the feature from MipsLinkingContext to LinkingContext.

llvm-svn: 234068

9 years ago[WinEH] Fill out CatchHigh in the TryBlockMap
David Majnemer [Fri, 3 Apr 2015 23:37:34 +0000 (23:37 +0000)]
[WinEH] Fill out CatchHigh in the TryBlockMap

Now all fields in the WinEH xdata have been filled out.

llvm-svn: 234067

9 years ago[ELF] Remove unused typedef
Simon Atanasyan [Fri, 3 Apr 2015 23:07:18 +0000 (23:07 +0000)]
[ELF] Remove unused typedef

llvm-svn: 234066

9 years ago[ELF] Merge Layout and TargetLayout class
Simon Atanasyan [Fri, 3 Apr 2015 23:07:13 +0000 (23:07 +0000)]
[ELF] Merge Layout and TargetLayout class

It is enough to have single TargetLayout class.

llvm-svn: 234065

9 years ago[opaque pointer type] More GEP IRBuilder API migrations
David Blaikie [Fri, 3 Apr 2015 23:03:54 +0000 (23:03 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations

llvm-svn: 234064

9 years ago[opaque pointer type] Explicitly specify some types for GEP
David Blaikie [Fri, 3 Apr 2015 22:54:16 +0000 (22:54 +0000)]
[opaque pointer type] Explicitly specify some types for GEP

Not all of them (there's still a fallback for this specific function
that omits the type parameter) but it's some I bothered to do now.

llvm-svn: 234063

9 years ago[WinEH] Fill out .xdata for catch objects
David Majnemer [Fri, 3 Apr 2015 22:49:05 +0000 (22:49 +0000)]
[WinEH] Fill out .xdata for catch objects

This add support for catching an exception such that an exception object
available to the catch handler will be initialized by the runtime.

llvm-svn: 234062

9 years ago[WinEH] Sink UnwindHelp completely out of IR
David Majnemer [Fri, 3 Apr 2015 22:32:26 +0000 (22:32 +0000)]
[WinEH] Sink UnwindHelp completely out of IR

We don't need to represent UnwindHelp in IR.  Instead, we can use the
knowledge that we are emitting the parent function to decide if we
should create the UnwindHelp stack object.

llvm-svn: 234061

9 years agoELF: Merge ELF{Object,DSO}Reader implementations.
Rui Ueyama [Fri, 3 Apr 2015 22:12:18 +0000 (22:12 +0000)]
ELF: Merge ELF{Object,DSO}Reader implementations.

The two classes are the same other than a few exceptions.
This patch merges them using templates.

llvm-svn: 234060

9 years agoFixing a memory leak in WinEHPrepare
Andrew Kaylor [Fri, 3 Apr 2015 21:44:17 +0000 (21:44 +0000)]
Fixing a memory leak in WinEHPrepare

llvm-svn: 234059

9 years ago[opaque pointer type] More GEP IRBuilder API migrations...
David Blaikie [Fri, 3 Apr 2015 21:33:42 +0000 (21:33 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations...

llvm-svn: 234058

9 years agoUse early returns to reduce indentation.
David Blaikie [Fri, 3 Apr 2015 21:32:06 +0000 (21:32 +0000)]
Use early returns to reduce indentation.

llvm-svn: 234057

9 years agoELF: Remove <Arch>ELFReader.h. NFC.
Rui Ueyama [Fri, 3 Apr 2015 21:22:20 +0000 (21:22 +0000)]
ELF: Remove <Arch>ELFReader.h. NFC.

<Arch>ELFReader.h contains only a few typedefs. The typedefs are used
only by one class in <Arch>TargetHandler.h. Thus, the headers don't
worth to be independent files.

Since MipsELFReader.h contains code other than the boilerplate, I didn't
touch that file in this patch.

llvm-svn: 234056

9 years agoclang-format: [Proto] No alternate operator names.
Daniel Jasper [Fri, 3 Apr 2015 21:15:46 +0000 (21:15 +0000)]
clang-format: [Proto] No alternate operator names.

llvm-svn: 234055

9 years ago[ELF] Delete empty TargetLayout class and rename DefaultLayout to TargetLayout
Simon Atanasyan [Fri, 3 Apr 2015 21:01:07 +0000 (21:01 +0000)]
[ELF] Delete empty TargetLayout class and rename DefaultLayout to TargetLayout

No functional changes.

llvm-svn: 234052

9 years agoFix a typo
David Majnemer [Fri, 3 Apr 2015 20:56:24 +0000 (20:56 +0000)]
Fix a typo

CHECK-LABEL had the wrong function name.

llvm-svn: 234051

9 years agoELF: Fix header file dependencies.
Rui Ueyama [Fri, 3 Apr 2015 20:56:22 +0000 (20:56 +0000)]
ELF: Fix header file dependencies.

<Arch>TargetHandler.h and <ArcH>RelocationHandler.h include each other.
This patch breaks the circular dependencies.

llvm-svn: 234050

9 years ago[dotest.py] Present a better error when lldb module can't be found.
Zachary Turner [Fri, 3 Apr 2015 20:56:15 +0000 (20:56 +0000)]
[dotest.py] Present a better error when lldb module can't be found.

We try to run lldb -P and jump through a bunch of other hoops
to figure out where the Python module is so that we can add its
location to sys.path.  The error message printed when this
doesn't work was left over from the time when Mac was the only
platform, so it presented a Mac-specific diagnostic on all
platforms related to the LLDB Framework.  This patch prints
a more useful diagnostic when not on Mac that gives a number
of other diagnostic messages to check.

llvm-svn: 234049

9 years agoFix FreeBSD crash after r233837
Ed Maste [Fri, 3 Apr 2015 20:49:08 +0000 (20:49 +0000)]
Fix FreeBSD crash after r233837

The FreeBSD debug register access is a little usual, but in any case
different from Linux. As it stands it's not possible to share an
implementation of DR_OFFSET, so revert that part of r233837 and provide
a separate FreeBSD and Linux implementation.

We'll still want a better fix, but this should restore basic
functionality (and the buildbot).

llvm-svn: 234048

9 years agoELF: Pass file types instead of type traits to ELFObjectReader.
Rui Ueyama [Fri, 3 Apr 2015 20:29:37 +0000 (20:29 +0000)]
ELF: Pass file types instead of type traits to ELFObjectReader.

All <Arch>ELFFileCreateFileTraits structs are the same except its file type.
That means that we don't need to pass the type traits. Instead, we can only
pass file types. By doing this, we can remove copy-pasted boilerplates.

llvm-svn: 234047

9 years ago[InstCombine] Use DataLayout to determine vector element width
David Majnemer [Fri, 3 Apr 2015 20:18:40 +0000 (20:18 +0000)]
[InstCombine] Use DataLayout to determine vector element width

InstCombine didn't realize that it needs to use DataLayout to determine
how wide pointers are.  This lead to assertion failures.

This fixes PR23113.

llvm-svn: 234046

9 years agoFixing a build error
Andrew Kaylor [Fri, 3 Apr 2015 19:55:30 +0000 (19:55 +0000)]
Fixing a build error

llvm-svn: 234045

9 years agoInline typedef'ed type that's used only once. NFC.
Rui Ueyama [Fri, 3 Apr 2015 19:46:56 +0000 (19:46 +0000)]
Inline typedef'ed type that's used only once. NFC.

result_type is no longer part of the type traits, so keeping it here
is confusing.

llvm-svn: 234044

9 years agoFixing build warnings.
Andrew Kaylor [Fri, 3 Apr 2015 19:45:32 +0000 (19:45 +0000)]
Fixing build warnings.

llvm-svn: 234043

9 years ago[opaque pointer type] More GEP API migrations in IRBuilder uses
David Blaikie [Fri, 3 Apr 2015 19:41:44 +0000 (19:41 +0000)]
[opaque pointer type] More GEP API migrations in IRBuilder uses

The plan here is to push the API changes out from the common components
(like Constant::getGetElementPtr and IRBuilder::CreateGEP related
functions) and just update callers to either pass the type if it's
obvious, or pass null.

Do this with LoadInst as well and anything else that comes up, then to
start porting specific uses to not pass null anymore - this may require
some refactoring in each case.

llvm-svn: 234042

9 years ago[WinEH] Handle nested landing pads in outlined catch handlers
Andrew Kaylor [Fri, 3 Apr 2015 19:37:50 +0000 (19:37 +0000)]
[WinEH] Handle nested landing pads in outlined catch handlers

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

llvm-svn: 234041

9 years ago[ELF] Fix Layout class name in the comment
Simon Atanasyan [Fri, 3 Apr 2015 19:35:12 +0000 (19:35 +0000)]
[ELF] Fix Layout class name in the comment

No functional changes.

llvm-svn: 234040

9 years agoELF: Remove partial class definitions of <Arch>LinkingContexts.
Rui Ueyama [Fri, 3 Apr 2015 19:32:31 +0000 (19:32 +0000)]
ELF: Remove partial class definitions of <Arch>LinkingContexts.

What we are doing in ELFTarget.h was dubious. In the file, we define
partial classes of <Arch>LinkingContexts to declare only static member
functions. We have different (complete) class definitions in other files.
They would conflict if they exist in the same compilation unit (because
the ones defined in ELFTarget.h has only static member functions).
I don't think this was valid C++.

http://reviews.llvm.org/D8797

llvm-svn: 234039

9 years agoCodeGen: Assert that inlined-at locations agree
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 19:20:26 +0000 (19:20 +0000)]
CodeGen: Assert that inlined-at locations agree

As a follow-up to r234021, assert that a debug info intrinsic variable's
`MDLocalVariable::getInlinedAt()` always matches the
`MDLocation::getInlinedAt()` of its `!dbg` attachment.

The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), but I'll let these assertions bake for a while
first.

If you have an out-of-tree backend that just broke, you're probably
attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction.  The one
you want is the location that was attached to the corresponding
`@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with.

llvm-svn: 234038

9 years agoAdd missing include
Justin Bogner [Fri, 3 Apr 2015 19:10:35 +0000 (19:10 +0000)]
Add missing include

llvm-svn: 234037

9 years agoprofile: Protect .gcda output with flock
Justin Bogner [Fri, 3 Apr 2015 18:55:44 +0000 (18:55 +0000)]
profile: Protect .gcda output with flock

This avoids crashing or corrupting data if multiple concurrent
processes write to the same .gcda file. This is hard to test, since
the previous behaviour was a data race that often worked out, and it
ignores errors in flock to fall back to the old racy behaviour so that
it won't degrade the behaviour on filesystems that don't support
flock.

llvm-svn: 234036

9 years ago[WinEH] Fold cast into assertion based on review feedback
Reid Kleckner [Fri, 3 Apr 2015 18:18:06 +0000 (18:18 +0000)]
[WinEH] Fold cast into assertion based on review feedback

llvm-svn: 234034

9 years ago[i386 ABI] expand small C like structs in C++, just like how we handle small
Manman Ren [Fri, 3 Apr 2015 18:10:29 +0000 (18:10 +0000)]
[i386 ABI] expand small C like structs in C++, just like how we handle small
C structs.

This comes up when we have a function that takes a struct and is defined in a
C++ file and used in a C file.

Before this commit, we will generate byval for C++ and will expand the struct
for C, thus causing difference at IR level. We will use bitcast of function type
at the callsite, which causes the inliner to not inline the function.

This commit changes how we handle small C like structs at IR level, but at
backend, we should generate the same argument passing before and after the
commit.

Note that the condition for expanding is still over conservative. We should be
able to expand type that is spelled with “class” and types that are not C-like.
But this commit fixes the inconsistent argument passing between C/C++.

Reviewed by John.

rdar://20121030

llvm-svn: 234033

9 years ago[opaque pointer type] Explicitly specify type to CreateGEP
David Blaikie [Fri, 3 Apr 2015 17:47:16 +0000 (17:47 +0000)]
[opaque pointer type] Explicitly specify type to CreateGEP

llvm-svn: 234032

9 years ago[GraphWriter] Attempt to open .dot files with xdg-open/open first
Matthias Braun [Fri, 3 Apr 2015 17:22:36 +0000 (17:22 +0000)]
[GraphWriter] Attempt to open .dot files with xdg-open/open first

Most desktop environments let the users specify his preferred application per
file type. On mac/linux we can use open/xdg-open for that and should try this
first before starting a heuristic search for various programs.

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

llvm-svn: 234031

9 years agoDon't use literal slashes when concatenating paths in Python.
Zachary Turner [Fri, 3 Apr 2015 17:19:43 +0000 (17:19 +0000)]
Don't use literal slashes when concatenating paths in Python.

This patch fixes the swig generation scripts to use os.path.join
instead, which produces correctly normalized paths for platforms
that don't use the standard forward slash separator.

llvm-svn: 234030

9 years agouse update_llc_test_checks.py to tighten checking; remove unnecessary testing params
Sanjay Patel [Fri, 3 Apr 2015 17:17:50 +0000 (17:17 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params

llvm-svn: 234029

9 years agoMarked the modules tests as expected failures,
Sean Callanan [Fri, 3 Apr 2015 17:17:12 +0000 (17:17 +0000)]
Marked the modules tests as expected failures,
because the OS X builders aren't happy with them.

<rdar://problem/20416388>

llvm-svn: 234028

9 years agouse update_llc_test_checks.py to tighten checking; remove unnecessary testing params
Sanjay Patel [Fri, 3 Apr 2015 17:13:31 +0000 (17:13 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params

llvm-svn: 234027

9 years agoSelectionDAG: Use specialized metadata nodes in EmitFuncArgumentDbgValue(), NFC
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 17:11:42 +0000 (17:11 +0000)]
SelectionDAG: Use specialized metadata nodes in EmitFuncArgumentDbgValue(), NFC

Use `MDLocalVariable` and `MDExpression` directly for the arguments of
`EmitFuncArgumentDbgValue()` to simplify a follow-up patch.

llvm-svn: 234026

9 years agoFix LLDB test tracing to include the output (stdout and stderr) of each shell command.
Adrian McCarthy [Fri, 3 Apr 2015 17:10:30 +0000 (17:10 +0000)]
Fix LLDB test tracing to include the output (stdout and stderr) of each shell command.

llvm-svn: 234025

9 years agouse update_llc_test_checks.py to tighten checking; remove unnecessary testing params
Sanjay Patel [Fri, 3 Apr 2015 17:09:37 +0000 (17:09 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params

llvm-svn: 234024

9 years agoA new testcase had a silly integer-value mismatch.
Sean Callanan [Fri, 3 Apr 2015 17:08:45 +0000 (17:08 +0000)]
A new testcase had a silly integer-value mismatch.
Fixed that.

llvm-svn: 234023

9 years agouse update_llc_test_checks.py to tighten checking
Sanjay Patel [Fri, 3 Apr 2015 17:02:48 +0000 (17:02 +0000)]
use update_llc_test_checks.py to tighten checking

remove redundant and unnecessary test parameters

llvm-svn: 234022

9 years agoVerifier: Check that inlined-at locations agree
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 16:54:30 +0000 (16:54 +0000)]
Verifier: Check that inlined-at locations agree

Check that the `MDLocalVariable::getInlinedAt()` in a debug info
intrinsic's variable always matches the `MDLocation::getInlinedAt()` of
its `!dbg` attachment.

The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), since it's expensive and unnecessary, but I'll let
this verifier check bake for a while (a week maybe?) first.  I've
updated the testcases that had the wrong value for `inlinedAt:`.

This checks that things are sane in the IR, but currently things go out
of whack in a few places in the backend.  I'll follow shortly with
assertions in the backend (with code fixes).

If you have out-of-tree testcases that just started failing, here's how
I updated these ones:

 1. The verifier check gives you the basic block, function, instruction,
    and relevant metadata arguments (metadata numbering doesn't
    necessarily match the source file, unfortunately).
 2. Look at the `@llvm.dbg.*()` instruction, and compare the
    `inlinedAt:` fields of the variable argument (second `metadata`
    argument) and the `!dbg` attachment.
 3. Figure out based on the variable `scope:` chain and the functions in
    the file whether the variable has been inlined (and into what), so
    you can determine which `inlinedAt:` is actually correct.  In all of
    the in-tree testcases, the `!MDLocation()` was correct and the
    `!MDLocalVariable()` was wrong, but YMMV.
 4. Duplicate the metadata that you're going to change, and add/drop the
    `inlinedAt:` field from one of them.  Be careful that the other
    references to the same metadata node point at the correct one.

llvm-svn: 234021

9 years agoadd checks; remove redundant testing parameters
Sanjay Patel [Fri, 3 Apr 2015 16:44:42 +0000 (16:44 +0000)]
add checks; remove redundant testing parameters

llvm-svn: 234020

9 years agoCodeGen: Fix MachineInstr::print() for DBG_VALUE
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 16:23:04 +0000 (16:23 +0000)]
CodeGen: Fix MachineInstr::print() for DBG_VALUE

Grab the `MDLocalVariable` from the second-to-last argument; the last
argument is an `MDExpression`, and mixing them up will crash.

llvm-svn: 234019

9 years ago[MachineLICM] Small cleanup: Constify and rangeify.
Daniel Jasper [Fri, 3 Apr 2015 16:19:48 +0000 (16:19 +0000)]
[MachineLICM] Small cleanup: Constify and rangeify.

NFC.

llvm-svn: 234018

9 years agouse update_llc_test_checks.py to tighten checking; remove darwin and sandybridge...
Sanjay Patel [Fri, 3 Apr 2015 16:06:58 +0000 (16:06 +0000)]
use update_llc_test_checks.py to tighten checking; remove darwin and sandybridge overspecification

llvm-svn: 234017

9 years agoAdded a testcase that covers loading a module and
Sean Callanan [Fri, 3 Apr 2015 15:39:47 +0000 (15:39 +0000)]
Added a testcase that covers loading a module and
verifying that the types from that module don't
override types from DWARF.  Also added a target setting
to LLDB so we can tell Clang where to look for these
local modules.

<rdar://problem/18805055>

llvm-svn: 234016

9 years agoAdded vector tests for DAGCombiner::ReassociateOps
Simon Pilgrim [Fri, 3 Apr 2015 15:04:46 +0000 (15:04 +0000)]
Added vector tests for DAGCombiner::ReassociateOps

Missing vector tests for rL233482

llvm-svn: 234015

9 years agoFix for revision r234009 (gcc/msvc compilation differences)
Leny Kholodov [Fri, 3 Apr 2015 14:44:33 +0000 (14:44 +0000)]
Fix for revision r234009 (gcc/msvc compilation differences)

llvm-svn: 234014

9 years ago[X86] Added SSE4.2 CRC32 memory folding patterns + tests
Simon Pilgrim [Fri, 3 Apr 2015 14:24:40 +0000 (14:24 +0000)]
[X86] Added SSE4.2 CRC32 memory folding patterns + tests

llvm-svn: 234013

9 years ago[PowerPC] Enable splat generation for BUILD_VECTOR with little endian
Bill Schmidt [Fri, 3 Apr 2015 13:48:24 +0000 (13:48 +0000)]
[PowerPC] Enable splat generation for BUILD_VECTOR with little endian

When enabling PPC64LE, I disabled some optimizations of BUILD_VECTOR
nodes for little endian because wrong results were produced.  I've
subsequently investigated and found this is due to a call to
BuildVectorSDNode::isConstantSplat that was always specifying
big-endian.  With this changed to correctly identify the target
endianness, the optimizations work as expected.

I found another case of a call to the same method with big-endian
hardcoded, in PPC::isAllNegativeZeroVector().  I discovered this was
an orphaned method with no callers, so I've just removed it.

The existing test/CodeGen/PowerPC/vec_constants.ll checks these
optimizations, so for testing I've just added a variant for little
endian.

llvm-svn: 234011

9 years ago[sancov] Shrink pc array on Android back to 2**24.
Evgeniy Stepanov [Fri, 3 Apr 2015 12:59:39 +0000 (12:59 +0000)]
[sancov] Shrink pc array on Android back to 2**24.

Address space is a lot more constrained on 32-bit Android compared to Linux.

llvm-svn: 234010

9 years ago[ARM] Implementation of R_ARM_TARGET1 relocation
Leny Kholodov [Fri, 3 Apr 2015 12:03:47 +0000 (12:03 +0000)]
[ARM] Implementation of R_ARM_TARGET1 relocation

This patch provides implementation of R_ARM_TARGET1 relocation with
configuration of its behaviour from a command line. This patch provides
two command line options for GnuLd driver: --arm-target1-rel and
--arm-target1-abs (similar to ld option names with extra prefix 'arm-').
So user may choose which behaviour of R_ARM_TARGET1 is preferred for his
implementation of libc.

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

llvm-svn: 234009

9 years ago[X86][3DNow] Added 3DNow! memory folding patterns + tests
Simon Pilgrim [Fri, 3 Apr 2015 11:50:30 +0000 (11:50 +0000)]
[X86][3DNow] Added 3DNow! memory folding patterns + tests

llvm-svn: 234008