]> granicus.if.org Git - clang/log
clang
16 years agoAnother test case for properties in protocols.
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

16 years agoImproved diagnostics for leaks: now we report which variable was leaked.
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

16 years agoThis patch is about merging ObjC2's properties declared in class
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

16 years agoFixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.
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

16 years agoWhen running the reference count checker twice (GC and non-GC mode), only emit
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

16 years agoBug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic...
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

16 years agotestcase cleanup
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

16 years agoStatic analysis test case for noreturn on exceptions.
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

16 years agoReally noreturn on exceptions.
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

16 years agoLexicographically order enum declarations in AttributeList::Kind.
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

16 years agoFix copy-paste bug.
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

16 years agoRemove no longer valid assertion.
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

16 years agoAdded line number diagnostics to indicate the allocation site of the leaked object.
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

16 years agoDo not highlight bogus ranges for leaks.
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

16 years agoReplace Sema::CheckInitializerListTypes() with a helper class (InitListChecker) that...
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

16 years agoConvert CRLF to LF.
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

16 years agoCorrectly invalidate reference count state when passing objects by reference in messa...
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

16 years agoAdd missing "-" that prefix arguments to forward to clang.
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

16 years agoImplicitly defined functions were getting the DeclContext of the function where they...
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

16 years agoAdded temporary fix for Obj-C exception handling in the static analyzer: treat these...
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

16 years agoAdded default ctor to Selector.
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

16 years agoRenamed static method.
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

16 years agoPatch to match and issue diagnostics on property type mismatch.
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

16 years agoAdded __assert_rtn to list of panic functions.
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

16 years agoUse pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields...
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

16 years agoAdded ziperr as a panic function. Eventually inter-procedural analysis
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

16 years agoAdded comments to ObjCMessageExpr.
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

16 years agoWhen processing "release", "retain", and "autorelease" messages return the
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

16 years agoAdded support for "autorelease" message in CF ref. count checker.
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

16 years agoExtend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initi...
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

16 years agoMore ObjC2 property semantics work. Work in progress.
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

16 years agoadded preliminary diagnostics in scan-build results to denote whether
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

16 years agoscan-build: Disable distributed builds for xcodebuild
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

16 years agoMore cleanups with ObjCQualifiedIdType in the static analyzer.
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

16 years agoAdd placeholder code in the static analyzer for MemberExprs involving struct temporaries.
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

16 years agoAdd workaround for __builtin_offsetof in the static analyzer.
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

16 years agoProvide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof...
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

16 years agoSupport implicit casts from pointers to references.
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

16 years agoWhen creating LVals for array entries, canonicalize entries with a 0 index.
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

16 years agoTeach more of the static analyzer about ObjCQualifiedIdType.
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

16 years agoTeach the static analysis engine about ObjCQualifiedIdType.
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

16 years agoAdd conjured symbols for decl initializations.
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

16 years agoHandle lval::ArrayOffset and lval::FieldOffset in EvalNE and EvalEQ.
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

16 years agoVerify the whole module after codegen to catch silly IR bugs.
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

16 years agofix 'var unused' warning.
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

16 years agoAdded test case for the static analyzer.
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

16 years agoInvalidate old subexpression bindings when binding UnknownVal.
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

16 years agoSimplify RemoveDeadBindings.
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

16 years agoAdded test case to test null dereference checking with lval::ArrayOffset.
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

16 years agoAdd lval::ArrayOffset, which represent the locations of entries in an array.
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

16 years agoDefault visbility for instance variables is protected.
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

16 years agoAdded lval::FieldOffset, which represents symbolic lvalues for field offsets from...
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

16 years agoMajor rewrite/refactoring of static analysis engine. We now use
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

16 years agoPass fobjc-gc-only and fobjc-gc options down to clang.
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

16 years agoUpdate typestate logic to support GC-mode.
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

16 years agoImplement semantics of CFMakeCollectable for the CF-reference count checker.
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

16 years agoProvide the option to run the CF-retain checker in GC enabled mode.
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

16 years agoConvert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
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

16 years agoAdd -fobjc-gc and -fobjc-gc-only options to the driver.
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

16 years agoBug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
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

16 years agoCall ExitScope before ActOnFinishNamespaceDef.
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

16 years agoParsing of namespaces:
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

