Commit Graph

5149 Commits

Author SHA1 Message Date
Eli Friedman 4b0e2a30e0 Implement codegen for comma operator for structs.
llvm-svn: 51304
2008-05-20 07:56:31 +00:00
Eli Friedman d0e48ea682 Be a bit more defensive in SemaInit.
llvm-svn: 51301
2008-05-20 05:25:56 +00:00
Eli Friedman 37a186d765 Add some more checking for compound literals.
llvm-svn: 51300
2008-05-20 05:22:08 +00:00
Ted Kremenek 78aa98f7b8 Reclaim memory from chains of ScopedDecls, and reclaim memory for the initializers of EnumConstantDecls.
llvm-svn: 51299
2008-05-20 04:49:55 +00:00
Ted Kremenek 40e489dfd8 Delete AST nodes, not just Decls.
llvm-svn: 51298
2008-05-20 04:10:52 +00:00
Ted Kremenek fa8a09e0bc Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.
Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).

llvm-svn: 51297
2008-05-20 03:56:00 +00:00
Ted Kremenek 878ff6c04d When serializing FunctionDecl, serialize out a reference to the previous declaration.
llvm-svn: 51294
2008-05-20 03:33:58 +00:00
Ted Kremenek b865b38eda Remove unnecessary #include (introduced by a recent patch of mine).
llvm-svn: 51288
2008-05-20 00:47:23 +00:00
Ted Kremenek ce20e8fe8d Try to plug some memory leaks...
1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.

2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.

3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.

3) FunctionDecl::Destroy now releases its Body using its Destroy method.

4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors.  We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.

5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.

llvm-svn: 51286
2008-05-20 00:43:19 +00:00
Eli Friedman 247ee87e26 Restructure constant structure init codegen so that it's possible to
implement bitfield codegen (although I don't envy the person who 
implements it).  This also prevents a crash on code like that from PR2309
(it's still broken, but it fails more gracefully).

llvm-svn: 51285
2008-05-20 00:11:07 +00:00
Eli Friedman 8d0b976e7c Remove code that shouldn't have any effect anymore.
llvm-svn: 51284
2008-05-20 00:04:21 +00:00
Eli Friedman a3a4068949 Implement CodeGen for __builtin_memcpy.
llvm-svn: 51282
2008-05-19 23:27:48 +00:00
Ted Kremenek 3b965e1d01 Updated Xcode project.
llvm-svn: 51281
2008-05-19 23:19:04 +00:00
Ted Kremenek ee5794265a Added Stmt::DestroyChildren, which will be used by the dstors of the subclasses of Stmt to recursively delete their child AST nodes.
llvm-svn: 51278
2008-05-19 22:02:12 +00:00
Eli Friedman ca8da1d89d Make the unused expression warning a bit less aggressive (found in PHP
code).

llvm-svn: 51276
2008-05-19 21:24:43 +00:00
Eli Friedman a68c3006f4 Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give
it a few days to make sure there aren't any significant regressions.

llvm-svn: 51273
2008-05-19 20:29:35 +00:00
Eli Friedman 6fcdec280b Adjust warning so that it doesn't fire when there is an error.
llvm-svn: 51269
2008-05-19 20:20:43 +00:00
Eli Friedman 541268086a Remove illegal test.
llvm-svn: 51267
2008-05-19 20:17:34 +00:00
Eli Friedman feb4cc1c6a Add errors for some illegal constructs (specifically, "int a = {{3}};"
and "int a = {};").  I'll adjust the tests in a bit.

llvm-svn: 51265
2008-05-19 20:12:18 +00:00
Eli Friedman 5a36d3fffb Some more SemaInit cleanup.
llvm-svn: 51262
2008-05-19 20:00:43 +00:00
Eli Friedman 23a9e3176c Various fixes; solves (almost) all of the test regressions that would be
caused by enabling SemaInit.

llvm-svn: 51261
2008-05-19 19:16:24 +00:00
Eli Friedman f23b6fa41f Fix the emission of expressions like char a[10] = "asdf"; previously,
they were causing bad code to be emitted.  There are two fixes here: one 
makes sure we emit a string that is long enough, and one makes sure we 
properly handle string initialization in init lists.

llvm-svn: 51259
2008-05-19 17:51:16 +00:00
Eli Friedman 8e12298192 Add proper type-checking for pointer additiion; before, we were accepting
addition with a pointer and an integer even when it didn't make sense.

llvm-svn: 51228
2008-05-18 18:08:51 +00:00
Eli Friedman f2442dcc8d Fix support for _Bool bitfields. The issue is that the bitfield width
used for _Bool is not the same as the primitive width (which for _Bool 
is 1 bit).  The load and store changes add some casts to make the 
types consistent.  The EmitLValue changes make sure that the pointer is 
of an appropriate type for loading the bitfield.

This isn't perfect, but it's an improvement, and getting everything 
right depends on actually laying out structs in an ABI-compliant way.

llvm-svn: 51224
2008-05-17 20:03:47 +00:00
Ted Kremenek d727220d1a Micro-optimization when checking for panic functions.
llvm-svn: 51214
2008-05-17 00:42:01 +00:00
Ted Kremenek c8081b4e16 Fix 80 col violation.
llvm-svn: 51213
2008-05-17 00:40:45 +00:00
Ted Kremenek 0e76583574 Added panic function _XCAssertionFailureHandler.
llvm-svn: 51212
2008-05-17 00:33:23 +00:00
Eli Friedman d5a4838e3d Backout of codegen-based fix to PR2334; this has been fixed differently
at the Sema layer.

llvm-svn: 51203
2008-05-16 20:38:39 +00:00
Eli Friedman 928ab4d546 Sema-based fix for PR2334. The issue is that even if the two sides of
the condidtional have compatible types, they are not necessarily the 
same type.  Therefore, we cast to the composite type.  As a hack, for 
the moment we assume that the composite type is the type of the 
left-hand expression; this isn't correct, but it's good enough for most 
purposes.

llvm-svn: 51202
2008-05-16 20:37:07 +00:00
Nate Begeman 9800faa578 Fix some prototypes, and implement some builtins until we have our header files completed.
llvm-svn: 51199
2008-05-16 18:59:42 +00:00
Ted Kremenek c812b23ce8 Cache leaks by the allocation site, not the leak location.
llvm-svn: 51198
2008-05-16 18:33:44 +00:00
Ted Kremenek 590abd363e Partitioned BugTypeCachedLocation::isCached() into two methods: one that accepts and ExplodedNode, and the other that accepts a ProgramPoint. The default behavior is to cache bug reports by the
location they occur (the end node).  Subclasses can override this behavior by providing a different ProgramPoint.

llvm-svn: 51197
2008-05-16 18:33:14 +00:00
Eli Friedman 823622105e Review nit.
llvm-svn: 51196
2008-05-16 17:54:49 +00:00
Eli Friedman a959a59ac6 Clean up ownership per review comment.
llvm-svn: 51195
2008-05-16 17:51:27 +00:00
Eli Friedman bb0eb81ebf Fix review nit.
llvm-svn: 51194
2008-05-16 17:44:00 +00:00
Eli Friedman cb92a3f03b Patch for PR2334, and a similar ObjC bug.
llvm-svn: 51193
2008-05-16 17:37:11 +00:00
Ted Kremenek 92137a3d8d Added CFGBlock::hasBinaryBranchTerminator().
llvm-svn: 51190
2008-05-16 16:06:00 +00:00
Eli Friedman db421caaa3 Minor cleanup to isBuiltinConstantExpr.
llvm-svn: 51188
2008-05-16 13:28:37 +00:00
Ted Kremenek dd547b1ce9 Fixed another regression introduced by r51113 caused by some refactoring
in Sema::CheckFunctionCall:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html
  
The bug was that the logic from the helper methods used by CheckFunctionCall
were being inverted (a subtle bug).  This would cause the parser to discard
any valid AST nodes involving several builtins (see patch).

This removes the last regression failure I'm seeing in the test suite: Analysis-Apple/NoReturn.

llvm-svn: 51168
2008-05-15 22:24:49 +00:00
Ted Kremenek 98b730d5bb Removed bogus "return true" in Expr::isConstantExpr that returned true for all
expressions. This appears to be a regression introduced in r51113 that caused
many test cases to fail (there is still a test case in the Analysis directory
that is failing):

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html

llvm-svn: 51164
2008-05-15 21:49:04 +00:00
Steve Naroff ad91868aa6 Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).

