]> granicus.if.org Git - clang/log
clang
16 years agoAdded support for "drain".
Ted Kremenek [Wed, 7 May 2008 21:17:39 +0000 (21:17 +0000)]
Added support for "drain".

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

16 years agoSynthesized getter/setter method declarations need not have
Fariborz Jahanian [Wed, 7 May 2008 20:53:44 +0000 (20:53 +0000)]
Synthesized getter/setter method declarations need not have
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.

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

16 years agoExpand the CF retain checker to allow the Create/Get rule to apply to any
Ted Kremenek [Wed, 7 May 2008 20:06:41 +0000 (20:06 +0000)]
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.

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

16 years agoFlip order of arguments to CStrInStrNoCase.
Ted Kremenek [Wed, 7 May 2008 18:57:30 +0000 (18:57 +0000)]
Flip order of arguments to CStrInStrNoCase.

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

16 years agoUse llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not portable.
Ted Kremenek [Wed, 7 May 2008 18:36:45 +0000 (18:36 +0000)]
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.

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

16 years agoThis patch introduces declaration of getter methods for ObjC2's
Fariborz Jahanian [Wed, 7 May 2008 17:43:59 +0000 (17:43 +0000)]
This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.

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

16 years agocopy-paste: NS types are not typedefs.
Ted Kremenek [Wed, 7 May 2008 17:35:41 +0000 (17:35 +0000)]
copy-paste: NS types are not typedefs.

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

16 years agoFixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.
Steve Naroff [Wed, 7 May 2008 17:35:03 +0000 (17:35 +0000)]
Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.

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

16 years agoFix off-by-one error.
Steve Naroff [Wed, 7 May 2008 16:50:14 +0000 (16:50 +0000)]
Fix off-by-one error.

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

16 years agoDo not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" from...
Ted Kremenek [Wed, 7 May 2008 05:34:45 +0000 (05:34 +0000)]
Do not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" from NSObject as allocators.

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

16 years agoDiagnose attempts to use C++ default arguments outside of a function declaration
Douglas Gregor [Wed, 7 May 2008 04:49:29 +0000 (04:49 +0000)]
Diagnose attempts to use C++ default arguments outside of a function declaration

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

16 years agoBe less promiscuous with generating summaries for "new", "copy", "create".
Ted Kremenek [Wed, 7 May 2008 04:25:59 +0000 (04:25 +0000)]
Be less promiscuous with generating summaries for "new", "copy", "create".

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

16 years agoAdded auto-summary generation for createXXX, copyXXX, newXXX methods.
Ted Kremenek [Wed, 7 May 2008 03:45:05 +0000 (03:45 +0000)]
Added auto-summary generation for createXXX, copyXXX, newXXX methods.

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

16 years agoFix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end
Steve Naroff [Wed, 7 May 2008 00:06:16 +0000 (00:06 +0000)]
Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end

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

16 years agoFix a few glitches in scan-build with automatically generating class names from bug...
Ted Kremenek [Tue, 6 May 2008 23:51:45 +0000 (23:51 +0000)]
Fix a few glitches in scan-build with automatically generating class names from bug types.

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

16 years agoImprove HTMLDiagnostics by understanding the "Below" hint.
Ted Kremenek [Tue, 6 May 2008 23:42:18 +0000 (23:42 +0000)]
Improve HTMLDiagnostics by understanding the "Below" hint.

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

16 years agoFix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure...
Steve Naroff [Tue, 6 May 2008 23:20:07 +0000 (23:20 +0000)]
Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class

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

16 years agoPrint ObjC methods of ObjC classes.
Fariborz Jahanian [Tue, 6 May 2008 23:14:25 +0000 (23:14 +0000)]
Print ObjC methods of ObjC classes.

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

16 years agoDon't report leaks for autoreleased objects.
Ted Kremenek [Tue, 6 May 2008 23:07:13 +0000 (23:07 +0000)]
Don't report leaks for autoreleased objects.

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

16 years agoFix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead...
Steve Naroff [Tue, 6 May 2008 22:45:19 +0000 (22:45 +0000)]
Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead of putting them in the preamble?

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

16 years agoAdded "DisplayHint" to PathDiagnosticPiece to provide a hint for the
Ted Kremenek [Tue, 6 May 2008 21:33:07 +0000 (21:33 +0000)]
Added "DisplayHint" to PathDiagnosticPiece to provide a hint for the
PathDiagnosticClient of where to display a string (beyond just the SourceLocation).

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

16 years agoMore comments.
Ted Kremenek [Tue, 6 May 2008 21:26:51 +0000 (21:26 +0000)]
More comments.
"#if 0" out some assumptions when auto-generating method summaries.

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

16 years agoFix PR2101 - Codegen crash during bitfield initialization.
Devang Patel [Tue, 6 May 2008 19:57:59 +0000 (19:57 +0000)]
Fix PR2101 - Codegen crash during bitfield initialization.

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

16 years agoFix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice...
Steve Naroff [Tue, 6 May 2008 18:26:51 +0000 (18:26 +0000)]
Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice when two interfaces use it in same file

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

