platform/upstream/llvm.git
12 years agoMake Mr. Pedantic happy by fixing banner to be exactly 80 columns
Marshall Clow [Tue, 21 Aug 2012 16:29:41 +0000 (16:29 +0000)]
Make Mr. Pedantic happy by fixing banner to be exactly 80 columns

llvm-svn: 162287

12 years agoPacify PVS-Studio by changing the type rather than doing a cast, a tweak
Duncan Sands [Tue, 21 Aug 2012 16:20:37 +0000 (16:20 +0000)]
Pacify PVS-Studio by changing the type rather than doing a cast, a tweak
suggested by David Blaikie.

llvm-svn: 162286

12 years ago[driver] Add support for the --param ssp-buffer-size= driver option.
Chad Rosier [Tue, 21 Aug 2012 16:16:06 +0000 (16:16 +0000)]
[driver] Add support for the --param ssp-buffer-size= driver option.
PR9673

llvm-svn: 162285

12 years agoAdd support for the --param ssp-buffer-size= driver option.
Chad Rosier [Tue, 21 Aug 2012 16:15:24 +0000 (16:15 +0000)]
Add support for the --param ssp-buffer-size= driver option.
PR9673

llvm-svn: 162284

12 years agoUse typedefs. Fix indentation. Extracted from the Andy/PaX patch.
Rafael Espindola [Tue, 21 Aug 2012 16:06:48 +0000 (16:06 +0000)]
Use typedefs. Fix indentation. Extracted from the Andy/PaX patch.

llvm-svn: 162283

12 years agoRemove unused variable. Extracted from the Andy/PaX patch.
Rafael Espindola [Tue, 21 Aug 2012 16:01:14 +0000 (16:01 +0000)]
Remove unused variable. Extracted from the Andy/PaX patch.

llvm-svn: 162282

12 years agoFix typo. Extracted from the Andy/PaX patch.
Rafael Espindola [Tue, 21 Aug 2012 15:55:04 +0000 (15:55 +0000)]
Fix typo. Extracted from the Andy/PaX patch.

llvm-svn: 162281

12 years agoMCJIT: Tidy up the constructor.
Jim Grosbach [Tue, 21 Aug 2012 15:42:49 +0000 (15:42 +0000)]
MCJIT: Tidy up the constructor.

The MCJIT doesn't need or want a TargetJITInfo. That's vestigal from the old
JIT, so just remove it.

rdar://12119347

llvm-svn: 162280

12 years ago[asan] fix mac build
Kostya Serebryany [Tue, 21 Aug 2012 14:43:36 +0000 (14:43 +0000)]
[asan] fix mac build

llvm-svn: 162279

12 years ago[asan] run-time part of the initialization order checker. Patch by Reid Watson with...
Kostya Serebryany [Tue, 21 Aug 2012 14:10:25 +0000 (14:10 +0000)]
[asan] run-time part of the initialization order checker. Patch by Reid Watson with some bits from kcc. The sub-pass is off by default for now. On simple tests it works fine.

llvm-svn: 162278

12 years agoPVS-Studio noticed that EmitVBR64 would perform undefined behaviour if the
Duncan Sands [Tue, 21 Aug 2012 13:47:25 +0000 (13:47 +0000)]
PVS-Studio noticed that EmitVBR64 would perform undefined behaviour if the
number of bits was bigger than 32.  I checked every use of this function
that I could find and it looks like the maximum number of bits is 32, so I've
added an assertion checking this property, and a type cast to (hopefully) stop
PVS-Studio from warning about this in the future.

llvm-svn: 162277

12 years agoAdd correct set of regression tests for r162094 commit.
Tim Northover [Tue, 21 Aug 2012 12:43:03 +0000 (12:43 +0000)]
Add correct set of regression tests for r162094 commit.

llvm-svn: 162276

12 years agoautoconf: Only define GPGPU_CODEGEN, if that feature is requested
Tobias Grosser [Tue, 21 Aug 2012 12:29:10 +0000 (12:29 +0000)]
autoconf: Only define GPGPU_CODEGEN, if that feature is requested

Before we defined GPGPU_CODEGEN to '0', which does not disable the relevant code
as we just check if that value is defined at all. We now follow the cmake
approach and only define GPGPU_CODEGEN, if the feature should be enabled.

Reported by: Sebastian Pop <spop@codeaurora.org>

llvm-svn: 162275