llvm-svn: 51163
2008-05-15 21:12:10 +00:00
Steve Naroff bdc67b382f Revert...
Author: akirtzidis
Date: Wed May 14 05:00:15 2008
New Revision: 51101

URL: http://llvm.org/viewvc/llvm-project?rev=51101&view=rev
Log: Upgrading VC++ projects to VC++ 2008.

I really need to build with VC++ 2005.

llvm-svn: 51158
2008-05-15 19:53:06 +00:00
Argyrios Kyrtzidis 1a599ea820 Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.
llvm-svn: 51153
2008-05-15 17:53:43 +00:00
Argyrios Kyrtzidis 212f91107a Comments fix.
llvm-svn: 51151
2008-05-15 17:26:35 +00:00
Nate Begeman 6c59132241 Handle a couple missing builtins that will go away eventually when the various
intrin.h files are finished

llvm-svn: 51137
2008-05-15 07:38:03 +00:00
Steve Naroff 0424b0e70d Add some of GCC's object checking builtin's.
llvm-svn: 51133
2008-05-14 22:12:15 +00:00
Eli Friedman f0d0e9e174 Use double-underscores in front of all non-keywords to protect against
#define pollution.

llvm-svn: 51128
2008-05-14 20:32:22 +00:00
Ted Kremenek 1907394f74 Don't specify a -o option to clang when not using "-checker-cfref".
llvm-svn: 51124
2008-05-14 20:26:52 +00:00
Ted Kremenek e0927a0f49 Fix variable misspelling.
llvm-svn: 51122
2008-05-14 20:20:46 +00:00
Ted Kremenek cf05a830b1 Don't run clang on .s files.
llvm-svn: 51121
2008-05-14 20:17:17 +00:00
Eli Friedman e94e0f66cd Make header use the new __builtin_shufflevector builtin.
llvm-svn: 51117
2008-05-14 20:11:29 +00:00
Ted Kremenek e3fc13a3e0 Added "-a" option to scan-build to select the analysis (ASTConsumer) used by clang. The default is -checker-cfref.
llvm-svn: 51116
2008-05-14 20:10:33 +00:00
Eli Friedman a1b4ed8003 Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.  
The expected immediate usage is in *mmintrin.h, so that they don't 
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.

llvm-svn: 51113
2008-05-14 19:38:39 +00:00
Ted Kremenek 0a8a0fa0b5 Zero-pad the month and day fields in the output HTML directory.
llvm-svn: 51109
2008-05-14 17:23:56 +00:00
Argyrios Kyrtzidis 881848119c Update the clangSema VC++ project.
llvm-svn: 51104
2008-05-14 10:50:44 +00:00
Argyrios Kyrtzidis 3722daf62d Change CRLF line endings to LF.
llvm-svn: 51103
2008-05-14 10:49:47 +00:00
Argyrios Kyrtzidis 7ebefaf3c7 Upgrading VC++ projects to VC++ 2008.
llvm-svn: 51101
2008-05-14 10:00:15 +00:00
Eli Friedman 7e452e59e4 An array of VLAs is a VLA. Shouldn't make any significant difference at
the moment, but it what you'd expect in the AST from reading the 
standard, and it should make VLA codegen a bit more strightforward.

