]>
granicus.if.org Git - clang/log
Ted Kremenek [Tue, 6 May 2008 02:41:27 +0000 (02:41 +0000)]
Added receiver effects to EvalSummary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50700
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 6 May 2008 02:26:56 +0000 (02:26 +0000)]
Expand summaries to include "Receiver" effects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50697
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 6 May 2008 00:56:42 +0000 (00:56 +0000)]
simplify some builder calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50694
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 6 May 2008 00:44:00 +0000 (00:44 +0000)]
remove a stray printout
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50691
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 6 May 2008 00:38:54 +0000 (00:38 +0000)]
Added initialization code to generate initial set of ObjC method summaries (non-instance methods).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50690
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 6 May 2008 00:30:21 +0000 (00:30 +0000)]
Added code to generate initial set of summaries for instance methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50689
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Tue, 6 May 2008 00:23:44 +0000 (00:23 +0000)]
Several fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests). Expect to enable it very soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50688
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 23:55:01 +0000 (23:55 +0000)]
Add summary generation for "initXXX" methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50684
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 23:16:31 +0000 (23:16 +0000)]
Make CF retain diagnostics more succinct.
In a leak's "name", indicate GC or non-GC bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50680
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 23:12:21 +0000 (23:12 +0000)]
Emit dead store warnings for ++ and -- operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50679
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 22:18:14 +0000 (22:18 +0000)]
Fix rdar://
5905347 a crash on invalid builtin, due to the
params not getting installed for builtins when synthesized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50676
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 22:11:16 +0000 (22:11 +0000)]
Initial work on refactoring the CFRefCount checker so that it is more
generic and handles reference counts for NSObjects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50674
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 21:18:06 +0000 (21:18 +0000)]
Add support for -Wimplicit-function-declaration, rdar://
5907433
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50672
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 20:09:27 +0000 (20:09 +0000)]
Fix typo, improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50666
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 20:07:41 +0000 (20:07 +0000)]
Fix a few more bugs in preprocessor expressions w.r.t. ?:. Now I
think it is really right. :) This fixes PR2284.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50665
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 5 May 2008 18:51:55 +0000 (18:51 +0000)]
percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50662
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 18:50:19 +0000 (18:50 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50661
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 17:53:17 +0000 (17:53 +0000)]
Improved leak diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50657
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 16:51:50 +0000 (16:51 +0000)]
Minor refactorings/cleanups in CF retain checker and added support for NSMakeCollectable.
Added test case for NSMakeCollectable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50653
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 5 May 2008 15:56:53 +0000 (15:56 +0000)]
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 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50647
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 07:03:40 +0000 (07:03 +0000)]
Fix a bug from when this was a pointer instead of vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50639
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 06:45:50 +0000 (06:45 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50638
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 5 May 2008 04:10:51 +0000 (04:10 +0000)]
fix a bug handling right associative operators that Neil noticed, hopefully
the final part of PR2279
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50635
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 23:52:02 +0000 (23:52 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50633
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 23:46:17 +0000 (23:46 +0000)]
||/&& do not do UAC's either. This silences a bogus warning on #if -1 || 4U.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50632
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 23:38:48 +0000 (23:38 +0000)]
Neil points out that commas don't do UACs either.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50631
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 18:36:18 +0000 (18:36 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50625
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 18:25:32 +0000 (18:25 +0000)]
Fix PR2279 part C: shifts don't perform the UACs, thanks to Neil
for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50624
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 18:23:51 +0000 (18:23 +0000)]
use simplified API for making fp constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50623
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 07:15:21 +0000 (07:15 +0000)]
fix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50617
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 02:29:49 +0000 (02:29 +0000)]
Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the
DeclAttrs map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50612
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 01:44:26 +0000 (01:44 +0000)]
if a decl is both 'static' and weak or static and inline, its linkage
type should be internal, not weak/linkonce.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50611
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 01:13:36 +0000 (01:13 +0000)]
add testcase for pr2050 which is now fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50610
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 01:11:46 +0000 (01:11 +0000)]
improve array type comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50609
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 4 May 2008 00:56:25 +0000 (00:56 +0000)]
add a testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50608
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 23:40:49 +0000 (23:40 +0000)]
Remove debugging statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50598
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 23:21:21 +0000 (23:21 +0000)]
Rename member variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50597
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 22:04:53 +0000 (22:04 +0000)]
Output better paths to display in bug reports and compute a common
prefix for all files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50592
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 2 May 2008 21:09:40 +0000 (21:09 +0000)]
Another test case for properties in protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50589
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 20:53:50 +0000 (20:53 +0000)]
Improved diagnostics for leaks: now we report which variable was leaked.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50588
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 2 May 2008 19:17:30 +0000 (19:17 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50587
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 18:40:22 +0000 (18:40 +0000)]
Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50585
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 18:01:49 +0000 (18:01 +0000)]
When running the reference count checker twice (GC and non-GC mode), only emit
basic warnings (dead stores, null dereferences) on the first pass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50584
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 17:32:38 +0000 (17:32 +0000)]
Bug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic methods (also did some cosmetic cleanups in the printing output).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50583
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 17:14:07 +0000 (17:14 +0000)]
testcase cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50581
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 17:13:14 +0000 (17:13 +0000)]
Static analysis test case for noreturn on exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50580
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 17:12:56 +0000 (17:12 +0000)]
Really noreturn on exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50579
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 2 May 2008 16:50:46 +0000 (16:50 +0000)]
Lexicographically order enum declarations in AttributeList::Kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50577
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 23:38:35 +0000 (23:38 +0000)]
Fix copy-paste bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50557
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 23:28:56 +0000 (23:28 +0000)]
Remove no longer valid assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50556
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 23:13:35 +0000 (23:13 +0000)]
Added line number diagnostics to indicate the allocation site of the leaked object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50553
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 22:50:36 +0000 (22:50 +0000)]
Do not highlight bogus ranges for leaks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50549
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 1 May 2008 22:18:59 +0000 (22:18 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50544
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 1 May 2008 21:44:34 +0000 (21:44 +0000)]
Convert CRLF to LF.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50542
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 21:31:50 +0000 (21:31 +0000)]
Correctly invalidate reference count state when passing objects by reference in message expressions we don't understand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50541
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 21:26:22 +0000 (21:26 +0000)]
Add missing "-" that prefix arguments to forward to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50540
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 1 May 2008 21:04:16 +0000 (21:04 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50538
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 18:33:28 +0000 (18:33 +0000)]
Added temporary fix for Obj-C exception handling in the static analyzer: treat these as panic functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50535
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 18:32:59 +0000 (18:32 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50534
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 18:31:44 +0000 (18:31 +0000)]
Renamed static method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50533
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 1 May 2008 18:05:01 +0000 (18:05 +0000)]
Patch to match and issue diagnostics on property type mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50532
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 17:52:49 +0000 (17:52 +0000)]
Added __assert_rtn to list of panic functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50530
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 17:26:20 +0000 (17:26 +0000)]
Use pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields". This saves us a pointer.
Implemented serialization for ObjCMessageExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50528
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 15:55:59 +0000 (15:55 +0000)]
Added ziperr as a panic function. Eventually inter-procedural analysis
should catch this one easily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50526
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 15:55:24 +0000 (15:55 +0000)]
Added comments to ObjCMessageExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50525
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 04:02:04 +0000 (04:02 +0000)]
When processing "release", "retain", and "autorelease" messages return the
lval passed as an argument.
Fix: Inverted diagnostic messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50513
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 1 May 2008 02:18:37 +0000 (02:18 +0000)]
Added support for "autorelease" message in CF ref. count checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50512
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 1 May 2008 02:04:18 +0000 (02:04 +0000)]
Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initializer rewrite I am doing).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50511
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 1 May 2008 00:03:38 +0000 (00:03 +0000)]
More ObjC2 property semantics work. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50508
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 23:47:44 +0000 (23:47 +0000)]
added preliminary diagnostics in scan-build results to denote whether
a CF memory leak occurred with GC enabled, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50507
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 23:47:12 +0000 (23:47 +0000)]
scan-build: Disable distributed builds for xcodebuild
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50506
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 22:48:21 +0000 (22:48 +0000)]
More cleanups with ObjCQualifiedIdType in the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50503
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 22:17:15 +0000 (22:17 +0000)]
Add placeholder code in the static analyzer for MemberExprs involving struct temporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50502
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 21:45:55 +0000 (21:45 +0000)]
Add workaround for __builtin_offsetof in the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50500
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 21:31:12 +0000 (21:31 +0000)]
Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof of a ObjCInterfaceType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50499
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 21:10:19 +0000 (21:10 +0000)]
Support implicit casts from pointers to references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50498
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 21:05:35 +0000 (21:05 +0000)]
When creating LVals for array entries, canonicalize entries with a 0 index.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50497
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 20:17:27 +0000 (20:17 +0000)]
Teach more of the static analyzer about ObjCQualifiedIdType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50494
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 20:01:29 +0000 (20:01 +0000)]
Teach the static analysis engine about ObjCQualifiedIdType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50493
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 17:54:04 +0000 (17:54 +0000)]
Add conjured symbols for decl initializations.
Add db_error as panic function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50489
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 16:07:22 +0000 (16:07 +0000)]
Handle lval::ArrayOffset and lval::FieldOffset in EvalNE and EvalEQ.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50486
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 30 Apr 2008 16:05:42 +0000 (16:05 +0000)]
Verify the whole module after codegen to catch silly IR bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50485
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 30 Apr 2008 16:04:01 +0000 (16:04 +0000)]
fix 'var unused' warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50484
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 04:40:48 +0000 (04:40 +0000)]
Added test case for the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50467
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 30 Apr 2008 04:23:07 +0000 (04:23 +0000)]
Invalidate old subexpression bindings when binding UnknownVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50466
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 23:58:03 +0000 (23:58 +0000)]
Simplify RemoveDeadBindings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50458
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 23:25:09 +0000 (23:25 +0000)]
Added test case to test null dereference checking with lval::ArrayOffset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50454
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 23:24:44 +0000 (23:24 +0000)]
Add lval::ArrayOffset, which represent the locations of entries in an array.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50453
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 29 Apr 2008 23:03:51 +0000 (23:03 +0000)]
Default visbility for instance variables is protected.
Patch by Emerson Murhpy-Hill.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50452
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 22:17:41 +0000 (22:17 +0000)]
Added lval::FieldOffset, which represents symbolic lvalues for field offsets from other Lvalues.
This removes the failure in null-deref-ps.c (test suite).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50449
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 21:04:26 +0000 (21:04 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50443
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 16:24:23 +0000 (16:24 +0000)]
Pass fobjc-gc-only and fobjc-gc options down to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50426
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 05:44:10 +0000 (05:44 +0000)]
Update typestate logic to support GC-mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50396
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 05:33:51 +0000 (05:33 +0000)]
Implement semantics of CFMakeCollectable for the CF-reference count checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50395
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 05:13:59 +0000 (05:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50394
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 04:43:50 +0000 (04:43 +0000)]
Convert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50388
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 29 Apr 2008 04:37:03 +0000 (04:37 +0000)]
Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50387
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 28 Apr 2008 18:00:46 +0000 (18:00 +0000)]
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>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50364
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sun, 27 Apr 2008 14:10:57 +0000 (14:10 +0000)]
Call ExitScope before ActOnFinishNamespaceDef.
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50322
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sun, 27 Apr 2008 13:50:30 +0000 (13:50 +0000)]
Parsing of namespaces:
-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.
This commit doesn't implement proper name lookup for namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321
91177308 -0d34-0410-b5e6-
96231b3b80d8