Commit Graph

45963 Commits

Author SHA1 Message Date
Chris Lattner 046485640d fix typo
llvm-svn: 53848
2008-07-21 07:13:18 +00:00
Chris Lattner ca1e848588 Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a 
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from 
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't.  Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on 
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~   ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^

llvm-svn: 53846
2008-07-21 07:06:49 +00:00
Chris Lattner 87899be4cc when in the context of an @implementation, look for private methods in the
@implementation to resolve nullary selector references.

llvm-svn: 53845
2008-07-21 06:44:27 +00:00
Evan Cheng e001643358 Use movaps instead of movups to spill 16-byte vector values when default alignment is >= 16. This fixes some massive performance regressions.
llvm-svn: 53844
2008-07-21 06:34:17 +00:00
Chris Lattner f1c149db9f don't pass in null as the Name for GenerateClassStructure,
it goes and makes std::strings out of them, which is not 
defined.

llvm-svn: 53843
2008-07-21 06:31:05 +00:00
Chris Lattner 12bf571fa8 improve diagnostics about problems with receivers to highlight the receiver.
llvm-svn: 53842
2008-07-21 06:16:07 +00:00
Chris Lattner bd2d634424 continue cleaning up code, and disable sending a message directly to an
interface.  This fixes a bug where we used to accept:

void test2(NSNumber x) {
	[x METH];
}

which doesn't make sense and GCC rejects.

llvm-svn: 53841
2008-07-21 06:12:56 +00:00
Chris Lattner 6b946cc788 simplify control flow a bit, reducing indentation. No functionality change.
llvm-svn: 53837
2008-07-21 05:57:44 +00:00
Chris Lattner 79f14789d8 tighten up some checks, don't allow sending a message to NSString****
llvm-svn: 53836
2008-07-21 05:54:02 +00:00
Chris Lattner 393f4ae047 update diagnostic to include string
llvm-svn: 53835
2008-07-21 05:38:58 +00:00
Chris Lattner 0c373078e2 improve invalid member reference diagnostics to print the type and
have better source ranges.  Before:

t.m:11:53: error: member reference is not to a structure or union
    CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
                                                    ^~~~~~~

after:

t.m:11:54: error: member reference base type ('id') is not a structure or union
    CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

llvm-svn: 53834
2008-07-21 05:35:34 +00:00
Chris Lattner 3f44d70771 merge a bunch of code that is now common between qual interfaces and interfaces.
llvm-svn: 53833
2008-07-21 05:27:51 +00:00
Chris Lattner d7983b472e rename getProtocols -> getProtocol, as it only returns a single
protocol.  Simplify some code to use unconditional form of the
protocol access list.

llvm-svn: 53832
2008-07-21 05:20:01 +00:00
Chris Lattner 419f699b55 use iterators instead of direct access to protocol list.
llvm-svn: 53831
2008-07-21 05:19:23 +00:00
Chris Lattner 13b2ace8df improve documentation of ObjCInterfaceType significantly. Also,
make the qual_* iterators and getNumProtocols() lists be accessible through
ObjCInterfaceType (returning an empty range if not a 
ObjCQualifiedInterfaceType).  This eliminates special checks in clients.

llvm-svn: 53830
2008-07-21 05:13:51 +00:00
Chris Lattner dc420f4866 Fix a bunch of crashes that occur in (attempted) handling of objc properties.
This code would previously crash on x.y where x is 'id'.

llvm-svn: 53827
2008-07-21 04:59:05 +00:00
Chris Lattner f8f5682998 right, the error is when the itf *doesn't* have the member.
llvm-svn: 53826
2008-07-21 04:54:33 +00:00
Chris Lattner bf58ba78df use the simplified form of lookupInstanceVariable for callers who
don't care which class actually defines it.

llvm-svn: 53825
2008-07-21 04:44:44 +00:00
Chris Lattner 8bb52cb5a2 improve the diagnostic for an erroneous objc ivar reference
from:

t.m:8:7: error: member reference is not to a structure or union
  pool->farm = 0;
      ^ ~~~~
to:

t.m:8:7: error: 'NSAutoreleasePool' has member named 'farm'
  pool->farm = 0;
  ~~~~^ ~~~~

llvm-svn: 53824
2008-07-21 04:42:08 +00:00
Chris Lattner 4befd736b2 simplify a bunch of code, no functionality change.
llvm-svn: 53823
2008-07-21 04:36:39 +00:00
Chris Lattner b63a745331 rearrange some code, no functionality change.
llvm-svn: 53822
2008-07-21 04:28:12 +00:00
Chris Lattner 530315fe89 improve comments yet again, now I know what this does :)
llvm-svn: 53821
2008-07-21 04:16:33 +00:00
Chris Lattner 6886f38369 minor rename, also, reject pointer to qualified id.
id<NSCopyable>*  is not an "objc pointer type", id<NSCopyable> is.

llvm-svn: 53820
2008-07-21 04:13:58 +00:00
Chris Lattner c47d930448 Fix a crash that can happen when you have typedefs for pointers to
interfaces.  Just because they x->isPointerType() doesn't mean it is
valid to just cast to a pointertype.  We have to handle typedefs etc
as well.