16 years agoUse PushOnScopeChains to introduce a decl into scope.
Argyrios Kyrtzidis [Sun, 27 Apr 2008 13:30:35 +0000 (13:30 +0000)]
Use PushOnScopeChains to introduce a decl into scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50320 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake assertions for all addresses passed to ProgramPoint that they have at least...
Argyrios Kyrtzidis [Sat, 26 Apr 2008 15:19:51 +0000 (15:19 +0000)]
Make assertions for all addresses passed to ProgramPoint that they have at least an 8-byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50310 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPass down more -iXXX options that clang supports
Ted Kremenek [Fri, 25 Apr 2008 21:28:20 +0000 (21:28 +0000)]
Pass down more -iXXX options that clang supports

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50304 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix broken tag
Ted Kremenek [Fri, 25 Apr 2008 20:31:58 +0000 (20:31 +0000)]
fix broken tag

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50299 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother link fix.
Ted Kremenek [Fri, 25 Apr 2008 20:30:34 +0000 (20:30 +0000)]
Another link fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50298 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix links.
Ted Kremenek [Fri, 25 Apr 2008 20:29:37 +0000 (20:29 +0000)]
Fix links.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50297 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix bug in BugReporter where we didn't handle emitting diagnostics for
Ted Kremenek [Fri, 25 Apr 2008 19:01:27 +0000 (19:01 +0000)]
Fix bug in BugReporter where we didn't handle emitting diagnostics for
empty CFGBlocks that only contained a terminator.

Added improved diagnostics for break and continue statements and default branches in switch statements.

This fixes <rdar://problem/5889244>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50286 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded some notes about the LLVM "checker". This isn't a public link yet; still refining.
Ted Kremenek [Fri, 25 Apr 2008 18:44:36 +0000 (18:44 +0000)]
Added some notes about the LLVM "checker".  This isn't a public link yet; still refining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50283 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove the 'unused static' diagnostic from codegen. This should be
Chris Lattner [Fri, 25 Apr 2008 15:47:13 +0000 (15:47 +0000)]
remove the 'unused static' diagnostic from codegen.  This should be
reimplemented in Sema someday.  This is tracked in PR2236.  Until then
disabling it removes some bogus diagnostics (see 2236).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50263 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoinitial support for recognizing __transparent_union__ attributes
Nuno Lopes [Fri, 25 Apr 2008 09:32:00 +0000 (09:32 +0000)]
initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50262 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle dereferences of function pointers (which return a handle to the function).
Ted Kremenek [Fri, 25 Apr 2008 01:56:50 +0000 (01:56 +0000)]
Handle dereferences of function pointers (which return a handle to the function).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50246 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't abort on GetRVal when the LVal is a StringLiteralVal.
Ted Kremenek [Fri, 25 Apr 2008 01:45:38 +0000 (01:45 +0000)]
Don't abort on GetRVal when the LVal is a StringLiteralVal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50245 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't emit empty strings for path diagnostics when taking the default branch of a...
Ted Kremenek [Fri, 25 Apr 2008 01:29:56 +0000 (01:29 +0000)]
Don't emit empty strings for path diagnostics when taking the default branch of a switch statement that has no label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50242 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo a better job at computing dead symbols.
Ted Kremenek [Fri, 25 Apr 2008 01:25:15 +0000 (01:25 +0000)]
Do a better job at computing dead symbols.

Implemented support for better localized leaks in the CF reference count checker.
Now leaks should be flagged close to where they occur.