12 years agoAdd rsqrt builtin. Based on patch by Cassie Epps!
Peter Collingbourne [Tue, 21 Aug 2012 10:48:35 +0000 (10:48 +0000)]
Add rsqrt builtin.  Based on patch by Cassie Epps!

llvm-svn: 162274

12 years agoAdd floor builtin. Patch by Cassie Epps!
Peter Collingbourne [Tue, 21 Aug 2012 10:48:21 +0000 (10:48 +0000)]
Add floor builtin.  Patch by Cassie Epps!

llvm-svn: 162273

12 years ago[Sanitizer] implement internal_strcspn
Alexey Samsonov [Tue, 21 Aug 2012 09:26:26 +0000 (09:26 +0000)]
[Sanitizer] implement internal_strcspn

llvm-svn: 162272

12 years agoPort the global copy optimization from the SROA pass to InstCombine.
Chandler Carruth [Tue, 21 Aug 2012 08:39:44 +0000 (08:39 +0000)]
Port the global copy optimization from the SROA pass to InstCombine.
This optimization is really just replacing allocas wholesale with
globals, there is no scalarization.

The underlying motivation for this patch is to simplify the SROA pass
and focus it on splitting and promoting allocas.

llvm-svn: 162271

12 years agoFix up indentation and remove a couple else's after returns.
Craig Topper [Tue, 21 Aug 2012 08:29:51 +0000 (08:29 +0000)]
Fix up indentation and remove a couple else's after returns.

llvm-svn: 162270

12 years ago[asan] update asan-rt to match the interface change in LLVm (r162268)
Kostya Serebryany [Tue, 21 Aug 2012 08:24:35 +0000 (08:24 +0000)]
[asan] update asan-rt to match the interface change in LLVm (r162268)

llvm-svn: 162269

12 years ago[asan] add code to detect global initialization fiasco in C/C++. The sub-pass is...
Kostya Serebryany [Tue, 21 Aug 2012 08:24:25 +0000 (08:24 +0000)]
[asan] add code to detect global initialization fiasco in C/C++. The sub-pass is off by default for now. Patch by Reid Watson. Note: this patch changes the interface between LLVM and compiler-rt parts of asan. The corresponding patch to compiler-rt will follow.

llvm-svn: 162268

12 years agoUse uint16_t for tables of opcodes.
Craig Topper [Tue, 21 Aug 2012 08:23:21 +0000 (08:23 +0000)]
Use uint16_t for tables of opcodes.

llvm-svn: 162267

12 years agoFix up indentation. No functional change.
Craig Topper [Tue, 21 Aug 2012 08:17:07 +0000 (08:17 +0000)]
Fix up indentation. No functional change.

llvm-svn: 162264

12 years agoAdd a couple llvm_unreachables. Add a message to several others.
Craig Topper [Tue, 21 Aug 2012 08:16:16 +0000 (08:16 +0000)]
Add a couple llvm_unreachables. Add a message to several others.

llvm-svn: 162263

12 years ago[Sanitizer] define InternalScopedBuffer to replace large arrays on stack. It is defin...
Alexey Samsonov [Tue, 21 Aug 2012 08:13:37 +0000 (08:13 +0000)]
[Sanitizer] define InternalScopedBuffer to replace large arrays on stack. It is defined analogous to similar class in tsan and should replace it.

llvm-svn: 162262

12 years agoReplace a break with llvm_unreachable in the default case of a nested switch. Condens...
Craig Topper [Tue, 21 Aug 2012 07:32:16 +0000 (07:32 +0000)]
Replace a break with llvm_unreachable in the default case of a nested switch. Condense code a bit. No functional change.

llvm-svn: 162261

12 years agoCleanup the scalar FMA3 definitions. Add patterns to fold loads with scalar forms.
Craig Topper [Tue, 21 Aug 2012 07:11:11 +0000 (07:11 +0000)]
Cleanup the scalar FMA3 definitions. Add patterns to fold loads with scalar forms.

llvm-svn: 162260

12 years ago[asan] If we are compiling with ASan, add metadata indicating dynamically initialized...
Kostya Serebryany [Tue, 21 Aug 2012 06:53:28 +0000 (06:53 +0000)]
[asan] If we are compiling with ASan, add metadata indicating dynamically initialized globals. Patch by Reid Watson, reviewed by Richard Smith

llvm-svn: 162259

12 years ago[asan] fix lint
Kostya Serebryany [Tue, 21 Aug 2012 06:43:44 +0000 (06:43 +0000)]
[asan] fix lint

