Commit Graph

6871 Commits

Author SHA1 Message Date
Steve Naroff
9ebc050ca7 Fix typo.
llvm-svn: 57899
2008-10-21 10:50:19 +00:00
Steve Naroff
a0ed165a84 Fix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning is over enthusiastic.
Fix <rdar://problem/6265257> warnings for ambiguous message send swamp other warnings.

Reworked Sema::MatchTwoMethodDeclarations() to optionally match based on method size and alignment (the default in GCC). Changed Sema::LookupInstanceMethodInGlobalPool() to use this feature.

Added -Wno-struct-selector-match to driver, however didn't hook it up yet. Added a FIXME that says this.

llvm-svn: 57898
2008-10-21 10:37:50 +00:00
Zhongxing Xu
dab76fd822 Localize the special processing of array variable inside
GRExprEngine::VisitCast() so that other parts of the analyzer can be ignorant.
When we cast "array of type T" to "pointer to T", we get the loc::MemRegionVal
corresponding to the array variable. This is sufficient for BasicStore, but not
for RegionStore. RegionStore should get the element region for the first array
element in the cast. So next comes to the revamping of transfer functions for
different store model.

llvm-svn: 57897
2008-10-21 06:54:23 +00:00
Zhongxing Xu
8f6855e642 Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.
llvm-svn: 57896
2008-10-21 06:27:32 +00:00
Ted Kremenek
0aee1cd5a3 Add partial specialization of ImmutableList for GRStatePartialTrait.
llvm-svn: 57895
2008-10-21 06:00:04 +00:00
Zhongxing Xu
7ff32d0955 Rename:
RValues.h/cpp => SVals.h/cpp

llvm-svn: 57893
2008-10-21 05:41:03 +00:00
Zhongxing Xu
83aff7079f Process decls in RegionStore. Individual elements of fixed size arrays are
initialized to UndefinedVal.

llvm-svn: 57892
2008-10-21 05:29:26 +00:00
Zhongxing Xu
d8fe46b496 Add ElementRegion to represent memory chunks for array elements.
llvm-svn: 57891
2008-10-21 05:27:10 +00:00
Ted Kremenek
9667b7c9c0 Updated checker build
llvm-svn: 57890
2008-10-21 04:32:44 +00:00
Ted Kremenek
d346dfe881 Add fileid_iterator to SourceManager.
llvm-svn: 57878
2008-10-21 03:32:32 +00:00
Ted Kremenek
4e0f205145 Added method to access the raw flags of Token.
llvm-svn: 57877
2008-10-21 03:32:15 +00:00
Ted Kremenek
9f20b6a610 Change signature for CheckDivideZero.
llvm-svn: 57876
2008-10-21 03:31:53 +00:00
Ted Kremenek
8ab23ade80 Added the start of a prototype implementation of PCH based on token caching.
llvm-svn: 57863
2008-10-21 00:54:44 +00:00
Ted Kremenek
c32ec3a0c4 Further improve path-sensitivity with divide-by-zero checking by assuming that a denominator cannot be zero even when the result of an '/' or '%' expression is unknown.
llvm-svn: 57855
2008-10-20 23:40:25 +00:00
Ted Kremenek
e67437f3a9 Added test case inspired by <rdar://6268365>: recover path-sensitivity after compound assignment when the result of the assignment is not known.
llvm-svn: 57852
2008-10-20 23:14:31 +00:00
Ted Kremenek
7f8a87f4a9 Used conjured symbols to recover path-sensitivity when the result of a compound assignment is UnknownVal().
llvm-svn: 57851
2008-10-20 23:13:25 +00:00
Steve Naroff
bca9fd755d Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id<protocol>.
llvm-svn: 57850
2008-10-20 22:53:06 +00:00
Steve Naroff
ea54d9ef72 Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).
llvm-svn: 57841
2008-10-20 18:19:10 +00:00
Matthijs Kooijman
1f7fac0da4 Add newline at the end of file, to silence compiler warning.
llvm-svn: 57818
2008-10-20 08:12:48 +00:00
Chris Lattner
2dfde91064 eliminate ObjCPropertyAttrs an corresponding enums, just use
strcmp when needed.