16 years agoTest was accidently nullified in previous check-in.
Fariborz Jahanian [Tue, 6 May 2008 18:14:26 +0000 (18:14 +0000)]
Test was accidently nullified in previous check-in.

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

16 years agoExperiment with not converting bug names to lower case.
Ted Kremenek [Tue, 6 May 2008 18:11:36 +0000 (18:11 +0000)]
Experiment with not converting bug names to lower case.

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

16 years agoMore refactorings in GeneratePathDiagnostic: use ExecutionContinues to display
Ted Kremenek [Tue, 6 May 2008 18:11:09 +0000 (18:11 +0000)]
More refactorings in GeneratePathDiagnostic: use ExecutionContinues to display
"Execution continues..." message, which does a better job at handling corner cases.

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

16 years agoPatch to refactor setter/getter names of property attributes into Selector
Fariborz Jahanian [Tue, 6 May 2008 18:09:04 +0000 (18:09 +0000)]
Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.

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

16 years agoGenerate "stop" summaries for selectors involving receivers whose type is not NSxxxx.
Ted Kremenek [Tue, 6 May 2008 15:44:25 +0000 (15:44 +0000)]
Generate "stop" summaries for selectors involving receivers whose type is not NSxxxx.

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

16 years agoUse strncmp correctly.
Ted Kremenek [Tue, 6 May 2008 06:17:42 +0000 (06:17 +0000)]
Use strncmp correctly.

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

16 years agoMake string comparison legible and remove buffer overrun introduced by typo.
Ted Kremenek [Tue, 6 May 2008 06:09:09 +0000 (06:09 +0000)]
Make string comparison legible and remove buffer overrun introduced by typo.

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

16 years agoString comparison cleanups.
Ted Kremenek [Tue, 6 May 2008 04:28:05 +0000 (04:28 +0000)]
String comparison cleanups.
Added test case.

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

16 years agoFix logic error in string processing.
Ted Kremenek [Tue, 6 May 2008 04:21:38 +0000 (04:21 +0000)]
Fix logic error in string processing.

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

16 years agoRemove assertion.
Ted Kremenek [Tue, 6 May 2008 04:21:10 +0000 (04:21 +0000)]
Remove assertion.

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

16 years agoUse EvalSummary to process message expressions, thereby unifying the checker
Ted Kremenek [Tue, 6 May 2008 04:20:12 +0000 (04:20 +0000)]
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.

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

16 years agoFixed subtle bug in the an GRAuditor object could mark a node as a sink
Ted Kremenek [Tue, 6 May 2008 03:26:52 +0000 (03:26 +0000)]
Fixed subtle bug in the an GRAuditor object could mark a node as a sink
after it was already added to the destination NodeSet.

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

16 years agoAdded receiver effects to EvalSummary.
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

16 years agoExpand summaries to include "Receiver" effects.
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

16 years agosimplify some builder calls.
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

16 years agoremove a stray printout
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

16 years agoAdded initialization code to generate initial set of ObjC method summaries (non-insta...
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

16 years agoAdded code to generate initial set of summaries for instance methods.
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

16 years agoSeveral fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests...
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

16 years agoAdd summary generation for "initXXX" methods.
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

16 years agoMake CF retain diagnostics more succinct.
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

16 years agoEmit dead store warnings for ++ and -- operators.
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

16 years agoFix rdar://5905347 a crash on invalid builtin, due to the
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

16 years agoInitial work on refactoring the CFRefCount checker so that it is more
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

16 years agoAdd support for -Wimplicit-function-declaration, rdar://5907433
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

16 years agoFix typo, improve comment.
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

16 years agoFix a few more bugs in preprocessor expressions w.r.t. ?:. Now I
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

16 years agopercolate @optional/@required protocols down to ASTs for
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

16 years agoImprove leak diagnostics to not report a leak on the same line where
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

16 years agoImproved leak diagnostics.
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

16 years agoMinor refactorings/cleanups in CF retain checker and added support for NSMakeCollectable.
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

16 years agoWhen reporting branch conditions that evaluate to an uninitialized value,
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

16 years agoFix a bug from when this was a pointer instead of vector.
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

16 years agoNeil pointed out that clang doesn't generate ranges from diagnostics
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

16 years agofix a bug handling right associative operators that Neil noticed, hopefully
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

16 years agoFix PR2281: these two warnings should be promoted to error on
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

16 years ago||/&& do not do UAC's either. This silences a bogus warning on #if -1 || 4U.
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

16 years agoNeil points out that commas don't do UACs either.
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

16 years agoFix the rest of PR2279:
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

16 years agoFix PR2279 part C: shifts don't perform the UACs, thanks to Neil
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

16 years agouse simplified API for making fp constants.
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

16 years agofix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).
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

16 years agoSimplify FunctionDecl::AddRedeclaration a bit by using std::swap.
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

16 years agoif a decl is both 'static' and weak or static and inline, its linkage
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

16 years agoadd testcase for pr2050 which is now fixed.
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

16 years agoimprove array type comments.
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

16 years agoadd a testcase
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

16 years agoRemove debugging statement.
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

16 years agoRename member variable.
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

16 years agoOutput better paths to display in bug reports and compute a common
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

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