Commit Graph

999 Commits

Author SHA1 Message Date
Chris Lattner 4591fd0aac Fix rdar://6103124, the only dummy blocks are ones without names. Named blocks
are important part of control flow structures.

llvm-svn: 54078
2008-07-25 23:40:10 +00:00
Chris Lattner 903eb518e6 Fix rdar://6095136, various crashes with incomplete enum types.
llvm-svn: 54074
2008-07-25 23:18:17 +00:00
Chris Lattner 61f60a05b2 c89 does not perform array -> pointer promotion unless the array is an lvalue. This
is different than C99.  This fixes the rest of rdar://6095180.

llvm-svn: 54064
2008-07-25 21:33:13 +00:00
Daniel Dunbar b5586dad97 Fix long double test case
- Had wrong sizeof(long double) encoded into test case
 - Results now agree with llvm-gcc

llvm-svn: 54059
2008-07-25 20:54:30 +00:00
Chris Lattner f6e1e309c7 In c99 mode, comma does do function/array promotion even though
it does not do unary promotions (like short->int).

llvm-svn: 54058
2008-07-25 20:54:07 +00:00
Ted Kremenek e17c037f4f Remove '.' in expected warning
llvm-svn: 54051
2008-07-25 20:30:34 +00:00
Chris Lattner e174acc910 Comma does not perform unary promotions, rdar://6095180
llvm-svn: 54045
2008-07-25 20:02:29 +00:00
Chris Lattner e08e47ab2f gcc requires a semicolon at the end of an interface, unlike its extension for structs.
rdar://6095245.

llvm-svn: 54044
2008-07-25 19:54:55 +00:00
Steve Naroff e2177fbfdc Cleaunup Sema::ActOnClassMessage(). This commit:
(a) removes a bogus warning.
(b) removes an undesirable usage of the ObjCMessageExpr constructor that takes an IdentifierInfo * (which I will abolish).

llvm-svn: 54042
2008-07-25 19:39:00 +00:00
Chris Lattner f9c49e5d27 Reject typedef redefinitions when the underlying types are not identical,
even if in a system header etc.  rdar://6079937

llvm-svn: 54038
2008-07-25 18:44:27 +00:00
Chris Lattner 31614aeb0a update this testcase.
llvm-svn: 54037
2008-07-25 18:42:46 +00:00
Daniel Dunbar c481f72857 Add test case for hex floating point constants in < C99 mode
- For: rdar://6096838

llvm-svn: 54036
2008-07-25 18:41:57 +00:00
Chris Lattner ec8996d771 Add support for __extension__ as an lvalue. rdar://6097308
llvm-svn: 54033
2008-07-25 18:07:19 +00:00
Ted Kremenek 092ec76923 Don't emit 'dead initialization' warnings for variables marked 'unused'.
This fixes PR 2573: http://llvm.org/bugs/show_bug.cgi?id=2573

llvm-svn: 54009
2008-07-25 04:47:34 +00:00
Daniel Dunbar 0e5845c13a Rework codegen of case ranges
- Fix multiple issues with the way case ranges were emitted, see test
   cases details about the specific issues.

 - The root issue was not being careful about how basic blocks were
   emitted which led to them being chained together incorrectly,
   resulting in improper control flow.

 - Fixes <rdar://problem/6098585>

llvm-svn: 54006
2008-07-25 01:11:38 +00:00
Daniel Dunbar dd49a04d18 Allow CLANG env variable to override "clang" command in TestRunner.sh
llvm-svn: 54005
2008-07-25 01:05:44 +00:00
Ted Kremenek 9e9afb552c Correctly handle NSAssertionHandle -handleFailureInMethod:object:file:lineNumber:description:
This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593

llvm-svn: 53993
2008-07-24 18:47:16 +00:00
Ted Kremenek 0e60b7588a Don't issue a missing +dealloc warning for classes that just contain SEL ivars.
This fixes PR 2592: http://llvm.org/bugs/show_bug.cgi?id=2592

llvm-svn: 53987
2008-07-24 17:45:56 +00:00
Ted Kremenek 53b29025f1 Rename test case file.
llvm-svn: 53984
2008-07-24 17:02:18 +00:00
Ted Kremenek 87b16f4258 Issue dead store warnings for preincrements involved in a subexpression.
llvm-svn: 53983
2008-07-24 17:01:17 +00:00
Ted Kremenek 0b5eb1ac87 Added dead stores test case.
llvm-svn: 53966
2008-07-23 23:18:43 +00:00
Ted Kremenek ecc851bb6e Further refine dead store checking to distinguish between dead stores and dead increments.
llvm-svn: 53960
2008-07-23 21:16:38 +00:00
Ted Kremenek 46abc7db6b Properly skip IBOutlets when checking for unused ivars.
Refine the error message of unused ivars.
Added test case.