This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50241 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd preliminary support for flagging leaks around when they happen (doesn't work...
Ted Kremenek [Thu, 24 Apr 2008 23:57:27 +0000 (23:57 +0000)]
Add preliminary support for flagging leaks around when they happen (doesn't work yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50237 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBetter handling for directory names in HTML diagnostics. Work in progress.
Ted Kremenek [Thu, 24 Apr 2008 23:37:03 +0000 (23:37 +0000)]
Better handling for directory names in HTML diagnostics.  Work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50234 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMore boilerplate for handling specialized-transfer function logic for dead symbols.
Ted Kremenek [Thu, 24 Apr 2008 23:35:58 +0000 (23:35 +0000)]
More boilerplate for handling specialized-transfer function logic for dead symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50233 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPatch to diagnose inconsistancies between properties declared in current and
Fariborz Jahanian [Thu, 24 Apr 2008 19:58:34 +0000 (19:58 +0000)]
Patch to diagnose inconsistancies between properties declared in current and
its super class. This patch is incomplete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50228 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded initial boilerplate in GRExprEngine to allow checker-specific transfer
Ted Kremenek [Thu, 24 Apr 2008 18:31:42 +0000 (18:31 +0000)]
Added initial boilerplate in GRExprEngine to allow checker-specific transfer
function logic to act when symbols become dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50221 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded uninitialized-values (path-sensitive) test case as a regression test
Ted Kremenek [Thu, 24 Apr 2008 18:28:14 +0000 (18:28 +0000)]
Added uninitialized-values (path-sensitive) test case as a regression test
for the fix in r50178 (http://llvm.org/viewvc/llvm-project?rev=50178&view=rev).
This fix was for <rdar://problem/5881148>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50220 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded test case for functionality fix in rdar://problem/5886141 (handle variadic...
Ted Kremenek [Thu, 24 Apr 2008 18:17:14 +0000 (18:17 +0000)]
Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50219 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCF reference count checker: handle variadic functions that allocate CF objects.
Ted Kremenek [Thu, 24 Apr 2008 17:22:33 +0000 (17:22 +0000)]
CF reference count checker: handle variadic functions that allocate CF objects.
This fixes <rdar://problem/5886141>.

Part of this change resulted in creating sparser summaries.  I also added
some more comments and did some minor code cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50214 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHave ValidateOutputConstraint return false instead of firing an assertion
Ted Kremenek [Thu, 24 Apr 2008 16:36:38 +0000 (16:36 +0000)]
Have ValidateOutputConstraint return false instead of firing an assertion
when processing a constraint we don't understand.  This allows the frontend
to gracefully fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50213 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFor case statements involving enums, BugReporter now generates PathDiagnostics
Ted Kremenek [Wed, 23 Apr 2008 23:35:07 +0000 (23:35 +0000)]
For case statements involving enums, BugReporter now generates PathDiagnostics
that say that we are jumping to "case a" instead of "case 0".

This is a feature implementation for <rdar://problem/5880430>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50197 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix minor regression in bug report generation.
Ted Kremenek [Wed, 23 Apr 2008 23:04:32 +0000 (23:04 +0000)]
Fix minor regression in bug report generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50195 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with...
Ted Kremenek [Wed, 23 Apr 2008 23:02:12 +0000 (23:02 +0000)]
When building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with a single path that BugReport objects can safely walk and introspect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50194 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed: <rdar://problem/5881148>
Ted Kremenek [Wed, 23 Apr 2008 20:12:28 +0000 (20:12 +0000)]
Fixed: <rdar://problem/5881148>

Problem:

In the recently refactored VisitDeref (which processes dereferences), we
were incorrectly skipping the node just generated for the subexpression
of the dereference.  This was a horrible regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50176 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
Ted Kremenek [Wed, 23 Apr 2008 16:25:39 +0000 (16:25 +0000)]
TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
when it is constructed via deserialization.  This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object.  This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.

The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc.  During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove false path where the default branch in a switch statement would
Ted Kremenek [Wed, 23 Apr 2008 05:03:18 +0000 (05:03 +0000)]
Remove false path where the default branch in a switch statement would
always be taken even if it was not feasible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50132 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix a rewriter crash on zero length files.
Chris Lattner [Wed, 23 Apr 2008 03:21:50 +0000 (03:21 +0000)]
fix a rewriter crash on zero length files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50126 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded panic function "assfail".
Ted Kremenek [Wed, 23 Apr 2008 00:41:25 +0000 (00:41 +0000)]
Added panic function "assfail".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50119 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPatch to build AST for property implementation declarations and
Fariborz Jahanian [Wed, 23 Apr 2008 00:06:01 +0000 (00:06 +0000)]
Patch to build AST for property implementation declarations and
to print declaration from its AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50117 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFor default branches in switch statements with no default label, print out
Ted Kremenek [Tue, 22 Apr 2008 22:29:46 +0000 (22:29 +0000)]
For default branches in switch statements with no default label, print out
the line we are going to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50113 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRewrote VisitDeclStmt to properly handle initializers that can do anything.
Ted Kremenek [Tue, 22 Apr 2008 22:25:27 +0000 (22:25 +0000)]
Rewrote VisitDeclStmt to properly handle initializers that can do anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50112 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded lval type (and tracking) for StringLiterals.
Ted Kremenek [Tue, 22 Apr 2008 21:39:21 +0000 (21:39 +0000)]
Added lval type (and tracking) for StringLiterals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowi...
Ted Kremenek [Tue, 22 Apr 2008 21:10:18 +0000 (21:10 +0000)]
Added "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowing us to track lvals when they are casted back to pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50108 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago"This patch renames
Chris Lattner [Tue, 22 Apr 2008 18:39:57 +0000 (18:39 +0000)]
"This patch renames

DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
Ted Kremenek [Tue, 22 Apr 2008 16:15:03 +0000 (16:15 +0000)]
PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
them to not be stack-allocated.

HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor.
This is a workaround for a problem when we trampled the Preprocessor state
when highlighting macros (sometimes resulting in an assertion failure).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50102 91177308-0d34-0410-b5e6-96231b3b80d8