llvm-svn: 53819
2008-07-21 04:09:54 +00:00
Chris Lattner 15727f69fa improve comments.
llvm-svn: 53818
2008-07-21 04:07:11 +00:00
Chris Lattner 2a47fa7372 simplify this predicate, only checking isObjCQualifiedIdType once.
llvm-svn: 53817
2008-07-21 04:03:34 +00:00
Nick Lewycky 56e328bb81 Revert r53812 -- premature. LegalizeTypes isn't actually on yet!
llvm-svn: 53816
2008-07-21 04:03:00 +00:00
Nick Lewycky 419a174ccf Switch on the use of arbitrary precision integers in scalar evolution. This will
bail after 256-bits to avoid producing code that the backends can't handle.
Previously, we capped it at 64-bits, preferring to miscompile in those cases.

This change also reverts much of r52248 because the invariants the code was
expecting are now being met.

llvm-svn: 53812
2008-07-21 02:51:31 +00:00
Wojciech Matyjewicz 1185ad1abc This header isn't necessary now.
llvm-svn: 53811
2008-07-20 17:35:32 +00:00
Wojciech Matyjewicz f0d21cdd19 Fix PR2088. Use modulo linear equation solver to compute loop iteration
count.

llvm-svn: 53810
2008-07-20 15:55:14 +00:00
Cedric Venet 9acb15565f Updated VC++ projects
llvm-svn: 53809
2008-07-20 12:04:49 +00:00
Chris Lattner 9099474130 Add a space, ted apparently has philosophical problems with spaces ;-)
llvm-svn: 53808
2008-07-20 04:22:06 +00:00
Bill Wendling 75840e6435 Fix for first part of PR2562. Generate the "pinsrw" instruction for inserts
into v4i16 vectors.

llvm-svn: 53807
2008-07-20 02:32:23 +00:00
Bill Wendling 1071bfb17d Pull r53795 from Gaz into mainline:
If .loc and .file aren't used, always emit the "debug_line" section. This
requires at least one entry in the line matrix. So if there's nothing to emit
into the matrix, emit an end of matrix value anyway.

llvm-svn: 53803
2008-07-20 00:11:19 +00:00
Nuno Lopes 8a48c2f7d9 fix test
llvm-svn: 53802
2008-07-19 22:11:43 +00:00
Anton Korobeynikov bc780e3441 Unbreak build: 'DarwinTargetAsmInfo' was already taken as PPC TAI flavour.
llvm-svn: 53801
2008-07-19 21:44:57 +00:00
Ted Kremenek 4f2fb96d18 Updated latest checker build.
llvm-svn: 53800
2008-07-19 19:50:00 +00:00
Ted Kremenek f487548c17 Patch by Kovarththanan Rajaratnam:
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."

llvm-svn: 53797
2008-07-19 19:10:40 +00:00
Ted Kremenek 0fff6d3c06 Patch by
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."

llvm-svn: 53796
2008-07-19 19:10:04 +00:00
Duncan Sands 2a28791789 Make sure custom lowering for LegalizeTypes
returns a node with the right number of
return values.  This fixes codegen of
Generic/cast-fp.ll, Generic/fp_to_int.ll
and PowerPC/multiple-return-values.ll
when using -march=ppc32 -mattr=+64bit.

llvm-svn: 53794
2008-07-19 16:26:02 +00:00
Nick Lewycky 82510bf0e3 XFAIL this test.
llvm-svn: 53793
2008-07-19 15:52:06 +00:00
Wojciech Matyjewicz a78669c2cf While testing particular algorithms to compute loop iteration count the brute
force evaluation (ComputeIterationCountExhaustively) should be turned off.

It doesn't apply to trip-count2.ll because this file tests the brute force
evaluation.

The test for PR2364 (2008-05-25-NegativeStepToZero.ll) currently fails
showing that the patch for this bug doesn't work. I'll fix it in a few hours
with a patch for PR2088.

llvm-svn: 53792
2008-07-19 13:26:15 +00:00
Anton Korobeynikov b26de0765e Use chars, where possible
llvm-svn: 53791
2008-07-19 13:16:32 +00:00
Anton Korobeynikov bb24791a57 Switch MIPS to new ELFTargetAsmInfo. Add few FIXMEs.
llvm-svn: 53790
2008-07-19 13:16:11 +00:00
Anton Korobeynikov aaee859a18 Fix a FIXME :)
llvm-svn: 53789
2008-07-19 13:15:46 +00:00
Anton Korobeynikov 4e05489745 Use generic ELFTargetAsmInfo and DarwinTargetAsmInfo for X86 code
llvm-svn: 53788
2008-07-19 13:15:21 +00:00
Anton Korobeynikov c187438dcd Add TargetAsmInfo stuff for all darwin-based targets
llvm-svn: 53787
2008-07-19 13:14:46 +00:00
Anton Korobeynikov 1d03fcc7c9 Add TargetAsmInfo for all ELF-based targets
llvm-svn: 53786
2008-07-19 13:14:11 +00:00
Anton Korobeynikov 74d3fa165c Testcase for PR2549
llvm-svn: 53785
2008-07-19 06:31:12 +00:00
Anton Korobeynikov b7a49925a1 Use aligned stack spills, where possible. This fixes PR2549.
llvm-svn: 53784
2008-07-19 06:30:51 +00:00