Commit Graph

147291 Commits

Author SHA1 Message Date
Tim Northover 9674ad8cb6 TMP
llvm-svn: 179170
2013-04-10 12:08:25 +00:00
Joey Gouly 81259294be 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
2013-04-10 10:37:38 +00:00
Manuel Klimek a3ff45ebed 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
2013-04-10 09:52:05 +00:00
Daniel Jasper c04baae34a 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
2013-04-10 09:49:49 +00:00
Christian Konig 8b1ed28ef1 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
2013-04-10 08:39:16 +00:00
Christian Konig 8e06e2a8c4 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
2013-04-10 08:39:08 +00:00
Christian Konig 4ace663255 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
2013-04-10 08:39:01 +00:00
Tobias Grosser ecb5092707 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
2013-04-10 07:42:28 +00:00
Hal Finkel af822018aa Cleanup PPCInstrInfo::DefinesPredicate
Implement suggestions made by Bill Schmidt in post-commit review. Thanks!

llvm-svn: 179162
2013-04-10 07:17:47 +00:00
Alexey Samsonov c0443c5d25 [ASan] fix a typo in legend in error report
llvm-svn: 179161
2013-04-10 07:00:25 +00:00
Tobias Grosser d7e58640a5 Update formatting to latest version of clang-format
llvm-svn: 179160
2013-04-10 06:55:45 +00:00
Tobias Grosser 0ee50f6ee4 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
2013-04-10 06:55:31 +00:00
Tobias Grosser 03fc9acbe5 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
2013-04-10 06:55:20 +00:00
Tobias Grosser 141cc3e85f RegionInfo: Add helpers to replace entry/exit recursively
Contributed by: Star Tan <tanmx_star@yeah.net>

llvm-svn: 179157
2013-04-10 06:54:49 +00:00
Hal Finkel 500b004566 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
2013-04-10 06:42:34 +00:00
Ted Kremenek 3365e52fa5 Handle "typeof" in Objective-C format string checking. This previously crashed.
Yes, this came from actual code.

Fixes <rdar://problem/13557053>.

llvm-svn: 179155
2013-04-10 06:26:26 +00:00
Richard Smith b7151b910c 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
2013-04-10 06:11:48 +00:00
John McCall 924046f1ec 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
2013-04-10 06:08:21 +00:00
Jason Molenda f6ce26fb02 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
2013-04-10 05:58:57 +00:00
Richard Smith 185be185b2 C++11 inheriting constructors: support for inheriting constructor templates.
llvm-svn: 179151
2013-04-10 05:48:59 +00:00
Douglas Gregor c197057b42 <rdar://problem/13605348> Don't consider invalid user-defined literal operators during overload resolution.
llvm-svn: 179150
2013-04-10 05:18:00 +00:00
Sebastian Pop e7a7beec7d fix typos
llvm-svn: 179149
2013-04-10 04:09:12 +00:00
Sebastian Pop 9f57c5b695 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
2013-04-10 04:05:18 +00:00
Rafael Espindola eaae687d3e Template the MachO types over endianness.
For now they are still only used as little endian.

llvm-svn: 179147
2013-04-10 03:48:25 +00:00
Rafael Espindola e9c2407c98 Include the more specific header.
llvm-svn: 179146
2013-04-10 01:58:26 +00:00
Argyrios Kyrtzidis cf22d1f3ab [frontend] -frewrite-includes: turn implicit module imports into @imports.
rdar://13610250

llvm-svn: 179145
2013-04-10 01:53:50 +00:00
Argyrios Kyrtzidis a6444b1ce1 [frontend] When preprocessing, turn implicit module imports into @imports.
part of rdar://13610250

llvm-svn: 179144
2013-04-10 01:53:46 +00:00
Argyrios Kyrtzidis 953ef33f59 [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that indicates return from another file.
llvm-svn: 179143
2013-04-10 01:53:37 +00:00
Michael Ilseman 82a2a3d8f5 Repeat some #line directive tests for the GNU line marker directive.
llvm-svn: 179142
2013-04-10 01:41:19 +00:00
Evan Cheng ac0469c5d0 __sincosf_stret returns sinf / cosf in bits 0:31 and 32:63 of xmm0, not in
xmm0 / xmm1.

rdar://13599493

llvm-svn: 179141
2013-04-10 01:26:07 +00:00
Andrew Trick e220323c7f 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
2013-04-10 01:06:56 +00:00
Michael Ilseman e910cc8e07 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
2013-04-10 01:04:18 +00:00
Matt Beaumont-Gay e1368a107a 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
2013-04-10 00:47:10 +00:00
Sean Callanan b0640dc2b6 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
2013-04-09 23:22:08 +00:00
Jack Carter b04e357d9b 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
2013-04-09 23:19:50 +00:00
Hal Finkel 5711eca19c 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
2013-04-09 22:58:37 +00:00
Jim Ingham aa577f464d Fix the help for unwind-on-error, it no longer controls what happens when an expression hits a breakpoint.
llvm-svn: 179133
2013-04-09 22:34:06 +00:00
Bob Wilson 798a7709fc Fix some comment typos.
llvm-svn: 179132
2013-04-09 22:15:51 +00:00
Richard Trieu c47f2d3ea3 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
2013-04-09 22:06:27 +00:00
Sean Callanan dfb87d616b Hardening so we won't crash if an Objective-C interface
doesn't have a corresponding type.

<rdar://problem/13596142>

llvm-svn: 179130
2013-04-09 21:30:48 +00:00
Chad Rosier 18785857d4 Cleanup. No functional change intended.
llvm-svn: 179129
2013-04-09 20:58:48 +00:00
Edwin Vane 9fbb842c6d Updating cpp11-migrate transform list in ClangTools docs
Author: Philip Dunstan <phil@phildunstan.com>
llvm-svn: 179128
2013-04-09 20:51:47 +00:00
Edwin Vane 8ef7fa1e07 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
2013-04-09 20:49:49 +00:00
Edwin Vane 37ee1d7b80 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
2013-04-09 20:46:36 +00:00
Chad Rosier 10d1d1ccb8 Cleanup. No functional change intended.
llvm-svn: 179125
2013-04-09 20:44:09 +00:00
Rafael Espindola 1b276c5cec Remove unused method and default values.
llvm-svn: 179124
2013-04-09 20:35:08 +00:00
Argyrios Kyrtzidis bcc8a5a70a [c-index-test] Enable 'display diagnostics' when using the -test-load functionality.
llvm-svn: 179123
2013-04-09 20:29:24 +00:00
Eric Christopher 06c89d65d1 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
2013-04-09 20:22:47 +00:00
Argyrios Kyrtzidis 2bee666540 [libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.
llvm-svn: 179121
2013-04-09 20:03:03 +00:00
Chad Rosier e8d8288d7e Revert r179115 as it looks to have killed the ASan tests.
llvm-svn: 179120
2013-04-09 19:59:12 +00:00