llvm-svn: 162258

12 years agoMerge FMA3 instructions with and without patterns into single classes using null_frag.
Craig Topper [Tue, 21 Aug 2012 05:56:45 +0000 (05:56 +0000)]
Merge FMA3 instructions with and without patterns into single classes using null_frag.

llvm-svn: 162257

12 years agorevise debug output to avoid dangling pointer
Michael Liao [Tue, 21 Aug 2012 05:55:22 +0000 (05:55 +0000)]
revise debug output to avoid dangling pointer

llvm-svn: 162256

12 years agoFix alignment of array of VarDecl* following array of unsigned in LambdaExpr.
Richard Smith [Tue, 21 Aug 2012 05:42:49 +0000 (05:42 +0000)]
Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.

llvm-svn: 162255

12 years agoWhen performing a trivial copy of a C++ type, we must be careful not
John McCall [Tue, 21 Aug 2012 04:10:00 +0000 (04:10 +0000)]
When performing a trivial copy of a C++ type, we must be careful not
to overwrite objects that might have been allocated into the type's
tail padding.  This patch is missing some potential optimizations where
the destination is provably a complete object, but it's necessary for
correctness.

Patch by Jonathan Sauer.

llvm-svn: 162254

12 years agoAvoid binding a reference to a dereferenced pointer in diagnostic serialization
Richard Smith [Tue, 21 Aug 2012 03:11:53 +0000 (03:11 +0000)]
Avoid binding a reference to a dereferenced pointer in diagnostic serialization
if a diagnostic is emitted outside of any source file. The fix mirrors the
corresponding code in TextDiagnosticPrinter. This required moving the
functional parts of SDiagRenderer into SDiagWriter so they can be reused in the
non-rendering codepath.

No functionality change.

llvm-svn: 162253

12 years agoScrew around with ObjCRuntime some more, changing the
John McCall [Tue, 21 Aug 2012 02:47:43 +0000 (02:47 +0000)]
Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates.  Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

llvm-svn: 162252

12 years agoDeclPrinter: describe what 'terse' output is.
Dmitri Gribenko [Tue, 21 Aug 2012 02:30:28 +0000 (02:30 +0000)]
DeclPrinter: describe what 'terse' output is.

llvm-svn: 162251

12 years agoSBValue::GetTypeName and SBValue::GetByteSize might have to update the dynamic value...
Jim Ingham [Tue, 21 Aug 2012 01:46:35 +0000 (01:46 +0000)]
SBValue::GetTypeName and SBValue::GetByteSize might have to update the dynamic value - which might involve running code.  So they need to take the stop lock & target locks.

<rdar://problem/12001204>

llvm-svn: 162250

12 years agoWhen this test case was first created it was
Jack Carter [Tue, 21 Aug 2012 00:59:48 +0000 (00:59 +0000)]
When this test case was first created it was
just trying to show it did not crash and burn.

This patch checks that the resultant .ll contents
are correct.

llvm-svn: 162249

12 years agoBetter diagnostics for range-based for loops with bad range types.
Sam Panzer [Tue, 21 Aug 2012 00:52:01 +0000 (00:52 +0000)]
Better diagnostics for range-based for loops with bad range types.

The old error message stating that 'begin' was an undeclared identifier
is replaced with a new message explaining that the error is in the range
expression, along with which of the begin() and end() functions was
problematic if relevant.

Additionally, if the range was a pointer type or defines operator*,
attempt to dereference the range, and offer a FixIt if the modified range
works.

llvm-svn: 162248

12 years agoAdd a missing def flag.
Jakob Stoklund Olesen [Tue, 21 Aug 2012 00:34:53 +0000 (00:34 +0000)]
Add a missing def flag.

*** Bad machine code: Explicit definition marked as use ***
- function:    test_cos
- basic block: BB#0 L.entry (0x7ff2a2024fd0)
- instruction: VSETLNi32 %D11, %D11<undef>, %R0, 0, pred:14, pred:%noreg, %Q5<imp-use,kill>, %Q5<imp-def>
- operand 0:   %D11

llvm-svn: 162247

12 years ago[analyzer] Assume that reference symbols are non-null.
Jordan Rose [Tue, 21 Aug 2012 00:27:33 +0000 (00:27 +0000)]
[analyzer] Assume that reference symbols are non-null.

By doing this in the constraint managers, we can ensure that ANY reference
whose value we don't know gets the effect, even if it's not a top-level
parameter.