llvm-svn: 57817
2008-10-20 07:43:01 +00:00
Chris Lattner
825bca174d rearrange some code.
llvm-svn: 57816
2008-10-20 07:39:53 +00:00
Chris Lattner
1db3354d89 more simplifications to error recovery in ParseObjCPropertyAttribute
llvm-svn: 57815
2008-10-20 07:37:22 +00:00
Chris Lattner
18ffde822f remove extraneous braces
llvm-svn: 57814
2008-10-20 07:36:58 +00:00
Chris Lattner
beca77018a move some code around to make it fall through more, no functionality change.
llvm-svn: 57813
2008-10-20 07:24:39 +00:00
Chris Lattner
7661923999 reject properties completely in objc1 instead of emitting
weird errors about property attributes being unknown.

llvm-svn: 57812
2008-10-20 07:22:18 +00:00
Chris Lattner
64b1f2f030 More property attribute recovery improvements. Instead of this:
crash.m:8:12: error: type name requires a specifier or qualifier
@property (readonlyx, getter=isAwesome) int _awesome;
           ^
crash.m:8:29: error: expected ';' at end of declaration list
@property (readonlyx, getter=isAwesome) int _awesome;
                            ^
crash.m:8:39: error: expected identifier or '('
@property (readonlyx, getter=isAwesome) int _awesome;
                                      ^

we now get:

crash.m:8:12: error: unknown property attribute 'readonlyx'
@property (readonlyx, getter=isAwesome) int _awesome;
           ^

Also, we can eliminate isObjCPropertyAttribute now.

llvm-svn: 57811
2008-10-20 07:15:22 +00:00
Chris Lattner
55c53a3dd8 add testcase for the recovery improvements in my last patch.
llvm-svn: 57810
2008-10-20 07:03:51 +00:00
Chris Lattner
43c76c38fa significantly simplify and clean up error recovery in
ParseObjCPropertyAttribute.  Before, on this code (where
a comma was forgotten):

@property (readonly getter=isAwesome) int _awesome;

we emitted:

crash.m:9:11: error: expected ')'
@property (readonly getter=isAwesome) int _awesome;
          ^
crash.m:9:37: error: type name requires a specifier or qualifier
@property (readonly getter=isAwesome) int _awesome;
                                    ^
crash.m:9:37: error: expected identifier or '('
crash.m:9:37: error: expected ';' at end of declaration list
crash.m:9:1: error: @property requires fields to be named
@property (readonly getter=isAwesome) int _awesome;
^

now we emit:

crash.m:9:21: error: expected ')'
@property (readonly getter=isAwesome) int _awesome;
                    ^
crash.m:9:11: error: to match this '('
@property (readonly getter=isAwesome) int _awesome;
          ^

llvm-svn: 57809
2008-10-20 07:00:43 +00:00
Ted Kremenek
e76edcfc65 Updated checker build
llvm-svn: 57808
2008-10-20 06:58:23 +00:00
Chris Lattner
1ff6e73651 simplify some other code for __extension__ processing.
llvm-svn: 57807
2008-10-20 06:51:33 +00:00
Chris Lattner
f02ef3e6d4 implement a couple fixme's by implementing __extension__ properly.
llvm-svn: 57806
2008-10-20 06:45:43 +00:00
Chris Lattner
93429b047b fix a crash on unnamed properties like:
@property (readonly) int : 4;

llvm-svn: 57805
2008-10-20 06:33:53 +00:00
Chris Lattner
e0d3fe9b97 simplify some code by using ExpectAndConsume. When an error
occurs, skip to an @ or ; instead of to a } or ;.  Properties
don't necessarily live in {}'s.

llvm-svn: 57804
2008-10-20 06:15:13 +00:00
Chris Lattner
da9fb15b90 refactor a bunch of code:
Check for @end in ParseObjCInterfaceDeclList instead of in each caller
Handle @required and @optional with the same code