llvm-svn: 51086
2008-05-14 00:40:18 +00:00
Eli Friedman 9fd8b68568 Add codegen support for block-level compound literals.
llvm-svn: 51081
2008-05-13 23:18:27 +00:00
Eli Friedman dd7406e65c Add support for init lists for complex variables.
llvm-svn: 51080
2008-05-13 23:11:35 +00:00
Ted Kremenek 20a44ed730 Output #LINE for computing line counts.
llvm-svn: 51079
2008-05-13 22:56:36 +00:00
Ted Kremenek 7147584d03 Use "-i" option with make when ignoring errors.
llvm-svn: 51070
2008-05-13 21:28:02 +00:00
Nate Begeman d386215916 Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.
llvm-svn: 51068
2008-05-13 21:03:02 +00:00
Eli Friedman 58639e584c Both operands to && have to be scalars, not just one.
llvm-svn: 51065
2008-05-13 20:16:47 +00:00
Ted Kremenek 52387a1828 Re-enable the analyzer.
llvm-svn: 51055
2008-05-13 17:10:28 +00:00
Eli Friedman 1a5754a26a Detabify.
llvm-svn: 51042
2008-05-13 14:40:48 +00:00
Ted Kremenek 80ff5f0696 Place "-x" option before other analyzer options.
llvm-svn: 51014
2008-05-12 23:56:50 +00:00
Ted Kremenek ece302d75b Directly invoke gcc immediately instead of before we process the command line arguments.
llvm-svn: 51012
2008-05-12 23:47:41 +00:00
Steve Naroff a98fe19c7e Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.
Teach Sema::MergeVarDecl() about __private_extern__.

llvm-svn: 51005
2008-05-12 22:36:43 +00:00
Ted Kremenek f5a94e7114 Added internal command logging.
llvm-svn: 51003
2008-05-12 22:07:14 +00:00
Steve Naroff bf1516c618 Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats
llvm-svn: 51002
2008-05-12 21:44:38 +00:00
Chris Lattner c9c296d235 testcase for PR2263, fixed by Nate's r50903 patch.
llvm-svn: 50983
2008-05-12 18:31:17 +00:00
Ted Kremenek 2abde809ce Unbreak build.
llvm-svn: 50980
2008-05-12 17:42:30 +00:00
Ted Kremenek a0055a8ef5 Support StringLiteralVal when comparing LVal types.
llvm-svn: 50979
2008-05-12 17:41:30 +00:00
Ted Kremenek 8322da5fa3 Grammar cleanup in comment.
Remove redundant assignment.

llvm-svn: 50978
2008-05-12 17:40:56 +00:00
Ted Kremenek babaa52efb 80 col violation fix.
llvm-svn: 50977
2008-05-12 17:40:13 +00:00
Ted Kremenek 92f78f4c04 When reading in the DeclCtx during deserialization, register the DeclCtx of the
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The
value of DeclCtx gets filled in *later* by the backpatcher.

This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308

llvm-svn: 50976
2008-05-12 17:29:34 +00:00
Ted Kremenek 9a15a9477b Add Type::getAsTypedefType().
llvm-svn: 50970
2008-05-12 16:22:53 +00:00
Eli Friedman 6a7087e455 Emit basic block for switch body; fixes PR2307.
llvm-svn: 50968
2008-05-12 16:08:04 +00:00
Eli Friedman 6e31321043 Don't try to take the address of a bitfield; fixes PR2310.
llvm-svn: 50966
2008-05-12 15:06:05 +00:00
Nuno Lopes de9746cd45 fix free/delete mismatch problem in add/mergeProperties (found by valgrind)
llvm-svn: 50945
2008-05-10 10:31:54 +00:00
Chris Lattner 14196c099f Implement -rewrite-macros, which is a crazy macro expander that expands
macros but doesn't expand #includes, remove comments, remove #defines
etc.

For example:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x

bbaa  bbaa

#if 1 
funclike("gar")
foo /*blah*/  bar
bar
#endif

#if 0
funclike()
#endif
----


rewrites to:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x 

/*bbaa  bbaa*/

#if 1
 "gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/
foo /*blah*/  bar
bar
#endif

#if 0
/*funclike()*/
#endif
----

llvm-svn: 50925
2008-05-10 00:02:33 +00:00
Ted Kremenek acdde6f099 Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared).
llvm-svn: 50924
2008-05-09 23:45:33 +00:00
Argyrios Kyrtzidis fa8e15bfa5 -Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.

llvm-svn: 50923
2008-05-09 23:39:43 +00:00
Chris Lattner 664ef65981 make #if 0 code compile, even though it still isn't very useful.
llvm-svn: 50920
2008-05-09 22:43:24 +00:00
Mon P Wang b84407d6ec Added support to generate some atomic operators (add, sub, and, or etc..)
llvm-svn: 50919
2008-05-09 22:40:52 +00:00
Steve Naroff d30f8c5b54 Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.
llvm-svn: 50915
2008-05-09 21:17:56 +00:00
Steve Naroff 530c3f9403 DO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well.
llvm-svn: 50913
2008-05-09 20:52:28 +00:00
Steve Naroff 0889b9bfac More VC++ project file updates.
llvm-svn: 50909
2008-05-09 19:10:27 +00:00
Ted Kremenek 82e8d07b02 Remove repeated word.
llvm-svn: 50907
2008-05-09 17:53:57 +00:00
Ted Kremenek 712c91f8a9 Add attribute "format" support for typedefs of function pointers.
llvm-svn: 50906
2008-05-09 17:36:24 +00:00
Ted Kremenek bbd4695a45 Grammar.
llvm-svn: 50905
2008-05-09 17:13:18 +00:00
Ted Kremenek 4d180b36f3 Added text on librewrite and libanalysis to the README.
llvm-svn: 50904
2008-05-09 17:12:45 +00:00
Nate Begeman 1d30431002 Handle all attributes on a parameter
llvm-svn: 50903
2008-05-09 16:56:01 +00:00
Nate Begeman f322eabbce Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector.  This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.