llvm-svn: 162246

12 years agoDeclPrinter: add terse output mode and lots of tests
Dmitri Gribenko [Mon, 20 Aug 2012 23:39:06 +0000 (23:39 +0000)]
DeclPrinter: add terse output mode and lots of tests

Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter.  The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.

Also add many tests for DeclPrinter.  There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.

llvm-svn: 162245

12 years agoFix a pair of bugs relating to properties in ARC.
John McCall [Mon, 20 Aug 2012 23:36:59 +0000 (23:36 +0000)]
Fix a pair of bugs relating to properties in ARC.

First, when synthesizing an explicitly strong/retain/copy property
of Class type, don't pretend during compatibility checking that the
property is actually assign.  Instead, resolve incompatibilities
by secretly changing the type of *implicitly* __unsafe_unretained
Class ivars to be strong.  This is moderately evil but better than
what we were doing.

Second, when synthesizing the setter for a strong property of
non-retainable type, be sure to use objc_setProperty.  This is
possible when the property is decorated with the NSObject
attribute.  This is an ugly, ugly corner of the language, and
we probably ought to deprecate it.

The first is rdar://problem/12039404;  the second was noticed by
inspection while fixing the first.

llvm-svn: 162244

12 years agoReapply:
Eric Christopher [Mon, 20 Aug 2012 23:32:17 +0000 (23:32 +0000)]
Reapply:

Author: Eric Christopher <echristo@apple.com>
Date:   Thu Aug 16 23:50:46 2012 +0000

    Add some caching here for the builtin types.

    rdar://12117935

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162066 91177308-0d34-0410-b5e6-96231b3b80d8

after fixing a thinko.

llvm-svn: 162243

12 years agoFix the wrong comment in TestUUIDMismatchWarnings.py.
Johnny Chen [Mon, 20 Aug 2012 22:36:58 +0000 (22:36 +0000)]
Fix the wrong comment in TestUUIDMismatchWarnings.py.

llvm-svn: 162239

12 years agoAttaching comments to declarations: ignore implicit decls. Decl::isImplicit()
Dmitri Gribenko [Mon, 20 Aug 2012 22:36:31 +0000 (22:36 +0000)]
Attaching comments to declarations: ignore implicit decls.  Decl::isImplicit()
does not return true for all implicit decls currently.

This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too.

llvm-svn: 162238

12 years agoFix -Wswitch warning introduced by r162231
David Blaikie [Mon, 20 Aug 2012 22:22:51 +0000 (22:22 +0000)]
Fix -Wswitch warning introduced by r162231

llvm-svn: 162236

12 years agoRemove unused variable.
David Blaikie [Mon, 20 Aug 2012 22:22:48 +0000 (22:22 +0000)]
Remove unused variable.

llvm-svn: 162235

12 years ago[analyzer] More tests for "release and stop tracking".
Jordan Rose [Mon, 20 Aug 2012 22:15:44 +0000 (22:15 +0000)]
[analyzer] More tests for "release and stop tracking".

Under GC, a release message is ignored, so "release and stop tracking" just
becomes "stop tracking". But CFRelease is still honored. This is the main
difference between ns_consumed and cf_consumed.

llvm-svn: 162234

12 years agoFix a quadratic algorithm in MachineBranchProbabilityInfo.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 22:01:38 +0000 (22:01 +0000)]
Fix a quadratic algorithm in MachineBranchProbabilityInfo.

The getSumForBlock function was quadratic in the number of successors
because getSuccWeight would perform a linear search for an already known
iterator.

This patch was originally committed as r161460, but reverted again
because of assertion failures. Now that duplicate Machine CFG edges have
been eliminated, this works properly.

llvm-svn: 162233

12 years agoUse -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.
Jordan Rose [Mon, 20 Aug 2012 21:55:33 +0000 (21:55 +0000)]
Use -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.

This should unbreak the buildbots (r162220).

llvm-svn: 162232

12 years agoMake Option non virtual.
Michael J. Spencer [Mon, 20 Aug 2012 21:41:17 +0000 (21:41 +0000)]
Make Option non virtual.

llvm-svn: 162231

12 years agoDon't add CFG edges for redundant conditional branches.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 21:39:52 +0000 (21:39 +0000)]
Don't add CFG edges for redundant conditional branches.

IR that hasn't been through SimplifyCFG can look like this:

  br i1 %b, label %r, label %r

