Ted Kremenek
78d46242e3
Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngineInternalChecks.cpp.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 16:21:24 +00:00
Ted Kremenek
e3ae82accd
Rename file.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53906 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 14:41:47 +00:00
Daniel Dunbar
9140845f95
Prevent codegen crash on sizeof(<function type>), a gcc extension.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 01:35:47 +00:00
Daniel Dunbar
0c980d1997
Add svn:ignore for cscope.{out,files} in top level clang dir
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 01:03:06 +00:00
Ted Kremenek
584def7364
Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
...
This implements <rdar://problem/6069935>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 00:46:16 +00:00
Daniel Dunbar
1caae95901
Implement bzero, memset, memmove builtins.
...
This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 00:26:45 +00:00
Daniel Dunbar
4493f79fce
Implement nans, prefetch, and trap builtins.
...
This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 22:59:13 +00:00
Chris Lattner
7caeabd868
minor cleanup to the actions interface to pass around SmallVectorImpl instead
...
of a specific smallvector size.
Fix protocol lists to pass down proper location info, so we get diagnostics
like this:
t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
instead of this:
t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 22:17:28 +00:00
Ted Kremenek
465172f304
Add test case for nonnull attribute.
...
Fix indexing bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 22:09:15 +00:00
Ted Kremenek
eb2b2a3f18
Added sema support for the nonnull attribute. Will add test cases soon.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 21:53:04 +00:00
Daniel Dunbar
14ecaefc28
Kill an unused variable warning
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 21:43:28 +00:00
Chris Lattner
9d0aaa11cd
unindent this function by using an early exit, not functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 21:33:21 +00:00
Chris Lattner
780f329cb0
move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
...
simplifying code along the way and fixing a problem and memory leak or two.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 21:32:27 +00:00
Daniel Dunbar
dbddbe4da4
Add svn:ignore property for test Output directories
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:45:49 +00:00
Daniel Dunbar
a933c3c052
Add __builtin_powi[fl] support
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:44:41 +00:00
Daniel Dunbar
4fbc2b0d87
Fix a test RUN line to not generate '=-' in test directory
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 18:42:27 +00:00
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