llvm-svn: 50892
2008-05-09 06:41:27 +00:00
Chris Lattner ba7a6c14ed set long/pointers to 64-bits on ppc64/x86-64
llvm-svn: 50891
2008-05-09 06:17:04 +00:00
Chris Lattner 5e2ef0c18a parameterize pointer size/align better without doing virtual method calls in normal case.
llvm-svn: 50890
2008-05-09 06:08:39 +00:00
Chris Lattner 55258cf278 simplify some code, don't assume that sizeof(long) < sizeof(long long).
llvm-svn: 50888
2008-05-09 05:59:00 +00:00
Chris Lattner 5a9aaaf687 parameterize long long.
llvm-svn: 50887
2008-05-09 05:50:02 +00:00
Chris Lattner 5dc7ff1cf3 correctly parameterize long, patch by Nate.
llvm-svn: 50886
2008-05-09 05:47:41 +00:00
Chris Lattner adb86418db Fix rdar://5921025 a crash on the included testcase.
llvm-svn: 50885
2008-05-09 05:34:49 +00:00
Chris Lattner 2fdcddd78d Don't call into objc front-end when not parsing objc code. This avoids
crashes because objc types aren't set up right.

llvm-svn: 50884
2008-05-09 05:28:21 +00:00
Steve Naroff 2e4e385a58 Make sure the prototype for objc_msgSend_fpret() returns a double.
llvm-svn: 50873
2008-05-08 22:02:18 +00:00
Nate Begeman c58373886d Add the non-immediate-shift vector builtins
llvm-svn: 50870
2008-05-08 21:51:12 +00:00
Ted Kremenek 0ae11a6f2e Added initial support for supporting __NSString__ in attribute "format".
Still need to iron out some of the semantics (fixmes are present).
This addresses <rdar://problem/5916348>

llvm-svn: 50866
2008-05-08 19:43:35 +00:00
Ted Kremenek 27a4ba66fd Updated Xcode project.
llvm-svn: 50864
2008-05-08 19:20:24 +00:00
Steve Naroff b1c02371cd Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50862
2008-05-08 17:52:16 +00:00
Sanjiv Gupta 15cb669039 Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.
llvm-svn: 50848
2008-05-08 08:54:20 +00:00
Sanjiv Gupta cd13ef01a2 Remove the ending "." from clang options descriptions.
llvm-svn: 50847
2008-05-08 08:28:14 +00:00
Chris Lattner 3c04ff00c2 start implementation of a macro rewriter, this is currently just stubbed out.
llvm-svn: 50845
2008-05-08 06:52:13 +00:00
Chris Lattner b781dc79aa Add basic support for the pic-* target triples and add support for
targets that do not support recursion (and thus codegen stack variables
as globals).

Patch contributed by Alireza Moshtaghi!

llvm-svn: 50844
2008-05-08 05:58:21 +00:00
Chris Lattner d330036c06 The awesome GNU "comma elision extension" works with both the standard
__VA_ARGS__ syntax as well as with the amazingly awesome GNU "named 
variadic macro" extension.  Allow it with the GNU syntax as well.

llvm-svn: 50843
2008-05-08 05:10:33 +00:00
Chris Lattner 2b88c1e4c4 Fix rdar://5919567: assertion failure: split didn't occur before erase!
llvm-svn: 50839
2008-05-08 03:23:46 +00:00
Devang Patel ac25fc6f2e Begin handling union bitfields.
Note, this is just beginning.

llvm-svn: 50835
2008-05-07 22:28:29 +00:00
Steve Naroff 30ac2225ee Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
llvm-svn: 50832
2008-05-07 21:23:49 +00:00
Ted Kremenek bcdb46830b Added support for "drain".
llvm-svn: 50831
2008-05-07 21:17:39 +00:00
Fariborz Jahanian 8983f17ba0 Synthesized getter/setter method declarations need not have
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.

llvm-svn: 50830
2008-05-07 20:53:44 +00:00
Ted Kremenek f958ec50c0 Expand the CF retain checker to allow the Create/Get rule to apply to any
function that returns a CFxxxRef, not just functions whose name begins with
CF.  This implements <rdar://problem/5917879>.

Added test case for this feature.

Updated calls to CStrInCStrNoCase to swap their arguments, per compatibility
with strcasestr.

llvm-svn: 50829
2008-05-07 20:06:41 +00:00
Ted Kremenek fcf060fd2f Flip order of arguments to CStrInStrNoCase.
llvm-svn: 50824
2008-05-07 18:57:30 +00:00
Ted Kremenek b6cbf28d82 Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not portable.
Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition.

llvm-svn: 50822
2008-05-07 18:36:45 +00:00
Fariborz Jahanian ec6e4c8096 This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.