Make sure we don't create duplicate Machine CFG edges in this case.

Fix the machine code verifier to accept conditional branches with a
single CFG edge.

llvm-svn: 162230

12 years agoThread-safety analysis: fix scoping issues related to 'this', including an
DeLesley Hutchins [Mon, 20 Aug 2012 21:32:18 +0000 (21:32 +0000)]
Thread-safety analysis: fix scoping issues related to 'this', including an
ICE in friend functions.

llvm-svn: 162229

12 years agoFix a crash (_wrap_SBDebugger_SetInputFileHandle -> PyString_AsString) running the...
Johnny Chen [Mon, 20 Aug 2012 21:16:02 +0000 (21:16 +0000)]
Fix a crash (_wrap_SBDebugger_SetInputFileHandle -> PyString_AsString) running the test suite.
Also modify the boundary condition test case SBDebugger.DispatchInput(None) to be wrapped inside a try-except clause for now.

llvm-svn: 162228

12 years agoClarify that duplicate edges are not allowed in the Machine CFG.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 21:05:58 +0000 (21:05 +0000)]
Clarify that duplicate edges are not allowed in the Machine CFG.

LLVM IR has labeled duplicate CFG edges, but since Machine CFG edges
don't have labels, it doesn't make sense to allow duplicates. There is
no way of telling what the edges mean.

Duplicate CFG edges cause confusion when dealing with edge weights. It
seems that code producing duplicate CFG edges usually does the wrong
thing with edge weights.

llvm-svn: 162227

12 years agoFix InitListExpr::isStringLiteralInit so it handles various edge cases correctly...
Eli Friedman [Mon, 20 Aug 2012 20:55:45 +0000 (20:55 +0000)]
Fix InitListExpr::isStringLiteralInit so it handles various edge cases correctly.  PR13643.

llvm-svn: 162226

12 years agoAdds the most requested doc for the AST matchers: a reference
Manuel Klimek [Mon, 20 Aug 2012 20:54:03 +0000 (20:54 +0000)]
Adds the most requested doc for the AST matchers: a reference
of matchers, categorized by type and fully expanded for the
context in which they can be used.

I used a script to generate this documentation which I'll want
to be scrunitized by a code review before checking it in.

llvm-svn: 162225

12 years agoAdd a verification pass after ExpandISelPseudos.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 20:52:08 +0000 (20:52 +0000)]
Add a verification pass after ExpandISelPseudos.

This pass often has weird CFG hacks and hand-written MI building code
that can go wrong in many ways.

llvm-svn: 162224

12 years agoAdd CFG checks to MachineVerifier.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 20:52:06 +0000 (20:52 +0000)]
Add CFG checks to MachineVerifier.

Verify that the predecessor and successor lists are consistent and free
of duplicates.

llvm-svn: 162223

12 years agoUse a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock.
Jakob Stoklund Olesen [Mon, 20 Aug 2012 20:52:03 +0000 (20:52 +0000)]
Use a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock.

The test case ARM/2011-05-04-MultipleLandingPadSuccs.ll was creating
duplicate successor list entries.

llvm-svn: 162222

12 years ago[analyzer] Add a test for "release and stop tracking" behavior.
Jordan Rose [Mon, 20 Aug 2012 20:01:15 +0000 (20:01 +0000)]
[analyzer] Add a test for "release and stop tracking" behavior.

This is used to handle functions and methods that consume an argument
(annotated with the ns_consumed or cf_consumed attribute), but then the
argument's retain count may be further modified in a callback. We want
to warn about over-releasing, but we can't really track the object afterwards.

llvm-svn: 162221

12 years agoCode-complete 'weak' for properties under ARC-with-weak-references (or GC)
Jordan Rose [Mon, 20 Aug 2012 20:01:13 +0000 (20:01 +0000)]
Code-complete 'weak' for properties under ARC-with-weak-references (or GC)

Also, suggest 'readonly' even if the property has been given an ownership
attribute ('strong', 'weak', etc). This is used when properties are declared
readonly in the public interface but readwrite in a class extension.

<rdar://problem/11500004&11932285>

llvm-svn: 162220

12 years agoenable cross compilation with cmake
Sebastian Pop [Mon, 20 Aug 2012 19:56:52 +0000 (19:56 +0000)]
enable cross compilation with cmake

This patch allows us to use cmake to specify a cross compiler: target different
than host. In particular, it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE
variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them
available at configure time.

