platform/upstream/llvm.git
11 years agocomment parsing. Add couple more needed doxygen tags.
Fariborz Jahanian [Wed, 10 Apr 2013 23:10:42 +0000 (23:10 +0000)]
comment parsing. Add couple more needed doxygen tags.
// rdar://12379053

llvm-svn: 179238

11 years agoget rid of stdio.h include in testcase
Adrian Prantl [Wed, 10 Apr 2013 23:09:00 +0000 (23:09 +0000)]
get rid of stdio.h include in testcase

llvm-svn: 179237

11 years agoadd mips target requirement to testcase
Adrian Prantl [Wed, 10 Apr 2013 23:08:57 +0000 (23:08 +0000)]
add mips target requirement to testcase

llvm-svn: 179236

11 years ago[analyzer] Address Jordan’s review of r179219
Anna Zaks [Wed, 10 Apr 2013 22:56:33 +0000 (22:56 +0000)]
[analyzer] Address Jordan’s review of r179219

llvm-svn: 179235

11 years ago[analyzer] Address Jordan’s code review of r 179221
Anna Zaks [Wed, 10 Apr 2013 22:56:30 +0000 (22:56 +0000)]
[analyzer] Address Jordan’s code review of r 179221

llvm-svn: 179234

11 years agoScheduleOpt: Do not crash on statements with empty iteration domains
Tobias Grosser [Wed, 10 Apr 2013 22:48:08 +0000 (22:48 +0000)]
ScheduleOpt: Do not crash on statements with empty iteration domains

Statements with an empty iteration domain may not have a schedule assigned by
the isl schedule optimizer. As Polly expects each statement to have a schedule,
we keep the old schedule for such statements.

This fixes http://llvm.org/PR15645`

Reported-by: Johannes Doerfert <johannesdoerfert@gmx.de>
llvm-svn: 179233

11 years ago[analyzer] +Testcase: several used-after-free args passed to a function.
Anton Yartsev [Wed, 10 Apr 2013 22:36:16 +0000 (22:36 +0000)]
[analyzer] +Testcase: several used-after-free args passed to a function.

llvm-svn: 179232

11 years ago[analyzer] Switched to checkPreCall interface for detecting usage after free.
Anton Yartsev [Wed, 10 Apr 2013 22:21:41 +0000 (22:21 +0000)]
[analyzer] Switched to checkPreCall interface for detecting usage after free.

Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer.

llvm-svn: 179230

11 years agoMips specific inline asm memory operand modifier test case
Jack Carter [Wed, 10 Apr 2013 22:10:45 +0000 (22:10 +0000)]
Mips specific inline asm memory operand modifier test case

These changes are based on commit responses for r179135.

llvm-svn: 179229