llvm-svn: 50818
2008-05-07 17:43:59 +00:00
Ted Kremenek 89bd0fc27d copy-paste: NS types are not typedefs.
llvm-svn: 50817
2008-05-07 17:35:41 +00:00
Steve Naroff 456c0f6738 Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.
llvm-svn: 50816
2008-05-07 17:35:03 +00:00
Steve Naroff 6eda39c345 Fix off-by-one error.
llvm-svn: 50815
2008-05-07 16:50:14 +00:00
Ted Kremenek 7bf9dc773c Do not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" from NSObject as allocators.
llvm-svn: 50802
2008-05-07 05:34:45 +00:00
Douglas Gregor caa8acebe7 Diagnose attempts to use C++ default arguments outside of a function declaration
llvm-svn: 50799
2008-05-07 04:49:29 +00:00
Ted Kremenek 9930bd8c4f Be less promiscuous with generating summaries for "new", "copy", "create".
llvm-svn: 50798
2008-05-07 04:25:59 +00:00
Ted Kremenek 08eb30f193 Added auto-summary generation for createXXX, copyXXX, newXXX methods.
llvm-svn: 50795
2008-05-07 03:45:05 +00:00
Steve Naroff cab93d58c3 Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end
llvm-svn: 50790
2008-05-07 00:06:16 +00:00
Ted Kremenek b95635e6ec Fix a few glitches in scan-build with automatically generating class names from bug types.
llvm-svn: 50784
2008-05-06 23:51:45 +00:00
Ted Kremenek e6d2419351 Improve HTMLDiagnostics by understanding the "Below" hint.
llvm-svn: 50783
2008-05-06 23:42:18 +00:00
Steve Naroff 29ce4e5d78 Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50781
2008-05-06 23:20:07 +00:00
Fariborz Jahanian eeb7fae063 Print ObjC methods of ObjC classes.
llvm-svn: 50779
2008-05-06 23:14:25 +00:00
Ted Kremenek aec1811c6c Don't report leaks for autoreleased objects.
llvm-svn: 50777
2008-05-06 23:07:13 +00:00
Steve Naroff ac81a5aad5 Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead of putting them in the preamble?
llvm-svn: 50774
2008-05-06 22:45:19 +00:00
Ted Kremenek aa63ca9272 Added "DisplayHint" to PathDiagnosticPiece to provide a hint for the
PathDiagnosticClient of where to display a string (beyond just the SourceLocation).

llvm-svn: 50773
2008-05-06 21:33:07 +00:00
Ted Kremenek 767d0742c7 More comments.
"#if 0" out some assumptions when auto-generating method summaries.

llvm-svn: 50772
2008-05-06 21:26:51 +00:00
Devang Patel 243d5cd283 Fix PR2101 - Codegen crash during bitfield initialization.
llvm-svn: 50769
2008-05-06 19:57:59 +00:00
Steve Naroff 13e74879b0 Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice when two interfaces use it in same file
llvm-svn: 50767
2008-05-06 18:26:51 +00:00
Fariborz Jahanian 6a70e2019b Test was accidently nullified in previous check-in.
llvm-svn: 50758
2008-05-06 18:14:26 +00:00
Ted Kremenek 10427bdbb9 Experiment with not converting bug names to lower case.
llvm-svn: 50753
2008-05-06 18:11:36 +00:00
Ted Kremenek 8bcc1bd3d5 More refactorings in GeneratePathDiagnostic: use ExecutionContinues to display
"Execution continues..." message, which does a better job at handling corner cases.

llvm-svn: 50751
2008-05-06 18:11:09 +00:00
Fariborz Jahanian 09367d68ff Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.

llvm-svn: 50747
2008-05-06 18:09:04 +00:00
Ted Kremenek cb2e636606 Generate "stop" summaries for selectors involving receivers whose type is not NSxxxx.
llvm-svn: 50721
2008-05-06 15:44:25 +00:00
Ted Kremenek 68f463b88e Use strncmp correctly.
llvm-svn: 50715
2008-05-06 06:17:42 +00:00
Ted Kremenek 5f478e9a0a Make string comparison legible and remove buffer overrun introduced by typo.
llvm-svn: 50714
2008-05-06 06:09:09 +00:00
Ted Kremenek 2f08fedec1 String comparison cleanups.
Added test case.

llvm-svn: 50711
2008-05-06 04:28:05 +00:00
Ted Kremenek 041d02201f Fix logic error in string processing.
llvm-svn: 50710
2008-05-06 04:21:38 +00:00
Ted Kremenek c9f4948bba Remove assertion.
llvm-svn: 50709
2008-05-06 04:21:10 +00:00
Ted Kremenek 015c3561ad Use EvalSummary to process message expressions, thereby unifying the checker
logic for function calls and message expressions.

Use the following heuristic to infer "allocating" instance methods:

  [ClassName classWithXXX]  allocates an object
  
Update testcase to reflect this heuristic.

llvm-svn: 50708
2008-05-06 04:20:12 +00:00
Ted Kremenek bc51f71c5b Fixed subtle bug in the an GRAuditor object could mark a node as a sink
after it was already added to the destination NodeSet.

llvm-svn: 50701
2008-05-06 03:26:52 +00:00
Ted Kremenek 821537ecdb Added receiver effects to EvalSummary.
llvm-svn: 50700
2008-05-06 02:41:27 +00:00
Ted Kremenek b0862dca6c Expand summaries to include "Receiver" effects.
llvm-svn: 50697
2008-05-06 02:26:56 +00:00
Chris Lattner dbcc2ca6b2 simplify some builder calls.
llvm-svn: 50694
2008-05-06 00:56:42 +00:00
Chris Lattner 222c6123df remove a stray printout
llvm-svn: 50691
2008-05-06 00:44:00 +00:00
Ted Kremenek be7c56ed78 Added initialization code to generate initial set of ObjC method summaries (non-instance methods).
llvm-svn: 50690
2008-05-06 00:38:54 +00:00
Ted Kremenek 0806f910d4 Added code to generate initial set of summaries for instance methods.
llvm-svn: 50689
2008-05-06 00:30:21 +00:00
Steve Naroff 125d73dc84 Several fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests). Expect to enable it very soon.
llvm-svn: 50688
2008-05-06 00:23:44 +00:00
Ted Kremenek 3d1e972275 Add summary generation for "initXXX" methods.
llvm-svn: 50684
2008-05-05 23:55:01 +00:00
Ted Kremenek 046845e842 Make CF retain diagnostics more succinct.
In a leak's "name", indicate GC or non-GC bugs.

llvm-svn: 50680
2008-05-05 23:16:31 +00:00
Ted Kremenek f15cd14a3d Emit dead store warnings for ++ and -- operators.
llvm-svn: 50679
2008-05-05 23:12:21 +00:00
Chris Lattner 4dd2710222 Fix rdar://5905347 a crash on invalid builtin, due to the
params not getting installed for builtins when synthesized.