Here is the command line that I have used to test my patches to create a Hexagon
cross compiler hosted on x86:

$ cmake -G Ninja -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu ..
$ ninja check

llvm-svn: 162219

12 years agoenable Hexagon target from cmake
Sebastian Pop [Mon, 20 Aug 2012 19:56:49 +0000 (19:56 +0000)]
enable Hexagon target from cmake

The patch adds a missing case for the Hexagon target in cmake/config-ix.cmake.

llvm-svn: 162218

12 years agofix HexagonSubtarget parsing of -mv flag
Sebastian Pop [Mon, 20 Aug 2012 19:56:47 +0000 (19:56 +0000)]
fix HexagonSubtarget parsing of -mv flag

llvm-svn: 162217

12 years ago[analyzer] Add comments to ExplodedNode::NodeGroup.
Jordan Rose [Mon, 20 Aug 2012 18:59:46 +0000 (18:59 +0000)]
[analyzer] Add comments to ExplodedNode::NodeGroup.

No functionality change.

llvm-svn: 162216

12 years ago[analyzer] Replace boolean IsSink parameters with 'generateSink' methods.
Jordan Rose [Mon, 20 Aug 2012 18:43:42 +0000 (18:43 +0000)]
[analyzer] Replace boolean IsSink parameters with 'generateSink' methods.

Generating a sink is significantly different behavior from generating a
normal node, and a simple boolean parameter can be rather opaque. Per
offline discussion with Anna, adding new generation methods is the
clearest way to communicate intent.

No functionality change.

llvm-svn: 162215

12 years agofix a case where all operands of BUILD_VECTOR are undefined
Michael Liao [Mon, 20 Aug 2012 17:59:18 +0000 (17:59 +0000)]
fix a case where all operands of BUILD_VECTOR are undefined

llvm-svn: 162214

12 years agoFix coding style violations in 162135 and 162136.
Akira Hatanaka [Mon, 20 Aug 2012 17:53:24 +0000 (17:53 +0000)]
Fix coding style violations in 162135 and 162136.

Patch by Petar Jovanovic.

llvm-svn: 162213

12 years agoPR13619: Make sure we're not at EOF before looking at NextToken().
Richard Smith [Mon, 20 Aug 2012 17:37:52 +0000 (17:37 +0000)]
PR13619: Make sure we're not at EOF before looking at NextToken().

llvm-svn: 162212

12 years ago[ms-inline asm] Remove old cruft now that MS-style asms their own code path.
Chad Rosier [Mon, 20 Aug 2012 17:11:53 +0000 (17:11 +0000)]
[ms-inline asm] Remove old cruft now that MS-style asms their own code path.

llvm-svn: 162210

12 years ago[analyzer] The result of && or || is always a 1 or 0.
Jordan Rose [Mon, 20 Aug 2012 17:04:45 +0000 (17:04 +0000)]
[analyzer] The result of && or || is always a 1 or 0.

Forgetting to at least cast the result was giving us Loc/NonLoc problems
in SValBuilder (hitting an assertion). But the standard (both C and C++)
does actually guarantee that && and || will result in the actual values
1 and 0, typed as 'int' in C and 'bool' in C++, and we can easily model that.

PR13461

llvm-svn: 162209

12 years agoAdded qVAttachOrWaitSupported packet support.
Greg Clayton [Mon, 20 Aug 2012 16:50:43 +0000 (16:50 +0000)]
Added qVAttachOrWaitSupported packet support.

llvm-svn: 162207

12 years agoUse correct matcher name in the comment.
Dmitri Gribenko [Mon, 20 Aug 2012 16:48:14 +0000 (16:48 +0000)]
Use correct matcher name in the comment.

llvm-svn: 162206

12 years agoFix comments and variable naming:
Manuel Klimek [Mon, 20 Aug 2012 16:37:20 +0000 (16:37 +0000)]
Fix comments and variable naming:
- use InnerMatcher consistently, fix style violations on the way
- doxygenify code snippets across all comments
- start doxygenifying code references in text
- addeed missing Usable as: sections

llvm-svn: 162205

12 years agoA baton isn't needed to dispatch input.
Filipe Cabecinhas [Mon, 20 Aug 2012 16:21:04 +0000 (16:21 +0000)]
A baton isn't needed to dispatch input.

I also added a typemap to make DispatchInput usable in Python.

llvm-svn: 162204

