]> granicus.if.org Git - clang/log
clang
16 years agoFix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration...
Steve Naroff [Fri, 9 May 2008 21:17:56 +0000 (21:17 +0000)]
Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.

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

16 years agoDO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeti...
Steve Naroff [Fri, 9 May 2008 20:52:28 +0000 (20:52 +0000)]
DO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well.

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

16 years agoMore VC++ project file updates.
Steve Naroff [Fri, 9 May 2008 19:10:27 +0000 (19:10 +0000)]
More VC++ project file updates.

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

16 years agoRemove repeated word.
Ted Kremenek [Fri, 9 May 2008 17:53:57 +0000 (17:53 +0000)]
Remove repeated word.

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

16 years agoAdd attribute "format" support for typedefs of function pointers.
Ted Kremenek [Fri, 9 May 2008 17:36:24 +0000 (17:36 +0000)]
Add attribute "format" support for typedefs of function pointers.

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

16 years agoGrammar.
Ted Kremenek [Fri, 9 May 2008 17:13:18 +0000 (17:13 +0000)]
Grammar.

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

16 years agoAdded text on librewrite and libanalysis to the README.
Ted Kremenek [Fri, 9 May 2008 17:12:45 +0000 (17:12 +0000)]
Added text on librewrite and libanalysis to the README.

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

16 years agoHandle all attributes on a parameter
Nate Begeman [Fri, 9 May 2008 16:56:01 +0000 (16:56 +0000)]
Handle all attributes on a parameter

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

16 years agoExtend vector member references to include {.hi, .lo, .e, .o} which return a
Nate Begeman [Fri, 9 May 2008 06:41:27 +0000 (06:41 +0000)]
Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

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

Remove some unnecessary methods/types in the ExtVectorElementExpr class.

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

16 years agoset long/pointers to 64-bits on ppc64/x86-64
Chris Lattner [Fri, 9 May 2008 06:17:04 +0000 (06:17 +0000)]
set long/pointers to 64-bits on ppc64/x86-64

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

16 years agoparameterize pointer size/align better without doing virtual method calls in normal...
Chris Lattner [Fri, 9 May 2008 06:08:39 +0000 (06:08 +0000)]
parameterize pointer size/align better without doing virtual method calls in normal case.

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

16 years agosimplify some code, don't assume that sizeof(long) < sizeof(long long).
Chris Lattner [Fri, 9 May 2008 05:59:00 +0000 (05:59 +0000)]
simplify some code, don't assume that sizeof(long) < sizeof(long long).

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

16 years agoparameterize long long.
Chris Lattner [Fri, 9 May 2008 05:50:02 +0000 (05:50 +0000)]
parameterize long long.

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

16 years agocorrectly parameterize long, patch by Nate.
Chris Lattner [Fri, 9 May 2008 05:47:41 +0000 (05:47 +0000)]
correctly parameterize long, patch by Nate.

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

16 years agoFix rdar://5921025 a crash on the included testcase.
Chris Lattner [Fri, 9 May 2008 05:34:49 +0000 (05:34 +0000)]
Fix rdar://5921025 a crash on the included testcase.

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

16 years agoDon't call into objc front-end when not parsing objc code. This avoids
Chris Lattner [Fri, 9 May 2008 05:28:21 +0000 (05:28 +0000)]
Don't call into objc front-end when not parsing objc code.  This avoids
crashes because objc types aren't set up right.

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

16 years agoMake sure the prototype for objc_msgSend_fpret() returns a double.
Steve Naroff [Thu, 8 May 2008 22:02:18 +0000 (22:02 +0000)]
Make sure the prototype for objc_msgSend_fpret() returns a double.

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

16 years agoAdd the non-immediate-shift vector builtins
Nate Begeman [Thu, 8 May 2008 21:51:12 +0000 (21:51 +0000)]
Add the non-immediate-shift vector builtins

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

16 years agoAdded initial support for supporting __NSString__ in attribute "format".
Ted Kremenek [Thu, 8 May 2008 19:43:35 +0000 (19:43 +0000)]
Added initial support for supporting __NSString__ in attribute "format".
Still need to iron out some of the semantics (fixmes are present).
This addresses <rdar://problem/5916348>

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

16 years agoUpdated Xcode project.
Ted Kremenek [Thu, 8 May 2008 19:20:24 +0000 (19:20 +0000)]
Updated Xcode project.

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

16 years agoFix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure...
Steve Naroff [Thu, 8 May 2008 17:52:16 +0000 (17:52 +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@50862 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded -g command line options to clang for generating source level debug information...
Sanjiv Gupta [Thu, 8 May 2008 08:54:20 +0000 (08:54 +0000)]
Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.

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

16 years agoRemove the ending "." from clang options descriptions.
Sanjiv Gupta [Thu, 8 May 2008 08:28:14 +0000 (08:28 +0000)]
Remove the ending "." from clang options descriptions.

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

16 years agostart implementation of a macro rewriter, this is currently just stubbed out.
Chris Lattner [Thu, 8 May 2008 06:52:13 +0000 (06:52 +0000)]
start implementation of a macro rewriter, this is currently just stubbed out.

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

16 years agoAdd basic support for the pic-* target triples and add support for
Chris Lattner [Thu, 8 May 2008 05:58:21 +0000 (05:58 +0000)]
Add basic support for the pic-* target triples and add support for
targets that do not support recursion (and thus codegen stack variables
as globals).

Patch contributed by Alireza Moshtaghi!

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

16 years agoThe awesome GNU "comma elision extension" works with both the standard
Chris Lattner [Thu, 8 May 2008 05:10:33 +0000 (05:10 +0000)]
The awesome GNU "comma elision extension" works with both the standard
__VA_ARGS__ syntax as well as with the amazingly awesome GNU "named
variadic macro" extension.  Allow it with the GNU syntax as well.

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

16 years agoFix rdar://5919567: assertion failure: split didn't occur before erase!
Chris Lattner [Thu, 8 May 2008 03:23:46 +0000 (03:23 +0000)]
Fix rdar://5919567: assertion failure: split didn't occur before erase!

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

16 years agoBegin handling union bitfields.
Devang Patel [Wed, 7 May 2008 22:28:29 +0000 (22:28 +0000)]
Begin handling union bitfields.
Note, this is just beginning.

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

16 years agoFix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof...
Steve Naroff [Wed, 7 May 2008 21:23:49 +0000 (21:23 +0000)]
Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro

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

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