llvm-svn: 50676
2008-05-05 22:18:14 +00:00
Ted Kremenek 00daccdd2a Initial work on refactoring the CFRefCount checker so that it is more
generic and handles reference counts for NSObjects.

llvm-svn: 50674
2008-05-05 22:11:16 +00:00
Chris Lattner 00e2607de2 Add support for -Wimplicit-function-declaration, rdar://5907433
llvm-svn: 50672
2008-05-05 21:18:06 +00:00
Chris Lattner ca2b318233 Fix typo, improve comment.
llvm-svn: 50666
2008-05-05 20:09:27 +00:00
Chris Lattner db65ff7223 Fix a few more bugs in preprocessor expressions w.r.t. ?:. Now I
think it is really right. :)  This fixes PR2284.

llvm-svn: 50665
2008-05-05 20:07:41 +00:00
Fariborz Jahanian 8d91686b0d percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.

llvm-svn: 50662
2008-05-05 18:51:55 +00:00
Ted Kremenek 627c3074dd Improve leak diagnostics to not report a leak on the same line where
the object was last used.  This can be confusing to users.

For example:

 // 'y' is leaked
x = foo(y);

instead:

x = foo(y);
  // 'y' is leaked

llvm-svn: 50661
2008-05-05 18:50:19 +00:00
Ted Kremenek 3917b82e85 Improved leak diagnostics.
llvm-svn: 50657
2008-05-05 17:53:17 +00:00
Ted Kremenek 875db81301 Minor refactorings/cleanups in CF retain checker and added support for NSMakeCollectable.
Added test case for NSMakeCollectable.

llvm-svn: 50653
2008-05-05 16:51:50 +00:00
Ted Kremenek db04a9e967 When reporting branch conditions that evaluate to an uninitialized value,
highlight the most nested subexpression that appears most responsible (giving
the user better diagnostic feedback).

Updated test cases to illustrate this feature.

Implements: <rdar://problem/5880443>
llvm-svn: 50647
2008-05-05 15:56:53 +00:00
Chris Lattner 7f5b4fcafa Fix a bug from when this was a pointer instead of vector.
llvm-svn: 50639
2008-05-05 07:03:40 +00:00
Chris Lattner 3565c8e343 Neil pointed out that clang doesn't generate ranges from diagnostics
related to pp-expressions.  Doing so is pretty simple and this
patch implements it, yielding nice diagnostics like:

t.c:2:7: error: division by zero in preprocessor expression
#if 1 / (0 + 0)
    ~ ^ ~~~~~~~
t.c:5:14: error: expected ')' in preprocessor expression
#if (412 + 42
     ~~~~~~~~^
t.c:5:5: error: to match this '('
#if (412 + 42
    ^
t.c:10:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574
#if (-42 + 0U) / -2
     ~~~ ^ ~~
t.c:10:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614
#if (-42 + 0U) / -2
    ~~~~~~~~~~ ^ ~~
5 diagnostics generated.

llvm-svn: 50638
2008-05-05 06:45:50 +00:00
Chris Lattner 3c57f7ebab fix a bug handling right associative operators that Neil noticed, hopefully
the final part of PR2279

llvm-svn: 50635
2008-05-05 04:10:51 +00:00
Chris Lattner de977c0a5c Fix PR2281: these two warnings should be promoted to error on
pedantic error.  Perhaps I should add a class of 'extension' that is
'extension that warns by default', which would be cleaner.

llvm-svn: 50633
2008-05-04 23:52:02 +00:00
Chris Lattner ca671b0e51 ||/&& do not do UAC's either. This silences a bogus warning on #if -1 || 4U.
llvm-svn: 50632
2008-05-04 23:46:17 +00:00
Chris Lattner 4af72c76dd Neil points out that commas don't do UACs either.
llvm-svn: 50631
2008-05-04 23:38:48 +00:00
Chris Lattner d89e458ce0 Fix the rest of PR2279:
a) correct rejection of ',' in pp expressions.
b) the precedence of ',' was wrong w.r.t. ?:.

Thanks again to Neil for finding these and providing testcases.

llvm-svn: 50625
2008-05-04 18:36:18 +00:00
Chris Lattner a08f869c22 Fix PR2279 part C: shifts don't perform the UACs, thanks to Neil
for pointing this out.

llvm-svn: 50624
2008-05-04 18:25:32 +00:00
Chris Lattner 1e151816b2 use simplified API for making fp constants.
llvm-svn: 50623
2008-05-04 18:23:51 +00:00
Chris Lattner 0a9718eab0 fix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).
llvm-svn: 50617
2008-05-04 07:15:21 +00:00
Chris Lattner 7b9293ba20 Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the 
DeclAttrs map.

llvm-svn: 50612
2008-05-04 02:29:49 +00:00
Chris Lattner bc22b5b327 if a decl is both 'static' and weak or static and inline, its linkage
type should be internal, not weak/linkonce.

llvm-svn: 50611
2008-05-04 01:44:26 +00:00
Chris Lattner cfcabaeb7f add testcase for pr2050 which is now fixed.
llvm-svn: 50610
2008-05-04 01:13:36 +00:00
Chris Lattner c8cb4ca202 improve array type comments.
llvm-svn: 50609
2008-05-04 01:11:46 +00:00
Chris Lattner 033352b036 add a testcase
llvm-svn: 50608
2008-05-04 00:56:25 +00:00
Ted Kremenek 1108d6eef3 Remove debugging statement.
llvm-svn: 50598
2008-05-02 23:40:49 +00:00
Ted Kremenek a5e2df015a Rename member variable.
llvm-svn: 50597
2008-05-02 23:21:21 +00:00
Ted Kremenek 5f56cbbf7d Output better paths to display in bug reports and compute a common
prefix for all files.