12 years agoAdd FILE* typemaps for SBDebugger.GetInputFileHandle() and friends.
Filipe Cabecinhas [Mon, 20 Aug 2012 16:10:44 +0000 (16:10 +0000)]
Add FILE* typemaps for SBDebugger.GetInputFileHandle() and friends.

llvm-svn: 162203

12 years agoDynamic interceptors for dispatch_async and dispatch_after.
Alexander Potapenko [Mon, 20 Aug 2012 11:59:26 +0000 (11:59 +0000)]
Dynamic interceptors for dispatch_async and dispatch_after.

llvm-svn: 162202

12 years agoDataExtractor: Fix integer truncation issues in LEB128 extraction.
Benjamin Kramer [Mon, 20 Aug 2012 10:52:11 +0000 (10:52 +0000)]
DataExtractor: Fix integer truncation issues in LEB128 extraction.

llvm-svn: 162201

12 years ago[cindex.py] Cache the number of chunks in CompletionString
Tobias Grosser [Mon, 20 Aug 2012 10:38:16 +0000 (10:38 +0000)]
[cindex.py] Cache the number of chunks in CompletionString

Without this patch, lib.clang_getNumCompletionChunks is called at
each _iteration_ of a 'for chunk in CompletionString' loop. Now we
call it just once.

llvm-svn: 162200

12 years agoMinor refactoring: reduce code duplication by introducing a macro for dispatch_sync_f...
Alexander Potapenko [Mon, 20 Aug 2012 09:25:10 +0000 (09:25 +0000)]
Minor refactoring: reduce code duplication by introducing a macro for dispatch_sync_f, dispatch_async_f, dispatch_barrier_async_f bodies.

llvm-svn: 162199

12 years agoBetter wording for reference self-initialization warning.
Hans Wennborg [Mon, 20 Aug 2012 08:52:22 +0000 (08:52 +0000)]
Better wording for reference self-initialization warning.

llvm-svn: 162198

12 years agoFix a leftover #if defined(DYNAMIC_MAC_WRAPPERS).
Alexander Potapenko [Mon, 20 Aug 2012 08:49:49 +0000 (08:49 +0000)]
Fix a leftover #if defined(DYNAMIC_MAC_WRAPPERS).

llvm-svn: 162197

12 years agoForget to add testcase for r162195. Sorry.
Stepan Dyatkovskiy [Mon, 20 Aug 2012 08:03:18 +0000 (08:03 +0000)]
Forget to add testcase for r162195. Sorry.

llvm-svn: 162196

12 years agoFixed DAGCombiner bug (found and localized by James Malloy):
Stepan Dyatkovskiy [Mon, 20 Aug 2012 07:57:06 +0000 (07:57 +0000)]
Fixed DAGCombiner bug (found and localized by James Malloy):
The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it
consists purely of get_vector_elts from one or two source vectors. If
so, it either makes a concat_vectors node or a shufflevector node.

However, it doesn't check the element type width of the underlying
vector, so if you have this sequence:

Node0: v4i16 = ...
Node1: i32 = extract_vector_elt Node0
Node2: i32 = extract_vector_elt Node0
Node3: v16i8 = BUILD_VECTOR Node1, Node2, ...

It will attempt to:

Node0:    v4i16 = ...
NewNode1: v16i8 = concat_vectors Node0, ...

Where this is actually invalid because the element width is completely
different. This causes an assertion failure on DAG legalization stage.

Fix:
If output item type of BUILD_VECTOR differs from input item type.
Make concat_vectors based on input element type and then bitcast it to the output vector type. So the case described above will transformed to:
Node0:    v4i16 = ...
NewNode1: v8i16 = concat_vectors Node0, ...
NewNode2: v16i8 = bitcast NewNode1

llvm-svn: 162195

12 years agoRemove FMA3 intrinsic instructions in favor of patterns.
Craig Topper [Mon, 20 Aug 2012 06:21:25 +0000 (06:21 +0000)]
Remove FMA3 intrinsic instructions in favor of patterns.

llvm-svn: 162194

12 years agoUse correct intrinsic for 256-bit VFMSUBADDPS.
Craig Topper [Mon, 20 Aug 2012 06:03:04 +0000 (06:03 +0000)]
Use correct intrinsic for 256-bit VFMSUBADDPS.

llvm-svn: 162193

12 years agoRemove trailing white space and tab characters. No functional change.
Craig Topper [Sun, 19 Aug 2012 23:37:46 +0000 (23:37 +0000)]
Remove trailing white space and tab characters. No functional change.