Add some fixmes about some apparently objc2 code that is being accepted
in objc1.

llvm-svn: 57803
2008-10-20 06:10:06 +00:00
Chris Lattner
bb8cc18788 fix some minor error recovery bugs in ParseObjCInterfaceDeclList
where it would reject @required in non-protocols, but then go
ahead and tag methods with required anyway.  Instead, if we see
this in something other than a protocol, just ignore the request.

Also, improve error recovery a bit when we see something bogus 
inside an interface.

llvm-svn: 57798
2008-10-20 05:57:40 +00:00
Chris Lattner
038a3e349d restructure the body of the ParseObjCInterfaceDeclList loop
to make it easier to understand.  No functionality change.

llvm-svn: 57797
2008-10-20 05:46:22 +00:00
Chris Lattner
2a9d9897b7 Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.

llvm-svn: 57796
2008-10-20 05:16:36 +00:00
Chris Lattner
29e6f2b674 Support attributes in *yet another* place. Is there any place you
can't stick an attributes?

llvm-svn: 57795
2008-10-20 04:57:38 +00:00
Chris Lattner
8ff2c6c9f0 Fix a parser bug where we let attributes interfere with our disambiguation
of whether a '(' was a grouping paren or the start of a function declarator.
This is PR2796.

Now we eat the attribute before deciding whether the paren is grouping or
not, then apply it to the resultant decl or to the first argument as needed.

One somewhat surprising aspect of this is that attributes interact with
implicit int in cases like this:

void a(x, y) // k&r style function
void b(__attribute__(()) x, y); // function with two implicit int arguments
void c(x, __attribute__(()) y); // error, can't have attr in identifier list.

Fun stuff.

llvm-svn: 57790
2008-10-20 02:05:46 +00:00
Chris Lattner
4b13d3f2f2 fix indentation
llvm-svn: 57789
2008-10-20 02:01:50 +00:00
Chris Lattner
fcc390a9df fix indentation
llvm-svn: 57788
2008-10-20 02:01:34 +00:00
Chris Lattner
409bf7d03a Remove an implemented fixme, only treat < as a type specifier
when ObjC is turned on.

llvm-svn: 57787
2008-10-20 00:25:30 +00:00
Argyrios Kyrtzidis
455b973d33 Change a couple of cast<> to reinterpret_cast<>.
The casts<> require that "Decl.h" is included before "Type.h", use reinterpret_cast<> to remove that kind of dependency.

llvm-svn: 57781
2008-10-19 12:05:48 +00:00
Ted Kremenek
ad4a57d757 Add "argument key" processing similar to ccc.
llvm-svn: 57780
2008-10-19 06:42:38 +00:00
Daniel Dunbar
969e35610d ccc: Pass '-g' through to clang. Handle -weak_framework.
llvm-svn: 57779
2008-10-19 02:41:16 +00:00
Daniel Dunbar
70e3ebafdb Improve attribute parsing & tests.
- Support noreturn on function-typed variables.

 - Extend isFunctionOrMethod to return true for K&R functions and
   provide hasFunctionProto to check if a decl has information about
   its arguments. This code needs some serious cleaning, but works.

 - Add/improve test cases for noreturn and unused.

llvm-svn: 57778
2008-10-19 02:04:16 +00:00
Ted Kremenek
f8d65a30d6 Add support in GRExprEngine for UnaryOperator::AlignOf. This fixes one crash report in PR 2796.
llvm-svn: 57777
2008-10-18 22:20:20 +00:00
Ted Kremenek
cfb049c832 Updated checker build
llvm-svn: 57775
2008-10-18 21:03:40 +00:00
Ted Kremenek
d36e552245 Fix incorrect release of Decl* array referenced by DeclGroup.
Patch by Timo Sirainen!

llvm-svn: 57772
2008-10-18 19:20:54 +00:00
Daniel Dunbar
354d278518 Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.

llvm-svn: 57769
2008-10-18 18:22:23 +00:00