llvm-svn: 50592
2008-05-02 22:04:53 +00:00
Fariborz Jahanian 9964c9c64d Another test case for properties in protocols.
llvm-svn: 50589
2008-05-02 21:09:40 +00:00
Ted Kremenek 983be7cee6 Improved diagnostics for leaks: now we report which variable was leaked.
llvm-svn: 50588
2008-05-02 20:53:50 +00:00
Fariborz Jahanian 98a6c4fa77 This patch is about merging ObjC2's properties declared in class
protocols into class's property list and performing semantics
on them for while doing so.

llvm-svn: 50587
2008-05-02 19:17:30 +00:00
Ted Kremenek 3b33e2544a Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.
llvm-svn: 50585
2008-05-02 18:40:22 +00:00
Ted Kremenek 789942cfda When running the reference count checker twice (GC and non-GC mode), only emit
basic warnings (dead stores, null dereferences) on the first pass.

llvm-svn: 50584
2008-05-02 18:01:49 +00:00
Ted Kremenek a06e7120bb Bug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic methods (also did some cosmetic cleanups in the printing output).
llvm-svn: 50583
2008-05-02 17:32:38 +00:00
Ted Kremenek 86237c3774 testcase cleanup
llvm-svn: 50581
2008-05-02 17:14:07 +00:00
Ted Kremenek 5102a25bf8 Static analysis test case for noreturn on exceptions.
llvm-svn: 50580
2008-05-02 17:13:14 +00:00
Ted Kremenek bb7386aff5 Really noreturn on exceptions.
llvm-svn: 50579
2008-05-02 17:12:56 +00:00
Ted Kremenek 0a87d5a0b3 Lexicographically order enum declarations in AttributeList::Kind.
llvm-svn: 50577
2008-05-02 16:50:46 +00:00
Ted Kremenek 63d76df236 Fix copy-paste bug.
llvm-svn: 50557
2008-05-01 23:38:35 +00:00
Ted Kremenek 2722f36465 Remove no longer valid assertion.
llvm-svn: 50556
2008-05-01 23:28:56 +00:00
Ted Kremenek 1097b4c61f Added line number diagnostics to indicate the allocation site of the leaked object.
llvm-svn: 50553
2008-05-01 23:13:35 +00:00
Ted Kremenek fabfb4677d Do not highlight bogus ranges for leaks.
llvm-svn: 50549
2008-05-01 22:50:36 +00:00
Steve Naroff f8ecff2a94 Replace Sema::CheckInitializerListTypes() with a helper class (InitListChecker) that synthesizes implicit InitListExpr's when appropriate (see InitListExpr comments in Expr.h for more details). I also moved the code to SemaInit.cpp, to help reduce clutter in SemaDecl.cpp.
NOTE: This work is incomplete and still fails many tests (as a result, it isn't enabled yet). Nevertheless, I wanted to check it in so I can work on it from home.
llvm-svn: 50544
2008-05-01 22:18:59 +00:00
Argyrios Kyrtzidis 2be96ae68b Convert CRLF to LF.
llvm-svn: 50542
2008-05-01 21:44:34 +00:00
Ted Kremenek 8a56b06b5c Correctly invalidate reference count state when passing objects by reference in message expressions we don't understand.
llvm-svn: 50541
2008-05-01 21:31:50 +00:00
Ted Kremenek 4f3d7cd12e Add missing "-" that prefix arguments to forward to clang.
llvm-svn: 50540
2008-05-01 21:26:22 +00:00
Argyrios Kyrtzidis 694dda1e4e Implicitly defined functions were getting the DeclContext of the function where they appeared, causing the bug: http://llvm.org/bugs/show_bug.cgi?id=2266.
Fix it by making implicitly defined functions get the DeclContext of translation unit.

llvm-svn: 50538
2008-05-01 21:04:16 +00:00
Ted Kremenek 7f824734e0 Added temporary fix for Obj-C exception handling in the static analyzer: treat these as panic functions.
llvm-svn: 50535
2008-05-01 18:33:28 +00:00
Ted Kremenek 88f8ebdf76 Added default ctor to Selector.
REASON: Without a default ctor we cannot do "new Selector[xxx]" and similar
operations with ADTs that need to default constructor selectors.

llvm-svn: 50534
2008-05-01 18:32:59 +00:00
Ted Kremenek f0b0f2edfe Renamed static method.
llvm-svn: 50533
2008-05-01 18:31:44 +00:00
Fariborz Jahanian f303bdabdf Patch to match and issue diagnostics on property type mismatch.
llvm-svn: 50532
2008-05-01 18:05:01 +00:00
Ted Kremenek b99d01269a Added __assert_rtn to list of panic functions.
llvm-svn: 50530
2008-05-01 17:52:49 +00:00
Ted Kremenek b8861a6ccf Use pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields". This saves us a pointer.
Implemented serialization for ObjCMessageExpr.

llvm-svn: 50528
2008-05-01 17:26:20 +00:00
Ted Kremenek ed36e4b9a4 Added ziperr as a panic function. Eventually inter-procedural analysis
should catch this one easily.

llvm-svn: 50526
2008-05-01 15:55:59 +00:00
Ted Kremenek aec2b6e360 Added comments to ObjCMessageExpr.
llvm-svn: 50525
2008-05-01 15:55:24 +00:00
Ted Kremenek 9f696852c4 When processing "release", "retain", and "autorelease" messages return the
lval passed as an argument.

Fix: Inverted diagnostic messages.
llvm-svn: 50513
2008-05-01 04:02:04 +00:00
Ted Kremenek 4828aa3152 Added support for "autorelease" message in CF ref. count checker.
llvm-svn: 50512
2008-05-01 02:18:37 +00:00
Steve Naroff 20348b5653 Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initializer rewrite I am doing).
llvm-svn: 50511
2008-05-01 02:04:18 +00:00
Fariborz Jahanian 7cf18862c2 More ObjC2 property semantics work. Work in progress.
llvm-svn: 50508
2008-05-01 00:03:38 +00:00
Ted Kremenek b0f87c48cb added preliminary diagnostics in scan-build results to denote whether
a CF memory leak occurred with GC enabled, etc.