llvm-svn: 53957
2008-07-23 18:21:36 +00:00
Chris Lattner 070968957e Fix rdar://6094010 various asserts happening with wide strings in inline asm.
llvm-svn: 53947
2008-07-23 06:46:56 +00:00
Chris Lattner d258325c2b Fix a codegen crash on:
int foo(void) {
  float x[2];
  return x;
}

rdar://6093986

llvm-svn: 53946
2008-07-23 06:31:27 +00:00
Ted Kremenek 98f6e582f2 Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
This implements <rdar://problem/6069935>

llvm-svn: 53891
2008-07-22 00:46:16 +00:00
Daniel Dunbar 327acd7a6c Implement bzero, memset, memmove builtins.
This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.

llvm-svn: 53888
2008-07-22 00:26:45 +00:00
Daniel Dunbar b725726c29 Implement nans, prefetch, and trap builtins.
This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.

llvm-svn: 53885
2008-07-21 22:59:13 +00:00
Ted Kremenek 5224e6a81d Add test case for nonnull attribute.
Fix indexing bug.

llvm-svn: 53882
2008-07-21 22:09:15 +00:00
Daniel Dunbar c2f67966f4 Add __builtin_powi[fl] support
llvm-svn: 53866
2008-07-21 18:44:41 +00:00
Daniel Dunbar 5b288788b3 Fix a test RUN line to not generate '=-' in test directory
llvm-svn: 53865
2008-07-21 18:42:27 +00:00
Daniel Dunbar d93abc3bb0 Implement ffs, parity, and popcount builtins.
+ test case

llvm-svn: 53851
2008-07-21 17:19:41 +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
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
Nuno Lopes 8a48c2f7d9 fix test
llvm-svn: 53802
2008-07-19 22:11:43 +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 8857703b57 Added test case.
llvm-svn: 53770
2008-07-18 20:48:10 +00:00
Daniel Dunbar 155ed24359 Prevent clang from emitting output when input has errors
+ test case
<rdar://problem/6080040>
http://llvm.org/bugs/show_bug.cgi?id=2280

llvm-svn: 53756
2008-07-18 16:38:05 +00:00
Argyrios Kyrtzidis bd25998a45 When in C++, make EnumConstant names hide tag names in the same scope, instead of colliding with them.
llvm-svn: 53702
2008-07-16 21:01:53 +00:00
Steve Naroff ce2dca186b RewriteObjC::RewriteObjCTryStmt():Don't synthesize a catch begin if there are 0 catch clauses.
This fixes <rdar://problem/5987211> clang ObjC rewriter: @try / @finally block produces unbalanced output.

llvm-svn: 53679
2008-07-16 15:31:30 +00:00
Argyrios Kyrtzidis 7da34d050b When checking for name collision between a tag and a previously defined namespace, the collision occured even when the tag was in a different nested scope.
Fix it by taking into account the scope when checking for namespace-tag name collisions.

llvm-svn: 53667
2008-07-16 07:45:46 +00:00
Ted Kremenek ed1f72b67c For the MissingDealloc check, don't treat IBOutlet ivars as being needed to be released
llvm-svn: 53647
2008-07-15 23:04:27 +00:00
Ted Kremenek 81bfc074c9 Distinguish between dead stores and dead initializations.
llvm-svn: 53628
2008-07-15 18:06:32 +00:00
Ted Kremenek fd7efdf20d Provide an "Analysis Scope" for Analyses so checks can either be run on code declarations (bodies) or Objective-C @implementation blocks.
llvm-svn: 53584
2008-07-15 00:46:02 +00:00
Nate Begeman 191a6b1f1b http://llvm.org/bugs/show_bug.cgi?id=2523
Add some code to handle vector comparisons, which is the language side
of the llvm vicmp/vfcmp instructions.  Also make the vector-vector and
vector-scalar asign checks a bit more sane under the presence of lax vector
conversions.

llvm-svn: 53565
2008-07-14 18:02:46 +00:00
Ted Kremenek 3bfb314c25 Add new check: -check-objc-methodsigs. This check scans methods in
ObjCImplementationDecls and sees if a ancestor class defines a method with the
same selector but with a different type signature. Right now it just compares
return types, and mainly looks at differences in primitive values. The checking
will be expanded in the future.

llvm-svn: 53482
2008-07-11 22:40:47 +00:00
Ted Kremenek 1aaa6d8c19 Add test case.
llvm-svn: 53335
2008-07-09 18:11:43 +00:00
Nuno Lopes 7bfa180056 fix CheckForConstantInitializer() for Compound Literals
also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me)

llvm-svn: 53174
2008-07-07 16:46:50 +00:00
Argyrios Kyrtzidis 5708a4661e '&&' commands together so that the test status reflects the results of all the commands, otherwise the test status will be the result of only the last command.
llvm-svn: 53135
2008-07-04 10:33:02 +00:00