Commit Graph

10005 Commits

Author SHA1 Message Date
Ted Kremenek 82157a17c1 Per Chris L.'s suggestion, use getAsFunctionType() instead of getDesguaredType(). Constify some pointers along the way.
llvm-svn: 65321
2009-02-23 16:51:39 +00:00
Steve Naroff 59bf35e44a Remove isSuperExpr(), which ignores any casts on 'super'.
I don't think casting super makes any sense (since it won't effect method lookup).
Will discuss with other offline and decide what to do.

llvm-svn: 65317
2009-02-23 15:40:48 +00:00
Eli Friedman 3ae5911042 A few small improvements to Evaluate for stuff I noted in FIXMEs.
llvm-svn: 65305
2009-02-23 04:23:56 +00:00
Ted Kremenek e73f282213 retain/release checker: For now don't track the retain count of NSWindow objects (opt for false negatives).
llvm-svn: 65304
2009-02-23 02:51:29 +00:00
Ted Kremenek e6d2b40bcc More retain/release naming convention tests.
llvm-svn: 65303
2009-02-23 02:50:20 +00:00
Ted Kremenek 5485a2f70b Remove typo.
llvm-svn: 65302
2009-02-23 02:42:56 +00:00
Ted Kremenek 7d4fc5bcdc '[NSAutoreleasePool addObject:]' has an 'autorelease' effect, not a DoNothing effect.
llvm-svn: 65301
2009-02-23 02:31:16 +00:00
Steve Naroff 77170dcb14 Sema::ActOnInstanceMessage(): Tighen up the lookup rules for handling messages to 'Class'. Also improve "super" handling.
llvm-svn: 65300
2009-02-23 02:25:40 +00:00
Ted Kremenek 5fa0d070a5 Add test case for PR 2599.
llvm-svn: 65299
2009-02-23 01:29:25 +00:00
Steve Naroff d2c44d224c Minor cleanup, replace bool with qual_empty().
llvm-svn: 65293
2009-02-22 19:41:00 +00:00
Steve Naroff c4173fa704 Contains the following (related to problems found while investigting <rdar://problem/6497631> Message lookup is sometimes different than gcc's).
- Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default).
- Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol).
- Changed several test cases to jive with the above changes.

llvm-svn: 65292
2009-02-22 19:35:57 +00:00
Anders Carlsson e14282e274 Make sure to reset the DidCallStackSave variable before emitting a compound statement. Fixes PR3649.
llvm-svn: 65291
2009-02-22 18:44:21 +00:00
Fariborz Jahanian 0773533b27 More objc gc work. Match gcc's treatment of ivar access
true a local pointer to objective-c object in generating
write barriers.

llvm-svn: 65290
2009-02-22 18:40:18 +00:00
Mike Stump e8b2d066ea Copy some clenaups from Eli to code that I copied. :-)
llvm-svn: 65286
2009-02-22 13:55:31 +00:00
Mike Stump 624497c29a Cleanp code with some recent suggestions.
llvm-svn: 65285
2009-02-22 13:27:11 +00:00
Eli Friedman c2b5017a72 A bit of Evaluate cleanup. Also, a full audit of what's missing that
someone would reasonably expect Evaluate to handle for C/ObjC.

llvm-svn: 65284
2009-02-22 11:46:18 +00:00
Ted Kremenek cd25abed46 Update to checker-0.162 (fixed header issue in tar.bz2 package).
llvm-svn: 65283
2009-02-22 08:50:06 +00:00
Ted Kremenek 589aa282dd Reverted back to checker-0.161 because of a header issue.
llvm-svn: 65281
2009-02-22 08:42:49 +00:00
Ted Kremenek 1f19573c84 Updated checker build.
llvm-svn: 65280
2009-02-22 08:38:12 +00:00
Daniel Dunbar bb525c3c7f x86_64 ABI: Actually, we can always pass things we want to pass in
memory using Indirect; this was a holdover from when CGCall wasn't as
robust.

llvm-svn: 65278
2009-02-22 08:17:51 +00:00
Daniel Dunbar 9e5dfc6111 ccc: Remove unknown host warning, it was breaking gcc's configure.
llvm-svn: 65276
2009-02-22 08:15:14 +00:00
Eli Friedman fd85266342 Fix test to be legal on 64-bit systems.
llvm-svn: 65270
2009-02-22 07:40:57 +00:00
Ted Kremenek 35251f3d92 Fix regression in naming convention derivation: a method only follows the copy 'rule' if it doesn't already start with 'init', etc.
llvm-svn: 65269
2009-02-22 07:32:24 +00:00
Eli Friedman 825fe7565e Eliminate a bunch of code which should be dead.
llvm-svn: 65267
2009-02-22 07:29:04 +00:00
Daniel Dunbar 075d642e24 x86_64 ABI: Make sure to pass vectors that we want to pass in memory
as byval. Otherwise LLVM will have its own opinion about where to put
things.

We now pass all gcc dg.compat tests on x86_64.

llvm-svn: 65266
2009-02-22 07:22:25 +00:00
Eli Friedman 7bfab36877 Throw the switch to exclusively use Evaluate (along with the small
helper isConstantInitializer) to check whether an initializer is 
constant.  This passes tests, but it's possible that it'll cause 
regressions with real-world code.

Future work:
1. The diagnostics obtained this way are lower quality at the moment; 
some work both here and in Evaluate is needed for accurate diagnostics.
2. We probably need some extra code when we're in -pedantic mode so we 
can strictly enforce the rules in C99 6.6p7.
3. Dead code cleanup (this should wait until after 2, because we might 
want to re-use some of the code).