llvm-svn: 50507
2008-04-30 23:47:44 +00:00
Ted Kremenek 0ae9ed7fab scan-build: Disable distributed builds for xcodebuild
llvm-svn: 50506
2008-04-30 23:47:12 +00:00
Ted Kremenek f20e2285c9 More cleanups with ObjCQualifiedIdType in the static analyzer.
llvm-svn: 50503
2008-04-30 22:48:21 +00:00
Ted Kremenek a16dacb6aa Add placeholder code in the static analyzer for MemberExprs involving struct temporaries.
llvm-svn: 50502
2008-04-30 22:17:15 +00:00
Ted Kremenek ca67cab1e8 Add workaround for __builtin_offsetof in the static analyzer.
llvm-svn: 50500
2008-04-30 21:45:55 +00:00
Ted Kremenek 99057462aa Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof of a ObjCInterfaceType.
llvm-svn: 50499
2008-04-30 21:31:12 +00:00
Ted Kremenek e0e8b535cf Support implicit casts from pointers to references.
llvm-svn: 50498
2008-04-30 21:10:19 +00:00
Ted Kremenek 84dea154fc When creating LVals for array entries, canonicalize entries with a 0 index.
llvm-svn: 50497
2008-04-30 21:05:35 +00:00
Ted Kremenek 20d8006e93 Teach more of the static analyzer about ObjCQualifiedIdType.
llvm-svn: 50494
2008-04-30 20:17:27 +00:00
Ted Kremenek 0940b99e3b Teach the static analysis engine about ObjCQualifiedIdType.
llvm-svn: 50493
2008-04-30 20:01:29 +00:00
Ted Kremenek 5ce35cc514 Add conjured symbols for decl initializations.
Add db_error as panic function.

llvm-svn: 50489
2008-04-30 17:54:04 +00:00
Ted Kremenek 39a736f723 Handle lval::ArrayOffset and lval::FieldOffset in EvalNE and EvalEQ.
llvm-svn: 50486
2008-04-30 16:07:22 +00:00
Chris Lattner dd477ce32b Verify the whole module after codegen to catch silly IR bugs.
llvm-svn: 50485
2008-04-30 16:05:42 +00:00
Chris Lattner e16406d2b1 fix 'var unused' warning.
llvm-svn: 50484
2008-04-30 16:04:01 +00:00
Ted Kremenek 772d9f0aae Added test case for the static analyzer.
llvm-svn: 50467
2008-04-30 04:40:48 +00:00
Ted Kremenek 5cc9e60a5f Invalidate old subexpression bindings when binding UnknownVal.
llvm-svn: 50466
2008-04-30 04:23:07 +00:00
Ted Kremenek 9700bd42f0 Simplify RemoveDeadBindings.
llvm-svn: 50458
2008-04-29 23:58:03 +00:00
Ted Kremenek 10bad41159 Added test case to test null dereference checking with lval::ArrayOffset.
llvm-svn: 50454
2008-04-29 23:25:09 +00:00
Ted Kremenek 10246e8bfa Add lval::ArrayOffset, which represent the locations of entries in an array.
llvm-svn: 50453
2008-04-29 23:24:44 +00:00
Fariborz Jahanian 2dfcec129f Default visbility for instance variables is protected.
Patch by Emerson Murhpy-Hill.

llvm-svn: 50452
2008-04-29 23:03:51 +00:00
Ted Kremenek 0d2ccffa83 Added lval::FieldOffset, which represents symbolic lvalues for field offsets from other Lvalues.
This removes the failure in null-deref-ps.c (test suite).

llvm-svn: 50449
2008-04-29 22:17:41 +00:00
Ted Kremenek fa5a3d0fe7 Major rewrite/refactoring of static analysis engine. We now use
EvalStore/EvalLoad to handle all loads/stores from symbolic memory, allowing us
to do checks for null dereferences, etc., at any arbitrary load/store (these
were missed checks before). This also resulted in some major cleanups, some
conceptual, and others just in the structure of the code.

This temporarily introduces a regression in the test suite (null-deref-ps.c)
before I add a new LVal type for structure fields.

llvm-svn: 50443
2008-04-29 21:04:26 +00:00
Ted Kremenek a8197366db Pass fobjc-gc-only and fobjc-gc options down to clang.
llvm-svn: 50426
2008-04-29 16:24:23 +00:00
Ted Kremenek a374ea9a35 Update typestate logic to support GC-mode.
llvm-svn: 50396
2008-04-29 05:44:10 +00:00
Ted Kremenek 4b7ca776cf Implement semantics of CFMakeCollectable for the CF-reference count checker.
llvm-svn: 50395
2008-04-29 05:33:51 +00:00
Ted Kremenek 4d1f422c6f Provide the option to run the CF-retain checker in GC enabled mode.
The transfer functions for the checker don't do anything special yet in GC mode.

llvm-svn: 50394
2008-04-29 05:13:59 +00:00
Ted Kremenek 25a3b878e5 Convert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
llvm-svn: 50388
2008-04-29 04:43:50 +00:00
Ted Kremenek d796c18d7b Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.

llvm-svn: 50387
2008-04-29 04:37:03 +00:00
Ted Kremenek 6065ef6b9b Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.

Fixes: <rdar://problem/5892265>
llvm-svn: 50364
2008-04-28 18:00:46 +00:00
Argyrios Kyrtzidis 8eab584388 Call ExitScope before ActOnFinishNamespaceDef.
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope.

llvm-svn: 50322
2008-04-27 14:10:57 +00:00