llvm-svn: 162192

12 years ago[cindex.py] Add CachedProperty to CompletionChunk
Tobias Grosser [Sun, 19 Aug 2012 22:26:15 +0000 (22:26 +0000)]
[cindex.py] Add CachedProperty to CompletionChunk

Suggested by:  Francisco Lopes  <oblita@gmail.com>

llvm-svn: 162191

12 years ago[clang.py] Add CachedProperty decorator
Gregory Szorc [Sun, 19 Aug 2012 21:17:46 +0000 (21:17 +0000)]
[clang.py] Add CachedProperty decorator

It isn't used anywhere yet.

llvm-svn: 162190

12 years agoIn C++03 mode add an explicit conversion from int to the emulated class enum. Fixes...
Howard Hinnant [Sun, 19 Aug 2012 17:14:47 +0000 (17:14 +0000)]
In C++03 mode add an explicit conversion from int to the emulated class enum.  Fixes a problem reported by C. Bergström.

llvm-svn: 162189

12 years agoPatch contributed by Dev Dude for mingw64 port.
Howard Hinnant [Sun, 19 Aug 2012 15:13:16 +0000 (15:13 +0000)]
Patch contributed by Dev Dude for mingw64 port.

llvm-svn: 162188

12 years agoWhen unsafe math is used, we can use commutative FMAX and FMIN. In some cases
Nadav Rotem [Sun, 19 Aug 2012 13:06:16 +0000 (13:06 +0000)]
When unsafe math is used, we can use commutative FMAX and FMIN. In some cases
this allows for better code generation.

Added a new DAGCombine transformation to convert FMAX and FMIN to FMANC and
FMINC, which are commutative.

For example:

  movaps  %xmm0, %xmm1
  movsd LC(%rip), %xmm0
  minsd %xmm1, %xmm0

becomes:

  minsd LC(%rip), %xmm0

llvm-svn: 162187

12 years agoFabs folding is implemented.
Benjamin Kramer [Sun, 19 Aug 2012 09:51:44 +0000 (09:51 +0000)]
Fabs folding is implemented.

llvm-svn: 162186

12 years ago[cindex.py] Use spaces, not tabs for indentation
Tobias Grosser [Sat, 18 Aug 2012 23:52:41 +0000 (23:52 +0000)]
[cindex.py] Use spaces, not tabs for indentation

Reported by: Francisco Lopes  <oblita@gmail.com>

llvm-svn: 162182

12 years ago[cindex.py] Dispose code completion results properly
Tobias Grosser [Sat, 18 Aug 2012 23:04:08 +0000 (23:04 +0000)]
[cindex.py] Dispose code completion results properly

llvm-svn: 162181

12 years agoInstCombine: Fix a crasher when encountering a function pointer.
Benjamin Kramer [Sat, 18 Aug 2012 22:04:34 +0000 (22:04 +0000)]
InstCombine: Fix a crasher when encountering a function pointer.

llvm-svn: 162180

12 years agoRemove the CAND/COR/CXOR custom ISD nodes and their select code.
Jakob Stoklund Olesen [Sat, 18 Aug 2012 21:49:50 +0000 (21:49 +0000)]
Remove the CAND/COR/CXOR custom ISD nodes and their select code.

These nodes are no longer needed because the peephole pass can fold
CMOV+AND into ANDCC etc.

llvm-svn: 162179

12 years agoRemove virtual from many methods. These methods replace methods in the base class...
Craig Topper [Sat, 18 Aug 2012 21:38:45 +0000 (21:38 +0000)]
Remove virtual from many methods. These methods replace methods in the base class, but the base class methods aren't virtual so it just increased call overhead.

llvm-svn: 162178

12 years agoAlso combine zext/sext into selects for ARM.
Jakob Stoklund Olesen [Sat, 18 Aug 2012 21:25:22 +0000 (21:25 +0000)]
Also combine zext/sext into selects for ARM.

This turns common i1 patterns into predicated instructions:

  (add (zext cc), x) -> (select cc (add x, 1), x)
  (add (sext cc), x) -> (select cc (add x, -1), x)

For a function like:

  unsigned f(unsigned s, int x) {
    return s + (x>0);
  }

We now produce:

  cmp r1, #0
  it  gt
  addgt.w r0, r0, #1

Instead of:

  movs  r2, #0
  cmp r1, #0
  it  gt
  movgt r2, #1
  add r0, r2

llvm-svn: 162177