Chris Lattner
964c27c66c
add forward definition protocols to the protocol list for a class.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:35:17 +00:00
Chris Lattner
919d87d4ee
references to completely undeclared protocols should be errors.
...
References to forward definitions should be warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:34:02 +00:00
Steve Naroff
600e4e8c35
RewriteObjC::RewriteObjCForCollectionStmt() needs to handle bodies with a single statement.
...
Fixes <rdar://problem/6084870> clang ObjC rewriter: for-in enumeration in 1 line produces output with error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:26:02 +00:00
Chris Lattner
3db6cae19c
introduce a new ObjCList templated class and start moving
...
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:19:38 +00:00
Ted Kremenek
fcde95db82
Update checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 17:53:09 +00:00
Chris Lattner
f7b2c98c16
rename setReferencedProtocolList -> addReferencedProtocols to
...
be consistent with ObjCInterfaceDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53852 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 17:23:15 +00:00
Daniel Dunbar
04b290030e
Implement ffs, parity, and popcount builtins.
...
+ test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 17:19:41 +00:00
Argyrios Kyrtzidis
e8f0d30358
Change 'MDecl' to 'MD' to fix redefinition compiler error in MSVC++.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 09:18:38 +00:00
Chris Lattner
cfb0ef5676
fix typo
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 07:13:18 +00:00
Chris Lattner
b752f28902
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>
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 07:06:49 +00:00
Chris Lattner
6562fdad21
when in the context of an @implementation, look for private methods in the
...
@implementation to resolve nullary selector references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 06:44:27 +00:00
Chris Lattner
1565e0364b
don't pass in null as the Name for GenerateClassStructure,
...
it goes and makes std::strings out of them, which is not
defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 06:31:05 +00:00
Chris Lattner
0b2f7ea279
improve diagnostics about problems with receivers to highlight the receiver.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 06:16:07 +00:00
Chris Lattner
2b1cc8be4d
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 06:12:56 +00:00
Chris Lattner
fe1a553256
simplify control flow a bit, reducing indentation. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:57:44 +00:00
Chris Lattner
b24d921132
tighten up some checks, don't allow sending a message to NSString****
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:54:02 +00:00
Chris Lattner
58b1b2702b
update diagnostic to include string
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:38:58 +00:00
Chris Lattner
2a01b724b6
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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:35:34 +00:00
Chris Lattner
c188d308eb
merge a bunch of code that is now common between qual interfaces and interfaces.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:27:51 +00:00
Chris Lattner
9baefc21bf
rename getProtocols -> getProtocol, as it only returns a single
...
protocol. Simplify some code to use unconditional form of the
protocol access list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53832 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:20:01 +00:00
Chris Lattner
cdce6d17be
use iterators instead of direct access to protocol list.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:19:23 +00:00
Chris Lattner
fb7701df54
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53830 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 05:13:51 +00:00
Chris Lattner
a38e6b1f00
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'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:59:05 +00:00
Chris Lattner
88a72516e2
right, the error is when the itf *doesn't* have the member.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:54:33 +00:00
Chris Lattner
123a11f2fd
use the simplified form of lookupInstanceVariable for callers who
...
don't care which class actually defines it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:44:44 +00:00
Chris Lattner
1f719747b2
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;
~~~~^ ~~~~
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:42:08 +00:00
Chris Lattner
68a057b429
simplify a bunch of code, no functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:36:39 +00:00
Chris Lattner
fb173ecd2d
rearrange some code, no functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:28:12 +00:00
Chris Lattner
b49b572aa3
improve comments yet again, now I know what this does :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:16:33 +00:00
Chris Lattner
0b6d1e6070
minor rename, also, reject pointer to qualified id.
...
id<NSCopyable>* is not an "objc pointer type", id<NSCopyable> is.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:13:58 +00:00
Chris Lattner
17af2a62f3
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:09:54 +00:00
Chris Lattner
d85376aa66
improve comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:07:11 +00:00
Chris Lattner
22e684a148
simplify this predicate, only checking isObjCQualifiedIdType once.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:03:34 +00:00
Chris Lattner
d9069d1cbb
Add a space, ted apparently has philosophical problems with spaces ;-)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-20 04:22:06 +00:00
Nuno Lopes
9039a69ab9
fix test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 22:11:43 +00:00
Ted Kremenek
17360d58e2
Updated latest checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 19:50:00 +00:00
Ted Kremenek
24af60f528
Patch by Kovarththanan Rajaratnam:
...
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 19:10:40 +00:00
Ted Kremenek
109949a5f5
Patch by
...
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 19:10:04 +00:00
Ted Kremenek
fbeeca84dd
Reimplement ccc-analyzer in a language I actually know, and implement some obvious optimizations when processing command line arguments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 06:11:04 +00:00
Ted Kremenek
2be1853a09
Remove typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 23:13:03 +00:00
Ted Kremenek
a3ed36afa9
Quote invocation of clang in pipe to handle paths with spaces.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 23:11:33 +00:00
Ted Kremenek
c083b0dbdb
Added test case.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 20:48:10 +00:00
Ted Kremenek
1bc90ad15d
Update checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53769 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 20:22:22 +00:00
Ted Kremenek
1a80448f6f
"currentHandler" is a nullary selector
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 18:14:26 +00:00
Ted Kremenek
2d1086cec0
Fix caching bug.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 17:39:56 +00:00
Ted Kremenek
70a733e64e
Add panic support for NSAssertionHandler.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 17:24:20 +00:00
Daniel Dunbar
c8aeb655c3
Prevent clang from emitting output when input has errors
...
+ test case
<rdar://problem/6080040>
http://llvm.org/bugs/show_bug.cgi?id=2280
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 16:38:05 +00:00
Ted Kremenek
7386d77217
Add panic function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 16:28:33 +00:00
Ted Kremenek
75b0a1ce3e
Fix 80 col violation
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:59:33 +00:00
Ted Kremenek
40fc5c7e23
Fix regression by explicitly checking if we are negating a SymIntConstantVal.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:54:51 +00:00