11 years ago[analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.
Anna Zaks [Wed, 10 Apr 2013 22:06:29 +0000 (22:06 +0000)]
[analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.

Fixes PR13476

llvm-svn: 179228

11 years agoManually remove successors in if conversion when CopyAndPredicateBlock is used
Hal Finkel [Wed, 10 Apr 2013 22:05:25 +0000 (22:05 +0000)]
Manually remove successors in if conversion when CopyAndPredicateBlock is used

In the simple and triangle if-conversion cases, when CopyAndPredicateBlock is
used because the to-be-predicated block has other predecessors, we need to
explicitly remove the old copied block from the successors list. Normally if
conversion relies on TII->AnalyzeBranch combined with BB->CorrectExtraCFGEdges
to cleanup the successors list, but if the predicated block contained an
un-analyzable branch (such as a now-predicated return), then this will fail.

These extra successors were causing a problem on PPC because it was causing
later passes (such as PPCEarlyReturm) to leave dead return-only basic blocks in
the code.

llvm-svn: 179227

11 years agoNo need to have this return a bool.
Bill Wendling [Wed, 10 Apr 2013 22:03:59 +0000 (22:03 +0000)]
No need to have this return a bool.

llvm-svn: 179226

11 years agoMips specific inline asm memory operand modifier test case
Jack Carter [Wed, 10 Apr 2013 22:02:32 +0000 (22:02 +0000)]
Mips specific inline asm memory operand modifier test case

These changes are based on commit responses for r179135.

llvm-svn: 179225

11 years agoMove info to CREDITS.TXT file.
Bill Wendling [Wed, 10 Apr 2013 21:56:52 +0000 (21:56 +0000)]
Move info to CREDITS.TXT file.

llvm-svn: 179224

11 years agofixed xsave, xsaveopt, xrstor mnemonics with intel syntax; added test cases
Kay Tiong Khoo [Wed, 10 Apr 2013 21:52:25 +0000 (21:52 +0000)]
fixed xsave, xsaveopt, xrstor mnemonics with intel syntax; added test cases

llvm-svn: 179223

11 years agoRevert "Update the version of dwarf we say we're emitting to at least 3."
Eric Christopher [Wed, 10 Apr 2013 21:45:07 +0000 (21:45 +0000)]
Revert "Update the version of dwarf we say we're emitting to at least 3."
temporarily while we work on plumbing through some changes to continue
supporting gdb on darwin.

This reverts commit r179122.

llvm-svn: 179222

11 years ago[analyzer] When reporting a leak in RetainCount checker due to an early exit from...
Anna Zaks [Wed, 10 Apr 2013 21:42:06 +0000 (21:42 +0000)]
[analyzer] When reporting a leak in RetainCount checker due to an early exit from init, step into init.

The heuristic here (proposed by Jordan) is that, usually, if a leak is due to an early exit from init, the allocation site will be
a call to alloc. Note that in other cases init resets self to [super init], which becomes the allocation site of the object.

llvm-svn: 179221

11 years agoTrack the compact unwind encoding for when we are unable to generate compact unwind...
Bill Wendling [Wed, 10 Apr 2013 21:42:06 +0000 (21:42 +0000)]
Track the compact unwind encoding for when we are unable to generate compact unwind information.

Compact unwind has an encoding for when we're not able to generate compact
unwind and must generate an EH frame instead. Track that, but still emit that CU
encoding.

llvm-svn: 179220

11 years ago[analyzer] Cleanup leak warnings: do not print the names of variables from other...
Anna Zaks [Wed, 10 Apr 2013 21:42:02 +0000 (21:42 +0000)]
[analyzer] Cleanup leak warnings: do not print the names of variables from other functions.

llvm-svn: 179219

11 years agoFor split dwarf we should also run the objcopy action if we're
Eric Christopher [Wed, 10 Apr 2013 21:30:40 +0000 (21:30 +0000)]
For split dwarf we should also run the objcopy action if we're
just assembling a file and have passed the option.

llvm-svn: 179218

11 years agoRemove unused arguments.
Chad Rosier [Wed, 10 Apr 2013 21:30:03 +0000 (21:30 +0000)]
Remove unused arguments.

llvm-svn: 179217

11 years ago[driver] Add a -Ofast option, which enables -O3, -ffast-math, and
Chad Rosier [Wed, 10 Apr 2013 21:26:02 +0000 (21:26 +0000)]
[driver] Add a -Ofast option, which enables -O3, -ffast-math, and
-fstrict-aliasing.
rdar://13622687

llvm-svn: 179216

11 years agofixed to disassemble with tab after mnemonic rather than space
Kay Tiong Khoo [Wed, 10 Apr 2013 21:17:58 +0000 (21:17 +0000)]
fixed to disassemble with tab after mnemonic rather than space

llvm-svn: 179215

11 years agoFileCheck-ify some clang grep tests that use double quotes
Reid Kleckner [Wed, 10 Apr 2013 21:10:39 +0000 (21:10 +0000)]
FileCheck-ify some clang grep tests that use double quotes

The escaping interaction between Python and grep doesn't work on my
system.  This change fixes the tests for me.

llvm-svn: 179214

11 years agoUse a real union for IdentifyingPassPtr.
Benjamin Kramer [Wed, 10 Apr 2013 20:50:44 +0000 (20:50 +0000)]
Use a real union for IdentifyingPassPtr.

This avoids a nasty const correctness issue (AnalysisIDs are const, Pass* isn't).

llvm-svn: 179213

11 years agoMarking myself as release manager.
Bill Wendling [Wed, 10 Apr 2013 20:13:28 +0000 (20:13 +0000)]
Marking myself as release manager.

If anyone objects please let me know.

llvm-svn: 179212

11 years agoIn the X86 back end, getMemoryOperandNo() returns the offset
Preston Gurd [Wed, 10 Apr 2013 20:11:59 +0000 (20:11 +0000)]
In the X86 back end, getMemoryOperandNo() returns the offset
into the operand array of the start of the memory reference descriptor.

Additional code in EncodeInstruction provides an additional adjustment.

This patch places that additional code in a separate function,
called getOperandBias, so that any caller of getMemoryOperandNo
can also call getOperandBias.

llvm-svn: 179211

11 years agoTidy up, fix and simplify a few of the SMLocs. Prior to r179109 the Start SMLoc
Chad Rosier [Wed, 10 Apr 2013 20:07:47 +0000 (20:07 +0000)]
Tidy up, fix and simplify a few of the SMLocs.  Prior to r179109 the Start SMLoc
wasn't always the start of the operand.  If there was a symbol reference, then
Start pointed to that token.  It's very likely there are other places that need
to be updated.

llvm-svn: 179210

11 years agoAdd object-emission flag for lit tests. This flag is used
Jyotsna Verma [Wed, 10 Apr 2013 19:53:26 +0000 (19:53 +0000)]
Add object-emission flag for lit tests. This flag is used
to disable following tests for Hexagon that require direct object
generation support.

DebugInfo/dwarf-public-names.ll
DebugInfo/dwarf-version.ll
DebugInfo/member-pointers.ll
DebugInfo/namespace.ll
DebugInfo/two-cus-from-same-file.ll

Fixes bug 15616 - http://llvm.org/bugs/show_bug.cgi?id=15616

llvm-svn: 179209

11 years agoAdd capability to demangle invocation functions for ObjC blocks.
Howard Hinnant [Wed, 10 Apr 2013 19:44:03 +0000 (19:44 +0000)]
Add capability to demangle invocation functions for ObjC blocks.

llvm-svn: 179208

11 years agoMake the SLP store-merger less paranoid about function calls. We check for function...
Nadav Rotem [Wed, 10 Apr 2013 19:41:36 +0000 (19:41 +0000)]
Make the SLP store-merger less paranoid about function calls. We check for function calls when we check if it is safe to sink instructions.

llvm-svn: 179207

11 years agoWe require DataLayout for analyzing the size of stores.
Nadav Rotem [Wed, 10 Apr 2013 18:57:27 +0000 (18:57 +0000)]
We require DataLayout for analyzing the size of stores.

llvm-svn: 179206

11 years agoRemove unused variable.
Chad Rosier [Wed, 10 Apr 2013 18:46:58 +0000 (18:46 +0000)]
Remove unused variable.

llvm-svn: 179205

11 years ago-fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian
Dmitri Gribenko [Wed, 10 Apr 2013 18:43:09 +0000 (18:43 +0000)]
-fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian

llvm-svn: 179204

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