llvm-svn: 65265
2009-02-22 06:45:27 +00:00
Daniel Dunbar c64c481d18 x86_64 ABI: Pass 32-bit vectors as Integer to match gcc. We don't care
about these much but <2 x i16> shows up in the gcc test suite.

llvm-svn: 65264
2009-02-22 04:48:22 +00:00
Daniel Dunbar 3ebd531b2c ABITestGen: Use explicit list of vector types instead of just a list
of sizes. Turns out we don't care very much about vector types that
don't map to the hardware.

llvm-svn: 65263
2009-02-22 04:17:53 +00:00
Daniel Dunbar f25afad9e5 x86_64 ABI: Classify <1 x i64> as INTEGER (match gcc not llvm-gcc).
Also, make sure to pass <1 x i64> as i64 (not <1 x i64>, which doesn't
quite work yet in the backend).

llvm-svn: 65262
2009-02-22 04:16:10 +00:00
Eli Friedman f837924faf Enhance Evaluate to handle ObjC qualified id and class types; as far as
I know, these follow the exact same rules as pointers, so I just made 
them use the same codepath.  Someone more familiar with ObjC should 
double-check this, though.

llvm-svn: 65261
2009-02-22 04:02:33 +00:00
Eli Friedman 3f8c01a110 Fix for PR3433: map __alignof__ to preferred alignment. (This was
partially done in r65258.)

llvm-svn: 65260
2009-02-22 03:31:23 +00:00
Eli Friedman 34ef305759 Last part of PR3254: use the same alignment computation in Sema and
CodeGen.  I'm not sure whether this actually makes any visible 
difference, but it's better to be consistent anyway.

llvm-svn: 65259
2009-02-22 03:23:43 +00:00
Eli Friedman 19a546c15b Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in
PR3254 and part of PR3433.

The isICE changes are necessary to keep the computed results 
consistent with Evaluate.

llvm-svn: 65258
2009-02-22 02:56:25 +00:00
Steve Naroff 10cbe66f17 Remove debugging statement.
llvm-svn: 65257
2009-02-22 02:19:47 +00:00
Anders Carlsson b8482c5d5d Match gcc and always perform array/function conversion for asm input exprs. Fixes PR3641.
llvm-svn: 65256
2009-02-22 02:11:23 +00:00
Anders Carlsson d05f44b5ca Correctly encode incomplete and variable length arrays. Fixes PR3639.
llvm-svn: 65255
2009-02-22 01:38:57 +00:00
Daniel Dunbar f175ba1d17 ccc: Remove temporary files used in compilation, and remove
compilation results on failures.

llvm-svn: 65254
2009-02-22 01:23:52 +00:00
Eli Friedman 2194bb78ec Sanity fix for PR3642: if we're treating a diagnostic as an error, it's
required to actually be an error for correctness.  The attached testcase 
now gives an error instead of mysteriously crashing.

Now, it's possible we actually want to support the given usage, but I 
haven't looked at the relevant code closely.

llvm-svn: 65253
2009-02-22 00:20:44 +00:00
Daniel Dunbar 9cbbd99c4b Force arch for these test cases.
llvm-svn: 65252
2009-02-21 23:45:41 +00:00
Fariborz Jahanian a9fecf3f9e local array of objects are non-gc'able.
llvm-svn: 65251
2009-02-21 23:37:19 +00:00
Steve Naroff 8487e3e541 More work to integrate newly added ObjCQualifiedClassType into the type system.
This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

llvm-svn: 65248
2009-02-21 21:17:01 +00:00
Daniel Dunbar 3283ff5088 Put compiler headers in <prefix>/lib/clang/1.0/include (vs
<prefix>/Headers, gross).

llvm-svn: 65247
2009-02-21 20:52:41 +00:00
Steve Naroff 670e72ddc7 Add support for GCC ObjC extension "Class<protocol>". Sigh.
Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

Will never be seen in user code. Needed to pass dejagnu testsuite.

llvm-svn: 65244
2009-02-21 20:17:11 +00:00
Mike Stump 2ac40a9ff8 The blocks ABI is wrong, add a FIXME.
llvm-svn: 65243
2009-02-21 20:07:44 +00:00
Mike Stump cb2fbcb0c9 Add CodeGen support for the helper for BlockDeclRefExprs. The easier
stuff is mostly done.  Move BlockHasCopyDispose up.

llvm-svn: 65242
2009-02-21 20:00:35 +00:00
Steve Naroff cd8d572283 Warn about bogus protocol qualifiers.
llvm-svn: 65241
2009-02-21 19:50:43 +00:00
Fariborz Jahanian 0c9404e0a7 Warn on use of __weak attribute on local
variable (objc2 gc specific).

llvm-svn: 65240
2009-02-21 19:44:02 +00:00
Fariborz Jahanian 2300ad57a0 Fix a bug whereby a pointer to a __weak was not recognized
as __weak (objc2 gc specific).

llvm-svn: 65238
2009-02-21 19:08:45 +00:00
Ted Kremenek 97ad7b689e Use llvm::StringsEqualNoCase instead of strncasecmp.
llvm-svn: 65237
2009-02-21 18:26:02 +00:00
Fariborz Jahanian ccfd554024 Fixed an ICE in meta-data generation of __weak/__strong ivars.
llvm-svn: 65235
2009-02-21 18:23:24 +00:00