Commit Graph

132153 Commits

Author SHA1 Message Date
Craig Topper 4f3879dfa7 Merge FMA3 instructions with and without patterns into single classes using null_frag.
llvm-svn: 162257
2012-08-21 05:56:45 +00:00
Michael Liao 6e12d12830 revise debug output to avoid dangling pointer
llvm-svn: 162256
2012-08-21 05:55:22 +00:00
Richard Smith c7520bf785 Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.
llvm-svn: 162255
2012-08-21 05:42:49 +00:00
John McCall f1249929c8 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
2012-08-21 04:10:00 +00:00
Richard Smith a9f521fd20 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
2012-08-21 03:11:53 +00:00
John McCall 3deb1ad40c 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
2012-08-21 02:47:43 +00:00
Dmitri Gribenko 3e358ccf92 DeclPrinter: describe what 'terse' output is.
llvm-svn: 162251
2012-08-21 02:30:28 +00:00
Jim Ingham 48cdc58f0a 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
2012-08-21 01:46:35 +00:00
Jack Carter 0980793f87 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
2012-08-21 00:59:48 +00:00
Sam Panzer 0f38443616 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
2012-08-21 00:52:01 +00:00
Jakob Stoklund Olesen 74e6f9fc65 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
2012-08-21 00:34:53 +00:00
Jordan Rose 075d5d2e99 [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
2012-08-21 00:27:33 +00:00
Dmitri Gribenko 309856ae9f 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
2012-08-20 23:39:06 +00:00
John McCall d8561f058d 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
2012-08-20 23:36:59 +00:00
Eric Christopher 4a903df403 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
2012-08-20 23:32:17 +00:00
Johnny Chen d773139bbc Fix the wrong comment in TestUUIDMismatchWarnings.py.
llvm-svn: 162239
2012-08-20 22:36:58 +00:00
Dmitri Gribenko b1ad993957 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
2012-08-20 22:36:31 +00:00
David Blaikie b6b9623952 Fix -Wswitch warning introduced by r162231
llvm-svn: 162236
2012-08-20 22:22:51 +00:00
David Blaikie c276b25e46 Remove unused variable.
llvm-svn: 162235
2012-08-20 22:22:48 +00:00
Jordan Rose eaacff4826 [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
2012-08-20 22:15:44 +00:00
Jakob Stoklund Olesen 6bae2a57d5 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
2012-08-20 22:01:38 +00:00
Jordan Rose 517fdc7a2d Use -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.
This should unbreak the buildbots (r162220).

llvm-svn: 162232
2012-08-20 21:55:33 +00:00
Michael J. Spencer ad3ccc3cb0 Make Option non virtual.
llvm-svn: 162231
2012-08-20 21:41:17 +00:00
Jakob Stoklund Olesen 7d33c5739f 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
2012-08-20 21:39:52 +00:00
DeLesley Hutchins f1150d3a16 Thread-safety analysis: fix scoping issues related to 'this', including an
ICE in friend functions.

llvm-svn: 162229
2012-08-20 21:32:18 +00:00
Johnny Chen 9b832fe40d 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
2012-08-20 21:16:02 +00:00
Jakob Stoklund Olesen 784973b89e 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
2012-08-20 21:05:58 +00:00
Eli Friedman cf4ab0891d Fix InitListExpr::isStringLiteralInit so it handles various edge cases correctly. PR13643.
llvm-svn: 162226
2012-08-20 20:55:45 +00:00
Manuel Klimek c40c9851b1 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
2012-08-20 20:54:03 +00:00
Jakob Stoklund Olesen 1d0262677b 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
2012-08-20 20:52:08 +00:00
Jakob Stoklund Olesen de31b52c3e Add CFG checks to MachineVerifier.
Verify that the predecessor and successor lists are consistent and free
of duplicates.

llvm-svn: 162223
2012-08-20 20:52:06 +00:00
Jakob Stoklund Olesen 710093e360 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
2012-08-20 20:52:03 +00:00
Jordan Rose bda04301d4 [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
2012-08-20 20:01:15 +00:00
Jordan Rose 53cb2f327a 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
2012-08-20 20:01:13 +00:00
Sebastian Pop faeca292a2 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
2012-08-20 19:56:52 +00:00
Sebastian Pop 8f4aec434e enable Hexagon target from cmake
The patch adds a missing case for the Hexagon target in cmake/config-ix.cmake.

llvm-svn: 162218
2012-08-20 19:56:49 +00:00
Sebastian Pop 1a0bef6d4b fix HexagonSubtarget parsing of -mv flag
llvm-svn: 162217
2012-08-20 19:56:47 +00:00
Jordan Rose 2b10f3f8a9 [analyzer] Add comments to ExplodedNode::NodeGroup.
No functionality change.

llvm-svn: 162216
2012-08-20 18:59:46 +00:00
Jordan Rose 4b4613cbec [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
2012-08-20 18:43:42 +00:00
Michael Liao 10ff96ce8c fix a case where all operands of BUILD_VECTOR are undefined
llvm-svn: 162214
2012-08-20 17:59:18 +00:00
Akira Hatanaka 11dfbe196f Fix coding style violations in 162135 and 162136.
Patch by Petar Jovanovic.

llvm-svn: 162213
2012-08-20 17:53:24 +00:00
Richard Smith 62e6630af9 PR13619: Make sure we're not at EOF before looking at NextToken().
llvm-svn: 162212
2012-08-20 17:37:52 +00:00
Chad Rosier d4e55b8e35 [ms-inline asm] Remove old cruft now that MS-style asms their own code path.
llvm-svn: 162210
2012-08-20 17:11:53 +00:00
Jordan Rose 0a9ea7c70d [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
2012-08-20 17:04:45 +00:00
Greg Clayton 486290078c Added qVAttachOrWaitSupported packet support.
llvm-svn: 162207
2012-08-20 16:50:43 +00:00
Dmitri Gribenko b1cfa19b5a Use correct matcher name in the comment.
llvm-svn: 162206
2012-08-20 16:48:14 +00:00
Manuel Klimek 4f3ecf1ce0 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
2012-08-20 16:37:20 +00:00
Filipe Cabecinhas c30199917a A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.

llvm-svn: 162204
2012-08-20 16:21:04 +00:00
Filipe Cabecinhas 4c1f3a1cc5 Add FILE* typemaps for SBDebugger.GetInputFileHandle() and friends.
llvm-svn: 162203
2012-08-20 16:10:44 +00:00
Alexander Potapenko 02e6f03236 Dynamic interceptors for dispatch_async and dispatch_after.
llvm-svn: 162202
2012-08-20 11:59:26 +00:00