platform/upstream/llvm.git
11 years agoPPC: Don't predicate a diamond with two counter decrements
Hal Finkel [Wed, 10 Apr 2013 18:30:16 +0000 (18:30 +0000)]
PPC: Don't predicate a diamond with two counter decrements

I've not seen this happen in practice, and probably can't until we start
allowing decrement-counter-based conditional branches to be double predicated,
but just in case, don't allow predication of a diamond in which both sides have
ctr-defining branches. Even though the branching behavior of these can be
predicated, the counter-decrementing behavior cannot be.

llvm-svn: 179199

11 years ago[ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
Chad Rosier [Wed, 10 Apr 2013 18:08:17 +0000 (18:08 +0000)]
[ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
version as lea is only available in 64-bit mode.

llvm-svn: 179190

11 years agoReapply r179115, but use parsePrimaryExpression a little more judiciously.
Chad Rosier [Wed, 10 Apr 2013 17:35:30 +0000 (17:35 +0000)]
Reapply r179115, but use parsePrimaryExpression a little more judiciously.
Test cases that regressed due to r179115, plus a few more, were added in
r179182.  Original commit message below:

[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
parse an identifier.  Otherwise, parseExpression may parse multiple tokens,
which makes it impossible to properly compute an immediate displacement.
An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in
the below example:

 __asm mov eax, [Symbol + ImmDisp]

Part of rdar://13611297

llvm-svn: 179187

11 years agoR600/SI: Add pattern for AMDGPUurecip
Michel Danzer [Wed, 10 Apr 2013 17:17:56 +0000 (17:17 +0000)]
R600/SI: Add pattern for AMDGPUurecip

21 more little piglits with radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 179186

11 years agoThis is for an experimental option -mips-os16. The idea is to compile all
Reed Kotler [Wed, 10 Apr 2013 16:58:04 +0000 (16:58 +0000)]
This is for an experimental option -mips-os16. The idea is to compile all
Mips32 code as Mips16 unless it can't be compiled as Mips 16. For now this
would happen as long as floating point instructions are not needed.
Probably it would also make sense to compile as mips32 if atomic operations
are needed too. There may be other cases too.

A module pass prescans the IR and adds the mips16 or nomips16 attribute
to functions depending on the functions needs.

Mips 16 mode can result in a 40% code compression by utililizing 16 bit
encoding of many instructions.

The hope is for this to replace the traditional gcc way of dealing with
Mips16 code using floating point which involves essentially using soft float
but with a library implemented using mips32 floating point. This gcc
method also requires creating stubs so that Mips32 code can interact with
these Mips 16 functions that have floating point needs. My conjecture is
that in reality this traditional gcc method would never win over this
new method.

I will be implementing the traditional gcc method also. Some of it is already
done but I needed to do the stubs to finish the work and those required
this mips16/32 mixed mode capability.

I have more ideas for to make this new method much better and I think the old
method will just live in llvm for anyone that needs the backward compatibility
but I don't for what reason that would be needed.

llvm-svn: 179185

11 years agoUse a scheme closer to that of GNU as when deciding the type of a
Peter Collingbourne [Wed, 10 Apr 2013 16:52:15 +0000 (16:52 +0000)]
Use a scheme closer to that of GNU as when deciding the type of a
symbol with multiple .type declarations.

Differential Revision: http://llvm-reviews.chandlerc.com/D607

llvm-svn: 179184

11 years agofix testcase
Sebastian Pop [Wed, 10 Apr 2013 16:44:08 +0000 (16:44 +0000)]
fix testcase

llvm-svn: 179183

11 years ago[ms-inline asm] Add a few test cases that were regressed by r179115. That
Chad Rosier [Wed, 10 Apr 2013 16:33:34 +0000 (16:33 +0000)]
[ms-inline asm] Add a few test cases that were regressed by r179115.  That
commit was reverted in r179120, but I do plan on reapplying with a fix shortly.
Part of rdar://13611297

llvm-svn: 179182

11 years agoAdd testcases for -fparse-all-comments
Dmitri Gribenko [Wed, 10 Apr 2013 16:31:58 +0000 (16:31 +0000)]
Add testcases for -fparse-all-comments

llvm-svn: 179181

11 years agoAdd an option to parse all comments as documentation comments
Dmitri Gribenko [Wed, 10 Apr 2013 15:35:17 +0000 (15:35 +0000)]
Add an option to parse all comments as documentation comments

Patch by Amin Shali.

llvm-svn: 179180

11 years agoTemplate MachOObjectFile over endianness too.
Rafael Espindola [Wed, 10 Apr 2013 15:33:44 +0000 (15:33 +0000)]
Template MachOObjectFile over endianness too.

llvm-svn: 179179

11 years agoSimplify the templating a bit.
Rafael Espindola [Wed, 10 Apr 2013 15:18:39 +0000 (15:18 +0000)]
Simplify the templating a bit.

Since we only ever instantiate with a type that is a MachOType instantiation,
we don't need to pass template argument.

llvm-svn: 179178

11 years ago[ASan] Do not check the shadow of NULL argument in the time() interceptor.
Alexander Potapenko [Wed, 10 Apr 2013 15:13:00 +0000 (15:13 +0000)]
[ASan] Do not check the shadow of NULL argument in the time() interceptor.
Add a test for time().

llvm-svn: 179177

11 years agoMove two methods out of line.
Rafael Espindola [Wed, 10 Apr 2013 14:57:48 +0000 (14:57 +0000)]
Move two methods out of line.

llvm-svn: 179176

11 years ago[asan] implement callbacks for unaligned loads/stores
Kostya Serebryany [Wed, 10 Apr 2013 13:59:32 +0000 (13:59 +0000)]
[asan] implement callbacks for unaligned loads/stores

Reviewers: samsonov

Reviewed By: samsonov

CC: samsonov, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D652

llvm-svn: 179175

11 years agoR600: Add VTX_READ_* and RAT_WRITE_CACHELESS_* when computing cf addr
Vincent Lejeune [Wed, 10 Apr 2013 13:29:20 +0000 (13:29 +0000)]
R600: Add VTX_READ_* and RAT_WRITE_CACHELESS_* when computing cf addr

llvm-svn: 179174

11 years ago[test] Use lit's shell test runner on Windows
Reid Kleckner [Wed, 10 Apr 2013 13:11:38 +0000 (13:11 +0000)]
[test] Use lit's shell test runner on Windows

Summary:
I did a local comparison between using bash and using lit's runner, and
more of the suite passes with lit than passes with bash.  Most of the
bash failures have to do with /dev/null, which is nonsensical on
Windows, but the lit runner handles it.

The lit shell runner is also much faster than bash, so I would expect
most Windows devs would want it by default.

The behavior can be overridden on any OS by setting
LIT_USE_INTERNAL_SHELL to 0 or 1 in the environment.

Reviewers: chapuni, ddunbar

CC: llvm-commits, timurrrr
Differential Revision: http://llvm-reviews.chandlerc.com/D559

llvm-svn: 179173

11 years agoRevert "TMP"
Tim Northover [Wed, 10 Apr 2013 12:08:57 +0000 (12:08 +0000)]
Revert "TMP"

This reverts commit e652085eacbec62e4157d08d3f2f875e6e6d5bb4.

llvm-svn: 179172

11 years agoARM: Make "SMC" instructions conditional on new TrustZone architecture feature.
Tim Northover [Wed, 10 Apr 2013 12:08:35 +0000 (12:08 +0000)]
ARM: Make "SMC" instructions conditional on new TrustZone architecture feature.

These instructions aren't universally available, but depend on a specific
extension to the normal ARM architecture (rather than, say, v6/v7/...) so a new
feature is appropriate.

This also enables the feature by default on A-class cores which usually have
these extensions, to avoid breaking existing code and act as a sensible
default.

llvm-svn: 179171

11 years agoTMP
Tim Northover [Wed, 10 Apr 2013 12:08:25 +0000 (12:08 +0000)]
TMP

llvm-svn: 179170

11 years agoChange CloneFunctionInto to always clone Argument attributes induvidually,
Joey Gouly [Wed, 10 Apr 2013 10:37:38 +0000 (10:37 +0000)]
Change CloneFunctionInto to always clone Argument attributes induvidually,
rather than checking if the source and destination have the same number of
arguments and copying the attributes over directly.

llvm-svn: 179169

11 years agoFixes recovering from errors when parsing braced init lists.
Manuel Klimek [Wed, 10 Apr 2013 09:52:05 +0000 (09:52 +0000)]
Fixes recovering from errors when parsing braced init lists.

Before we would build huge unwrapped lines which take a long time
to optimze.

llvm-svn: 179168

11 years agoFix labels with trailing comments and cleanup.
Daniel Jasper [Wed, 10 Apr 2013 09:49:49 +0000 (09:49 +0000)]
Fix labels with trailing comments and cleanup.

Before:
class A {
public : // test
};

After:
class A {
public: // test
};

Also remove duplicate methods calculating properties of AnnotatedTokens
and make them members of AnnotatedTokens so that they are in a common
place.

llvm-svn: 179167

11 years agoR600/SI: dynamical figure out the reg class of MIMG
Christian Konig [Wed, 10 Apr 2013 08:39:16 +0000 (08:39 +0000)]
R600/SI: dynamical figure out the reg class of MIMG

Depending on the number of bits set in the writemask.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 179166

11 years agoR600/SI: adjust writemask to only the used components
Christian Konig [Wed, 10 Apr 2013 08:39:08 +0000 (08:39 +0000)]
R600/SI: adjust writemask to only the used components

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 179165

11 years agoR600/SI: remove image sample writemask
Christian Konig [Wed, 10 Apr 2013 08:39:01 +0000 (08:39 +0000)]
R600/SI: remove image sample writemask

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 179164

11 years agoScopDetect: Allow multiplications of the form <param> * <param>
Tobias Grosser [Wed, 10 Apr 2013 07:42:28 +0000 (07:42 +0000)]
ScopDetect: Allow multiplications of the form <param> * <param>

We handle these by treating this result of the multiplication as an additional
parameter.

llvm-svn: 179163

11 years agoCleanup PPCInstrInfo::DefinesPredicate
Hal Finkel [Wed, 10 Apr 2013 07:17:47 +0000 (07:17 +0000)]
Cleanup PPCInstrInfo::DefinesPredicate

Implement suggestions made by Bill Schmidt in post-commit review. Thanks!

llvm-svn: 179162

11 years ago[ASan] fix a typo in legend in error report
Alexey Samsonov [Wed, 10 Apr 2013 07:00:25 +0000 (07:00 +0000)]
[ASan] fix a typo in legend in error report

llvm-svn: 179161

11 years agoUpdate formatting to latest version of clang-format
Tobias Grosser [Wed, 10 Apr 2013 06:55:45 +0000 (06:55 +0000)]
Update formatting to latest version of clang-format

llvm-svn: 179160

11 years agoSupport SCoPs with multiple exit edges
Tobias Grosser [Wed, 10 Apr 2013 06:55:31 +0000 (06:55 +0000)]
Support SCoPs with multiple exit edges

Regions that have multiple exit edges are very common. A simple if condition
yields e.g. such a region:

        if
      /   \
  then     else
      \   /
      after

Region: if -> after

This regions contains the bbs 'if', 'then', 'else', but not 'after'. It has
two exit edges 'then' -> 'after' and 'else' -> 'after'.

Previously we scheduled the RegionSimplify pass to translate such regions into
simple regions. With this patch, we now support them natively.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 179159

11 years agoCodegen: Replace region exit and entries recursively
Tobias Grosser [Wed, 10 Apr 2013 06:55:20 +0000 (06:55 +0000)]
Codegen: Replace region exit and entries recursively

During code generation we split the original entry and exit basic blocks
of the scop to make room for the newly generated code. To keep the region tree
up to date, we need to update the region tree. This patch ensures that not only
the region of the scop is updated, but also all child regions that share the
same entry or exit block.

We have now test case here, as the bug is only exposed by the subsequent commit.
The test cases of that commit also cover this bug.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 179158

11 years agoRegionInfo: Add helpers to replace entry/exit recursively
Tobias Grosser [Wed, 10 Apr 2013 06:54:49 +0000 (06:54 +0000)]
RegionInfo: Add helpers to replace entry/exit recursively

Contributed by: Star Tan <tanmx_star@yeah.net>

llvm-svn: 179157

11 years agoPPC: Prep for if conversion of bctr[l]
Hal Finkel [Wed, 10 Apr 2013 06:42:34 +0000 (06:42 +0000)]
PPC: Prep for if conversion of bctr[l]

This adds in-principle support for if-converting the bctr[l] instructions.
These instructions are used for indirect branching. It seems, however, that the
current if converter will never actually predicate these. To do so, it would
need the ability to hoist a few setup insts. out of the conditionally-executed
block. For example, code like this:
  void foo(int a, int (*bar)()) { if (a != 0) bar(); }
becomes:
        ...
        beq 0, .LBB0_2
        std 2, 40(1)
        mr 12, 4
        ld 3, 0(4)
        ld 11, 16(4)
        ld 2, 8(4)
        mtctr 3
        bctrl
        ld 2, 40(1)
.LBB0_2:
        ...
and it would be safe to do all of this unconditionally with a predicated
beqctrl instruction.

llvm-svn: 179156

11 years agoHandle "typeof" in Objective-C format string checking. This previously crashed.
Ted Kremenek [Wed, 10 Apr 2013 06:26:26 +0000 (06:26 +0000)]
Handle "typeof" in Objective-C format string checking.  This previously crashed.

Yes, this came from actual code.

Fixes <rdar://problem/13557053>.

llvm-svn: 179155

11 years agoAdd support for computing the exception specification for an inheriting
Richard Smith [Wed, 10 Apr 2013 06:11:48 +0000 (06:11 +0000)]
Add support for computing the exception specification for an inheriting
constructor. This isn't quite perfect (as usual, we don't handle default
arguments correctly yet, and we don't deal with copy/move constructors for
arguments correctly either, but this will be fixed when we implement core issue
1351.

This completes our support for inheriting constructors.

llvm-svn: 179154

11 years agoDon't crash when mangling types defined in ObjC class extensions.
John McCall [Wed, 10 Apr 2013 06:08:21 +0000 (06:08 +0000)]
Don't crash when mangling types defined in ObjC class extensions.

The original test case here was mangling a type name for TBAA,
but we can provoke this in C++11 easily enough.

rdar://13434937

llvm-svn: 179153

11 years agoWhen ObjectFileMachO::ParseSections() notices that it has a truncated file, zero...
Jason Molenda [Wed, 10 Apr 2013 05:58:57 +0000 (05:58 +0000)]
When ObjectFileMachO::ParseSections() notices that it has a truncated file, zero out the
SectionList so we don't try to do anything with this file.  Currently we end up crashing
later in the debug session when we read past the end of the file -- this at least gets us
closer with something like ProcessMachCore printing "error: core file has no sections".
<rdar://problem/13468295>

llvm-svn: 179152

11 years agoC++11 inheriting constructors: support for inheriting constructor templates.
Richard Smith [Wed, 10 Apr 2013 05:48:59 +0000 (05:48 +0000)]
C++11 inheriting constructors: support for inheriting constructor templates.

llvm-svn: 179151

11 years ago<rdar://problem/13605348> Don't consider invalid user-defined literal operators durin...
Douglas Gregor [Wed, 10 Apr 2013 05:18:00 +0000 (05:18 +0000)]
<rdar://problem/13605348> Don't consider invalid user-defined literal operators during overload resolution.

llvm-svn: 179150

11 years agofix typos
Sebastian Pop [Wed, 10 Apr 2013 04:09:12 +0000 (04:09 +0000)]
fix typos

llvm-svn: 179149

11 years agoscop detection: properly instantiate SCEVs to the place where they are used
Sebastian Pop [Wed, 10 Apr 2013 04:05:18 +0000 (04:05 +0000)]
scop detection: properly instantiate SCEVs to the place where they are used

Fix inspired from c2d4a0627e95c34a819b9d4ffb4db62daa78dade.

    Given the following code

        for (i = 0; i < 10; i++) {
          ;
        }

    S:  A[i] = 0

    When translate the data reference A[i] in statement S using scev, we need to
    retrieve the scev of 'i' at the location of 'S'. If we do not do this the
    scev that we obtain will be expressed as {0,+,1}_for and will reference loop
    iterators that do not surround 'S'. What we really want is the scev to be
    instantiated to the value of 'i' after the loop. This value is {10}.

This used to crash in:

    int loopDimension = getLoopDepth(Expr->getLoop());

    isl_aff *LAff = isl_aff_set_coefficient_si(
        isl_aff_zero_on_domain(LocalSpace), isl_dim_in, loopDimension, 1);

(gdb) p Expr->dump()
{8,+,8}<nw><%do.body>

(gdb) p getLoopDepth(Expr->getLoop())
$5 = 0

    isl_space *Space = isl_space_set_alloc(Ctx, 0, NbLoopSpaces);
    isl_local_space *LocalSpace = isl_local_space_from_space(Space);

As we are trying to create a memory access in a stmt that is outside all loops,
LocalSpace has 0 dimensions:

(gdb) p NbLoopSpaces
$12 = 0

(gdb) p Statement.BB->dump()

if.then:                                          ; preds = %do.end
  %0 = load float* %add.ptr, align 4
  store float %0, float* %q.1.reg2mem, align 4
  br label %if.end.single_exit

and so the scev for %add.ptr should be taken at the place where it is used,
i.e., it should be the value on the last iteration of the do.body loop, and not
"{8,+,8}<nw><%do.body>".

llvm-svn: 179148

11 years agoTemplate the MachO types over endianness.
Rafael Espindola [Wed, 10 Apr 2013 03:48:25 +0000 (03:48 +0000)]
Template the MachO types over endianness.

For now they are still only used as little endian.

llvm-svn: 179147

11 years agoInclude the more specific header.
Rafael Espindola [Wed, 10 Apr 2013 01:58:26 +0000 (01:58 +0000)]
Include the more specific header.

llvm-svn: 179146

11 years ago[frontend] -frewrite-includes: turn implicit module imports into @imports.
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:50 +0000 (01:53 +0000)]
[frontend] -frewrite-includes: turn implicit module imports into @imports.

rdar://13610250

llvm-svn: 179145

11 years ago[frontend] When preprocessing, turn implicit module imports into @imports.
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:46 +0000 (01:53 +0000)]
[frontend] When preprocessing, turn implicit module imports into @imports.

part of rdar://13610250

llvm-svn: 179144

11 years ago[frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that...
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:37 +0000 (01:53 +0000)]
[frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that indicates return from another file.

llvm-svn: 179143

11 years agoRepeat some #line directive tests for the GNU line marker directive.
Michael Ilseman [Wed, 10 Apr 2013 01:41:19 +0000 (01:41 +0000)]
Repeat some #line directive tests for the GNU line marker directive.

llvm-svn: 179142

11 years ago__sincosf_stret returns sinf / cosf in bits 0:31 and 32:63 of xmm0, not in
Evan Cheng [Wed, 10 Apr 2013 01:26:07 +0000 (01:26 +0000)]
__sincosf_stret returns sinf / cosf in bits 0:31 and 32:63 of xmm0, not in
xmm0 / xmm1.

rdar://13599493

llvm-svn: 179141

11 years agoGeneralize the PassConfig API and remove addFinalizeRegAlloc().
Andrew Trick [Wed, 10 Apr 2013 01:06:56 +0000 (01:06 +0000)]
Generalize the PassConfig API and remove addFinalizeRegAlloc().

The target hooks are getting out of hand. What does it mean to run
before or after regalloc anyway? Allowing either Pass* or AnalysisID
pass identification should make it much easier for targets to use the
substitutePass and insertPass APIs, and create less need for badly
named target hooks.

llvm-svn: 179140

11 years agoImprove the diagnostics of the number-reading preprocessor directives.
Michael Ilseman [Wed, 10 Apr 2013 01:04:18 +0000 (01:04 +0000)]
Improve the diagnostics of the number-reading preprocessor directives.

The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases.

Previously:
#line 11foo1   ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "#line directive requires a simple digit sequence"

Now, we get:
#line 11foo1   ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "GNU line marker directive requires a simple digit sequence"

llvm-svn: 179139

11 years agoSuppress -Wunused-variable for variables declared in headers, which may in
Matt Beaumont-Gay [Wed, 10 Apr 2013 00:47:10 +0000 (00:47 +0000)]
Suppress -Wunused-variable for variables declared in headers, which may in
fact be defined and used in another TU.

Reshuffle some test cases because we suppress -Wunused-variable after we've
emitted an error.

This fixes PR15558.

llvm-svn: 179138

11 years agoDon't erroneously put FunctionDecls into CXXRecordDecls
Sean Callanan [Tue, 9 Apr 2013 23:22:08 +0000 (23:22 +0000)]
Don't erroneously put FunctionDecls into CXXRecordDecls
if we didn't want to put in a CXXConstructorDecl.  This
prevents malformed classes (i.e., classes with regular C
functions as members) from being generated from type
information (and fixes a crash in the test suite).

<rdar://problem/13550765>

llvm-svn: 179136

11 years agoMips specific inline asm operand modifier 'D'
Jack Carter [Tue, 9 Apr 2013 23:19:50 +0000 (23:19 +0000)]
Mips specific inline asm operand modifier 'D'

Modifier 'D' is to use the second word of a double integer.

We had previously implemented the pure register varient of
the modifier and this patch implements the memory reference.

#include "stdio.h"

int b[8] = {0,1,2,3,4,5,6,7};
void main()
{
    int i;

    // The first word. Notice, no 'D'
    {asm (
    "lw    %0,%1;"
    : "=r" (i)
    : "m" (*(b+4))
    );}

    printf("%d\n",i);

    // The second word
    {asm (
    "lw    %0,%D1;"
    : "=r" (i)
    : "m" (*(b+4))
    );}

    printf("%d\n",i);
}

llvm-svn: 179135

11 years agoAllow PPC B and BLR to be if-converted into some predicated forms
Hal Finkel [Tue, 9 Apr 2013 22:58:37 +0000 (22:58 +0000)]
Allow PPC B and BLR to be if-converted into some predicated forms

This enables us to form predicated branches (which are the same conditional
branches we had before) and also a larger set of predicated returns (including
instructions like bdnzlr which is a conditional return and loop-counter
decrement all in one).

At the moment, if conversion does not capture all possible opportunities. A
simple example is provided in early-ret2.ll, where if conversion forms one
predicated return, and then the PPCEarlyReturn pass picks up the other one. So,
at least for now, we'll keep both mechanisms.

llvm-svn: 179134

11 years agoFix the help for unwind-on-error, it no longer controls what happens when an expressi...
Jim Ingham [Tue, 9 Apr 2013 22:34:06 +0000 (22:34 +0000)]
Fix the help for unwind-on-error, it no longer controls what happens when an expression hits a breakpoint.

llvm-svn: 179133

11 years agoFix some comment typos.
Bob Wilson [Tue, 9 Apr 2013 22:15:51 +0000 (22:15 +0000)]
Fix some comment typos.

llvm-svn: 179132

11 years agoRemove outdated run lines from tests.
Richard Trieu [Tue, 9 Apr 2013 22:06:27 +0000 (22:06 +0000)]
Remove outdated run lines from tests.

These run lines originally tested that the fix-its were properly applied.
Originally, the fixits were attached to warnings and were applied by -fixit.
Now, the fixits are attached to notes, so nothing happens.  These run lines
still manage to pass since Clang will produce an empty output which gets piped
back to Clang.  Then Clang produces no error on an empty input.

llvm-svn: 179131

11 years agoHardening so we won't crash if an Objective-C interface
Sean Callanan [Tue, 9 Apr 2013 21:30:48 +0000 (21:30 +0000)]
Hardening so we won't crash if an Objective-C interface
doesn't have a corresponding type.

<rdar://problem/13596142>

llvm-svn: 179130

11 years agoCleanup. No functional change intended.
Chad Rosier [Tue, 9 Apr 2013 20:58:48 +0000 (20:58 +0000)]
Cleanup. No functional change intended.

llvm-svn: 179129

11 years agoUpdating cpp11-migrate transform list in ClangTools docs
Edwin Vane [Tue, 9 Apr 2013 20:51:47 +0000 (20:51 +0000)]
Updating cpp11-migrate transform list in ClangTools docs

Author: Philip Dunstan <phil@phildunstan.com>
llvm-svn: 179128

11 years agoAdding the AddOverride transform for cpp11-migrate
Edwin Vane [Tue, 9 Apr 2013 20:49:49 +0000 (20:49 +0000)]
Adding the AddOverride transform for cpp11-migrate

This transform adds the override specifier to methods that overrides virtual
methods from a base class that don't already have this specifier.

Author: Philip Dunstan <phil@phildunstan.com>
llvm-svn: 179127

11 years agoAdding new AST Matchers isVirtual and isOverride
Edwin Vane [Tue, 9 Apr 2013 20:46:36 +0000 (20:46 +0000)]
Adding new AST Matchers isVirtual and isOverride

isVirtual - matches CXXMethodDecl nodes for virtual methods
isOverride - matches CXXMethodDecl nodes for methods that override virtual methods from a base class.

Author: Philip Dunstan <phil@philipdunstan.com>
llvm-svn: 179126

11 years agoCleanup. No functional change intended.
Chad Rosier [Tue, 9 Apr 2013 20:44:09 +0000 (20:44 +0000)]
Cleanup. No functional change intended.

llvm-svn: 179125

11 years agoRemove unused method and default values.
Rafael Espindola [Tue, 9 Apr 2013 20:35:08 +0000 (20:35 +0000)]
Remove unused method and default values.

llvm-svn: 179124

11 years ago[c-index-test] Enable 'display diagnostics' when using the -test-load functionality.
Argyrios Kyrtzidis [Tue, 9 Apr 2013 20:29:24 +0000 (20:29 +0000)]
[c-index-test] Enable 'display diagnostics' when using the -test-load functionality.

llvm-svn: 179123

11 years agoUpdate the version of dwarf we say we're emitting to at least 3.
Eric Christopher [Tue, 9 Apr 2013 20:22:47 +0000 (20:22 +0000)]
Update the version of dwarf we say we're emitting to at least 3.

Deals with a dwarf2 -> dwarf3 DW_FORM_ref_addr change.

llvm-svn: 179122

11 years ago[libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.
Argyrios Kyrtzidis [Tue, 9 Apr 2013 20:03:03 +0000 (20:03 +0000)]
[libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.

llvm-svn: 179121

11 years agoRevert r179115 as it looks to have killed the ASan tests.
Chad Rosier [Tue, 9 Apr 2013 19:59:12 +0000 (19:59 +0000)]
Revert r179115 as it looks to have killed the ASan tests.

llvm-svn: 179120

11 years agoRationalize the formatting of these case labels. Having two sorted
Chandler Carruth [Tue, 9 Apr 2013 19:46:46 +0000 (19:46 +0000)]
Rationalize the formatting of these case labels. Having two sorted
columns is essentially impossible to edit.

llvm-svn: 179119

11 years agoThis patch enables llvm to switch between compiling for mips32/mips64
Reed Kotler [Tue, 9 Apr 2013 19:46:01 +0000 (19:46 +0000)]
This patch enables llvm to switch between compiling for mips32/mips64
and mips16 on a per function basis.

Because this patch is somewhat involved I have provide an overview of the
key pieces of it.

The patch is written so as to not change the behavior of the non mixed
mode. We have tested this a lot but it is something new to switch subtargets
so we don't want any chance of regression in the mainline compiler until
we have more confidence in this.

Mips32/64 are very different from Mip16 as is the case of ARM vs Thumb1.
For that reason there are derived versions of the register info, frame info,
instruction info and instruction selection classes.

Now we register three separate passes for instruction selection.
One which is used to switch subtargets (MipsModuleISelDAGToDAG.cpp) and then
one for each of the current subtargets (Mips16ISelDAGToDAG.cpp and
MipsSEISelDAGToDAG.cpp).

When the ModuleISel pass runs, it determines if there is a need to switch
subtargets and if so, the owning pointers in MipsTargetMachine are
appropriately changed.

When 16Isel or SEIsel is run, they will return immediately without doing
any work if the current subtarget mode does not apply to them.

In addition, MipsAsmPrinter needs to be reset on a function basis.

The pass BasicTargetTransformInfo is substituted with a null pass since the
pass is immutable and really needs to be a function pass for it to be
used with changing subtargets. This will be fixed in a follow on patch.

llvm-svn: 179118

11 years agoAdd support for bottom-up SLP vectorization infrastructure.
Nadav Rotem [Tue, 9 Apr 2013 19:44:35 +0000 (19:44 +0000)]
Add support for bottom-up SLP vectorization infrastructure.

This commit adds the infrastructure for performing bottom-up SLP vectorization (and other optimizations) on parallel computations.
The infrastructure has three potential users:

  1. The loop vectorizer needs to be able to vectorize AOS data structures such as (sum += A[i] + A[i+1]).

  2. The BB-vectorizer needs this infrastructure for bottom-up SLP vectorization, because bottom-up vectorization is faster to compute.

  3. A loop-roller needs to be able to analyze consecutive chains and roll them into a loop, in order to reduce code size. A loop roller does not need to create vector instructions, and this infrastructure separates the chain analysis from the vectorization.

This patch also includes a simple (100 LOC) bottom up SLP vectorizer that uses the infrastructure, and can vectorize this code:

void SAXPY(int *x, int *y, int a, int i) {
  x[i]   = a * x[i]   + y[i];
  x[i+1] = a * x[i+1] + y[i+1];
  x[i+2] = a * x[i+2] + y[i+2];
  x[i+3] = a * x[i+3] + y[i+3];
}

llvm-svn: 179117

11 years agoMake check depend on all.
Eric Christopher [Tue, 9 Apr 2013 19:42:12 +0000 (19:42 +0000)]
Make check depend on all.

llvm-svn: 179116

11 years ago[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
Chad Rosier [Tue, 9 Apr 2013 19:34:59 +0000 (19:34 +0000)]
[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
parse an identifier.  Otherwise, parseExpression may parse multiple tokens,
which makes it impossible to properly compute an immediate displacement.
An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in
the below example:

 __asm mov eax, [Symbol + ImmDisp]

The existing test cases exercise this patch.
rdar://13611297

llvm-svn: 179115

11 years agoThe .dwo section shouldn't contain the unrelocated values (and
Eric Christopher [Tue, 9 Apr 2013 19:23:15 +0000 (19:23 +0000)]
The .dwo section shouldn't contain the unrelocated values (and
therefore not at all) of the pc or statement list. We also don't
need to emit the compilation dir so save so space and time
and don't bother.

Fix up the testcase accordingly and verify that we don't emit
the attributes or the items that they use.

llvm-svn: 179114

11 years agoCleanup PPCEarlyReturn
Hal Finkel [Tue, 9 Apr 2013 18:25:18 +0000 (18:25 +0000)]
Cleanup PPCEarlyReturn

Some general cleanup and only scan the end of a BB for branches (once we're
done with the terminators and debug values, then there should not be any other
branches). These address post-commit review suggestions by Bill Schmidt.

No functionality change intended.

llvm-svn: 179112

11 years agoRevert r176408 and r176407 to address PR15540.
Nadav Rotem [Tue, 9 Apr 2013 18:16:05 +0000 (18:16 +0000)]
Revert r176408 and r176407 to address PR15540.

llvm-svn: 179111

11 years agoFix the help message for “one-shot”.
Jim Ingham [Tue, 9 Apr 2013 18:05:22 +0000 (18:05 +0000)]
Fix the help message for “one-shot”.

llvm-svn: 179110

11 years ago[ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,
Chad Rosier [Tue, 9 Apr 2013 17:53:49 +0000 (17:53 +0000)]
[ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,
rather than deriving the StringRef from the Start and End SMLocs.

Using the Start and End SMLocs works fine for operands such as [Symbol], but
not for operands such as [Symbol + ImmDisp].  All existing test cases that
reference a variable exercise this patch.
rdar://13602265

llvm-svn: 179109

11 years agoObjective-C: This patch fixes a none-issuance of warning
Fariborz Jahanian [Tue, 9 Apr 2013 17:52:29 +0000 (17:52 +0000)]
Objective-C: This patch fixes a none-issuance of warning
when result type of protocol property and getter method
differ by fixing a more serious problem. When a forward
protocol declaration comes between its definition and
its use in class protocol list, the forward protocol
ast was being used in building the protocol list.
// rdar://12522752

llvm-svn: 179108

11 years agoFix comments before labels.
Daniel Jasper [Tue, 9 Apr 2013 17:46:55 +0000 (17:46 +0000)]
Fix comments before labels.

Before:
switch (...) {
  // a
  // b
// c
case first:
  break;
}

After:
switch (...) {
// a
// b
// c
case first:
  break;
}

llvm-svn: 179107

11 years agoDAGCombiner: Fold a shuffle on CONCAT_VECTORS into a new CONCAT_VECTORS if possible.
Benjamin Kramer [Tue, 9 Apr 2013 17:41:43 +0000 (17:41 +0000)]
DAGCombiner: Fold a shuffle on CONCAT_VECTORS into a new CONCAT_VECTORS if possible.

This pattern occurs in SROA output due to the way vector arguments are lowered
on ARM.

The testcase from PR15525 now compiles into this, which is better than the code
we got with the old scalarrepl:
_Store:
ldr.w r9, [sp]
vmov d17, r3, r9
vmov d16, r1, r2
vst1.8 {d16, d17}, [r0]
bx lr

Differential Revision: http://llvm-reviews.chandlerc.com/D647

llvm-svn: 179106

11 years agoUse virtual base registers on PPC
Hal Finkel [Tue, 9 Apr 2013 17:27:09 +0000 (17:27 +0000)]
Use virtual base registers on PPC

On PowerPC, non-vector loads and stores have r+i forms; however, in functions
with large stack frames these were not being used to access slots far from the
stack pointer because such slots were out of range for the signed 16-bit
immediate offset field. This increases register pressure because we need a
separate register for each offset (when the r+r form is used). By enabling
virtual base registers, we can deal with large stack frames without unduly
increasing register pressure.

llvm-svn: 179105

11 years agoConvert test PowerPC/2007-09-07-LoadStoreIdxForms to FileCheck
Hal Finkel [Tue, 9 Apr 2013 17:26:55 +0000 (17:26 +0000)]
Convert test PowerPC/2007-09-07-LoadStoreIdxForms to FileCheck

llvm-svn: 179104

11 years agoFix UseNullptr fails to replace c-style explicit cast in a return statement
Ariel J. Bernal [Tue, 9 Apr 2013 16:54:56 +0000 (16:54 +0000)]
Fix UseNullptr fails to replace c-style explicit cast in a return statement

This happens whenever there is a c-style explicit cast to nullptr not
surrounded by parentheses following a return statement.

- Added a white space before nullptr if the character before is alphanumeric
  when replacing the null pointer expression.
- Simplified visitor
- Addes tests

llvm-svn: 179103

11 years agoRewrite test/Linker tests to use FileCheck instead of grep.
Eli Bendersky [Tue, 9 Apr 2013 16:51:13 +0000 (16:51 +0000)]
Rewrite test/Linker tests to use FileCheck instead of grep.

Some translations here are not 1x1 because there are grep|grep
chains that are non-trivial to implement in terms of FileCheck features. I
made an effort for the tests to remain as similar as possible; do let me know
if you notice anything fishy. The good news are that some buggy tests were
fixed (grep | not grep - a bug waiting to happen).

llvm-svn: 179102

11 years agoAgain macros without trailing semicolons: don't care about declaration context.
Alexander Kornienko [Tue, 9 Apr 2013 16:15:19 +0000 (16:15 +0000)]
Again macros without trailing semicolons: don't care about declaration context.

Summary:
Some codebases use these kinds of macros in functions, e.g. Chromium's
IPC_BEGIN_MESSAGE_MAP, IPC_BEGIN_MESSAGE_HANDLER, etc.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D645

llvm-svn: 179099

11 years agoImprovements to clang-format integrations.
Daniel Jasper [Tue, 9 Apr 2013 15:23:04 +0000 (15:23 +0000)]
Improvements to clang-format integrations.

This adds an emacs editor integration (thanks to Ami Fischman). Also
pulls out the style into a variable for the vi integration and just
uses clang-formats defaults style in clang-format-diff.py.

llvm-svn: 179098

11 years agoConvert MachOObjectFile to a template.
Rafael Espindola [Tue, 9 Apr 2013 14:49:08 +0000 (14:49 +0000)]
Convert MachOObjectFile to a template.

For now it is templated only on being 64 or 32 bits. I will add little/big
endian next.

llvm-svn: 179097

11 years ago[sanitizer] Interceptors for wait*.
Evgeniy Stepanov [Tue, 9 Apr 2013 14:34:59 +0000 (14:34 +0000)]
[sanitizer] Interceptors for wait*.

llvm-svn: 179096

11 years agoDWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the same...
Alexey Samsonov [Tue, 9 Apr 2013 14:09:42 +0000 (14:09 +0000)]
DWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the same as DW_FORM_addr in DWARF2, and is 4/8 bytes on 32/64-bit DWARF starting from DWARF3. Adding a test for this is a huge pain - generating and uploading pre-built binary with DWARF3 debug info is way too ugly, and writing fine-grained unittests for DebugInfo is impossible, as it doesn't expose any headers in include/llvm. That said, I'm going to choose the second approach and submit the patch exposing DebugInfo headers for review soon enough.

llvm-svn: 179095

11 years agoMention the changes in the handling of language linkage in the release notes.
Rafael Espindola [Tue, 9 Apr 2013 12:51:24 +0000 (12:51 +0000)]
Mention the changes in the handling of language linkage in the release notes.

llvm-svn: 179094

11 years ago[ms-cxxabi] Add "$$C" when mangling template arg QualTypes
Reid Kleckner [Tue, 9 Apr 2013 12:47:38 +0000 (12:47 +0000)]
[ms-cxxabi] Add "$$C" when mangling template arg QualTypes

Credit goes to Timur Iskhodzhanov for finding the problem and solution.

llvm-svn: 179093

11 years agoOne more follow-up to r179082 - parse PIC/PIE arguments even on platfroms that force...
Alexey Samsonov [Tue, 9 Apr 2013 12:28:19 +0000 (12:28 +0000)]
One more follow-up to r179082 - parse PIC/PIE arguments even on platfroms that force default PIC (like Darwin x86-64), otherwise specifying -fPIC will produce bogus unused argument warning

llvm-svn: 179092

11 years ago[msan] Intercept glob() with tests.
Evgeniy Stepanov [Tue, 9 Apr 2013 11:35:13 +0000 (11:35 +0000)]
[msan] Intercept glob() with tests.

llvm-svn: 179091

11 years ago[Sanitizer] fix TSan tests: remove global ctor from sanitizer_common, run load_shared...
Alexey Samsonov [Tue, 9 Apr 2013 07:46:20 +0000 (07:46 +0000)]
[Sanitizer] fix TSan tests: remove global ctor from sanitizer_common, run load_shared_lib test only in lit

llvm-svn: 179090

11 years agoFollow-up for r179082: more careful handling of -f(no-)sanitize-address-zero-base...
Alexey Samsonov [Tue, 9 Apr 2013 07:27:44 +0000 (07:27 +0000)]
Follow-up for r179082: more careful handling of -f(no-)sanitize-address-zero-base-shadow on Android

llvm-svn: 179089

11 years ago[asan] relax Linux/zero-base-shadow.cc to make it pass on newer Ubuntu; fix lint
Kostya Serebryany [Tue, 9 Apr 2013 07:08:05 +0000 (07:08 +0000)]
[asan] relax Linux/zero-base-shadow.cc to make it pass on newer Ubuntu; fix lint

llvm-svn: 179088

11 years agoConverted 8x tests of SimplifyCFG to use FileCheck instead of grep.
Michael Gottesman [Tue, 9 Apr 2013 05:18:53 +0000 (05:18 +0000)]
Converted 8x tests of SimplifyCFG to use FileCheck instead of grep.

llvm-svn: 179087

11 years agoExtract a function.
Jakob Stoklund Olesen [Tue, 9 Apr 2013 05:11:52 +0000 (05:11 +0000)]
Extract a function.

llvm-svn: 179086