Ted Kremenek
92137a3d8d
Added CFGBlock::hasBinaryBranchTerminator().
...
llvm-svn: 51190
2008-05-16 16:06:00 +00:00
Eli Friedman
db421caaa3
Minor cleanup to isBuiltinConstantExpr.
...
llvm-svn: 51188
2008-05-16 13:28:37 +00:00
Ted Kremenek
dd547b1ce9
Fixed another regression introduced by r51113 caused by some refactoring
...
in Sema::CheckFunctionCall:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html
The bug was that the logic from the helper methods used by CheckFunctionCall
were being inverted (a subtle bug). This would cause the parser to discard
any valid AST nodes involving several builtins (see patch).
This removes the last regression failure I'm seeing in the test suite: Analysis-Apple/NoReturn.
llvm-svn: 51168
2008-05-15 22:24:49 +00:00
Ted Kremenek
98b730d5bb
Removed bogus "return true" in Expr::isConstantExpr that returned true for all
...
expressions. This appears to be a regression introduced in r51113 that caused
many test cases to fail (there is still a test case in the Analysis directory
that is failing):
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html
llvm-svn: 51164
2008-05-15 21:49:04 +00:00
Steve Naroff
ad91868aa6
Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".
...
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).
llvm-svn: 51163
2008-05-15 21:12:10 +00:00
Steve Naroff
bdc67b382f
Revert...
...
Author: akirtzidis
Date: Wed May 14 05:00:15 2008
New Revision: 51101
URL: http://llvm.org/viewvc/llvm-project?rev=51101&view=rev
Log: Upgrading VC++ projects to VC++ 2008.
I really need to build with VC++ 2005.
llvm-svn: 51158
2008-05-15 19:53:06 +00:00
Argyrios Kyrtzidis
1a599ea820
Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.
...
llvm-svn: 51153
2008-05-15 17:53:43 +00:00
Argyrios Kyrtzidis
212f91107a
Comments fix.
...
llvm-svn: 51151
2008-05-15 17:26:35 +00:00
Nate Begeman
6c59132241
Handle a couple missing builtins that will go away eventually when the various
...
intrin.h files are finished
llvm-svn: 51137
2008-05-15 07:38:03 +00:00
Steve Naroff
0424b0e70d
Add some of GCC's object checking builtin's.
...
llvm-svn: 51133
2008-05-14 22:12:15 +00:00
Eli Friedman
f0d0e9e174
Use double-underscores in front of all non-keywords to protect against
...
#define pollution.
llvm-svn: 51128
2008-05-14 20:32:22 +00:00
Ted Kremenek
1907394f74
Don't specify a -o option to clang when not using "-checker-cfref".
...
llvm-svn: 51124
2008-05-14 20:26:52 +00:00
Ted Kremenek
e0927a0f49
Fix variable misspelling.
...
llvm-svn: 51122
2008-05-14 20:20:46 +00:00
Ted Kremenek
cf05a830b1
Don't run clang on .s files.
...
llvm-svn: 51121
2008-05-14 20:17:17 +00:00
Eli Friedman
e94e0f66cd
Make header use the new __builtin_shufflevector builtin.
...
llvm-svn: 51117
2008-05-14 20:11:29 +00:00
Ted Kremenek
e3fc13a3e0
Added "-a" option to scan-build to select the analysis (ASTConsumer) used by clang. The default is -checker-cfref.
...
llvm-svn: 51116
2008-05-14 20:10:33 +00:00
Eli Friedman
a1b4ed8003
Implementation of __builtin_shufflevector, a portable builtin capable of
...
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.
llvm-svn: 51113
2008-05-14 19:38:39 +00:00
Ted Kremenek
0a8a0fa0b5
Zero-pad the month and day fields in the output HTML directory.
...
llvm-svn: 51109
2008-05-14 17:23:56 +00:00
Argyrios Kyrtzidis
881848119c
Update the clangSema VC++ project.
...
llvm-svn: 51104
2008-05-14 10:50:44 +00:00
Argyrios Kyrtzidis
3722daf62d
Change CRLF line endings to LF.
...
llvm-svn: 51103
2008-05-14 10:49:47 +00:00
Argyrios Kyrtzidis
7ebefaf3c7
Upgrading VC++ projects to VC++ 2008.
...
llvm-svn: 51101
2008-05-14 10:00:15 +00:00
Eli Friedman
7e452e59e4
An array of VLAs is a VLA. Shouldn't make any significant difference at
...
the moment, but it what you'd expect in the AST from reading the
standard, and it should make VLA codegen a bit more strightforward.
llvm-svn: 51086
2008-05-14 00:40:18 +00:00
Eli Friedman
9fd8b68568
Add codegen support for block-level compound literals.
...
llvm-svn: 51081
2008-05-13 23:18:27 +00:00
Eli Friedman
dd7406e65c
Add support for init lists for complex variables.
...
llvm-svn: 51080
2008-05-13 23:11:35 +00:00
Ted Kremenek
20a44ed730
Output #LINE for computing line counts.
...
llvm-svn: 51079
2008-05-13 22:56:36 +00:00
Ted Kremenek
7147584d03
Use "-i" option with make when ignoring errors.
...
llvm-svn: 51070
2008-05-13 21:28:02 +00:00
Nate Begeman
d386215916
Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.
...
llvm-svn: 51068
2008-05-13 21:03:02 +00:00
Eli Friedman
58639e584c
Both operands to && have to be scalars, not just one.
...
llvm-svn: 51065
2008-05-13 20:16:47 +00:00
Ted Kremenek
52387a1828
Re-enable the analyzer.
...
llvm-svn: 51055
2008-05-13 17:10:28 +00:00
Eli Friedman
1a5754a26a
Detabify.
...
llvm-svn: 51042
2008-05-13 14:40:48 +00:00
Ted Kremenek
80ff5f0696
Place "-x" option before other analyzer options.
...
llvm-svn: 51014
2008-05-12 23:56:50 +00:00
Ted Kremenek
ece302d75b
Directly invoke gcc immediately instead of before we process the command line arguments.
...
llvm-svn: 51012
2008-05-12 23:47:41 +00:00
Steve Naroff
a98fe19c7e
Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.
...
Teach Sema::MergeVarDecl() about __private_extern__.
llvm-svn: 51005
2008-05-12 22:36:43 +00:00
Ted Kremenek
f5a94e7114
Added internal command logging.
...
llvm-svn: 51003
2008-05-12 22:07:14 +00:00
Steve Naroff
bf1516c618
Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats
...
llvm-svn: 51002
2008-05-12 21:44:38 +00:00
Chris Lattner
c9c296d235
testcase for PR2263, fixed by Nate's r50903 patch.
...
llvm-svn: 50983
2008-05-12 18:31:17 +00:00
Ted Kremenek
2abde809ce
Unbreak build.
...
llvm-svn: 50980
2008-05-12 17:42:30 +00:00
Ted Kremenek
a0055a8ef5
Support StringLiteralVal when comparing LVal types.
...
llvm-svn: 50979
2008-05-12 17:41:30 +00:00
Ted Kremenek
8322da5fa3
Grammar cleanup in comment.
...
Remove redundant assignment.
llvm-svn: 50978
2008-05-12 17:40:56 +00:00
Ted Kremenek
babaa52efb
80 col violation fix.
...
llvm-svn: 50977
2008-05-12 17:40:13 +00:00
Ted Kremenek
92f78f4c04
When reading in the DeclCtx during deserialization, register the DeclCtx of the
...
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The
value of DeclCtx gets filled in *later* by the backpatcher.
This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308
llvm-svn: 50976
2008-05-12 17:29:34 +00:00
Ted Kremenek
9a15a9477b
Add Type::getAsTypedefType().
...
llvm-svn: 50970
2008-05-12 16:22:53 +00:00
Eli Friedman
6a7087e455
Emit basic block for switch body; fixes PR2307.
...
llvm-svn: 50968
2008-05-12 16:08:04 +00:00
Eli Friedman
6e31321043
Don't try to take the address of a bitfield; fixes PR2310.
...
llvm-svn: 50966
2008-05-12 15:06:05 +00:00
Nuno Lopes
de9746cd45
fix free/delete mismatch problem in add/mergeProperties (found by valgrind)
...
llvm-svn: 50945
2008-05-10 10:31:54 +00:00
Chris Lattner
14196c099f
Implement -rewrite-macros, which is a crazy macro expander that expands
...
macros but doesn't expand #includes, remove comments, remove #defines
etc.
For example:
----
#include <stdio.h>
#define bbaa
#define funclike(x) x "a" x "b" x
bbaa bbaa
#if 1
funclike("gar")
foo /*blah*/ bar
bar
#endif
#if 0
funclike()
#endif
----
rewrites to:
----
#include <stdio.h>
#define bbaa
#define funclike(x) x "a" x "b" x
/*bbaa bbaa*/
#if 1
"gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/
foo /*blah*/ bar
bar
#endif
#if 0
/*funclike()*/
#endif
----
llvm-svn: 50925
2008-05-10 00:02:33 +00:00
Ted Kremenek
acdde6f099
Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared).
...
llvm-svn: 50924
2008-05-09 23:45:33 +00:00
Argyrios Kyrtzidis
fa8e15bfa5
-Implement proper name lookup for namespaces.
...
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.
llvm-svn: 50923
2008-05-09 23:39:43 +00:00
Chris Lattner
664ef65981
make #if 0 code compile, even though it still isn't very useful.
...
llvm-svn: 50920
2008-05-09 22:43:24 +00:00
Mon P Wang
b84407d6ec
Added support to generate some atomic operators (add, sub, and, or etc..)
...
llvm-svn: 50919
2008-05-09 22:40:52 +00:00
Steve Naroff
d30f8c5b54
Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.
...
llvm-svn: 50915
2008-05-09 21:17:56 +00:00
Steve Naroff
530c3f9403
DO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well.
...
llvm-svn: 50913
2008-05-09 20:52:28 +00:00
Steve Naroff
0889b9bfac
More VC++ project file updates.
...
llvm-svn: 50909
2008-05-09 19:10:27 +00:00
Ted Kremenek
82e8d07b02
Remove repeated word.
...
llvm-svn: 50907
2008-05-09 17:53:57 +00:00
Ted Kremenek
712c91f8a9
Add attribute "format" support for typedefs of function pointers.
...
llvm-svn: 50906
2008-05-09 17:36:24 +00:00
Ted Kremenek
bbd4695a45
Grammar.
...
llvm-svn: 50905
2008-05-09 17:13:18 +00:00
Ted Kremenek
4d180b36f3
Added text on librewrite and libanalysis to the README.
...
llvm-svn: 50904
2008-05-09 17:12:45 +00:00
Nate Begeman
1d30431002
Handle all attributes on a parameter
...
llvm-svn: 50903
2008-05-09 16:56:01 +00:00
Nate Begeman
f322eabbce
Extend vector member references to include {.hi, .lo, .e, .o} which return a
...
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.
Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.
Remove some unnecessary methods/types in the ExtVectorElementExpr class.
llvm-svn: 50892
2008-05-09 06:41:27 +00:00
Chris Lattner
ba7a6c14ed
set long/pointers to 64-bits on ppc64/x86-64
...
llvm-svn: 50891
2008-05-09 06:17:04 +00:00
Chris Lattner
5e2ef0c18a
parameterize pointer size/align better without doing virtual method calls in normal case.
...
llvm-svn: 50890
2008-05-09 06:08:39 +00:00
Chris Lattner
55258cf278
simplify some code, don't assume that sizeof(long) < sizeof(long long).
...
llvm-svn: 50888
2008-05-09 05:59:00 +00:00
Chris Lattner
5a9aaaf687
parameterize long long.
...
llvm-svn: 50887
2008-05-09 05:50:02 +00:00
Chris Lattner
5dc7ff1cf3
correctly parameterize long, patch by Nate.
...
llvm-svn: 50886
2008-05-09 05:47:41 +00:00
Chris Lattner
adb86418db
Fix rdar://5921025 a crash on the included testcase.
...
llvm-svn: 50885
2008-05-09 05:34:49 +00:00
Chris Lattner
2fdcddd78d
Don't call into objc front-end when not parsing objc code. This avoids
...
crashes because objc types aren't set up right.
llvm-svn: 50884
2008-05-09 05:28:21 +00:00
Steve Naroff
2e4e385a58
Make sure the prototype for objc_msgSend_fpret() returns a double.
...
llvm-svn: 50873
2008-05-08 22:02:18 +00:00
Nate Begeman
c58373886d
Add the non-immediate-shift vector builtins
...
llvm-svn: 50870
2008-05-08 21:51:12 +00:00
Ted Kremenek
0ae11a6f2e
Added initial support for supporting __NSString__ in attribute "format".
...
Still need to iron out some of the semantics (fixmes are present).
This addresses <rdar://problem/5916348>
llvm-svn: 50866
2008-05-08 19:43:35 +00:00
Ted Kremenek
27a4ba66fd
Updated Xcode project.
...
llvm-svn: 50864
2008-05-08 19:20:24 +00:00
Steve Naroff
b1c02371cd
Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
...
llvm-svn: 50862
2008-05-08 17:52:16 +00:00
Sanjiv Gupta
15cb669039
Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.
...
llvm-svn: 50848
2008-05-08 08:54:20 +00:00
Sanjiv Gupta
cd13ef01a2
Remove the ending "." from clang options descriptions.
...
llvm-svn: 50847
2008-05-08 08:28:14 +00:00
Chris Lattner
3c04ff00c2
start implementation of a macro rewriter, this is currently just stubbed out.
...
llvm-svn: 50845
2008-05-08 06:52:13 +00:00
Chris Lattner
b781dc79aa
Add basic support for the pic-* target triples and add support for
...
targets that do not support recursion (and thus codegen stack variables
as globals).
Patch contributed by Alireza Moshtaghi!
llvm-svn: 50844
2008-05-08 05:58:21 +00:00
Chris Lattner
d330036c06
The awesome GNU "comma elision extension" works with both the standard
...
__VA_ARGS__ syntax as well as with the amazingly awesome GNU "named
variadic macro" extension. Allow it with the GNU syntax as well.
llvm-svn: 50843
2008-05-08 05:10:33 +00:00
Chris Lattner
2b88c1e4c4
Fix rdar://5919567: assertion failure: split didn't occur before erase!
...
llvm-svn: 50839
2008-05-08 03:23:46 +00:00
Devang Patel
ac25fc6f2e
Begin handling union bitfields.
...
Note, this is just beginning.
llvm-svn: 50835
2008-05-07 22:28:29 +00:00
Steve Naroff
30ac2225ee
Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
...
llvm-svn: 50832
2008-05-07 21:23:49 +00:00
Ted Kremenek
bcdb46830b
Added support for "drain".
...
llvm-svn: 50831
2008-05-07 21:17:39 +00:00
Fariborz Jahanian
8983f17ba0
Synthesized getter/setter method declarations need not have
...
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.
llvm-svn: 50830
2008-05-07 20:53:44 +00:00
Ted Kremenek
f958ec50c0
Expand the CF retain checker to allow the Create/Get rule to apply to any
...
function that returns a CFxxxRef, not just functions whose name begins with
CF. This implements <rdar://problem/5917879>.
Added test case for this feature.
Updated calls to CStrInCStrNoCase to swap their arguments, per compatibility
with strcasestr.
llvm-svn: 50829
2008-05-07 20:06:41 +00:00
Ted Kremenek
fcf060fd2f
Flip order of arguments to CStrInStrNoCase.
...
llvm-svn: 50824
2008-05-07 18:57:30 +00:00
Ted Kremenek
b6cbf28d82
Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not portable.
...
Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition.
llvm-svn: 50822
2008-05-07 18:36:45 +00:00
Fariborz Jahanian
ec6e4c8096
This patch introduces declaration of getter methods for ObjC2's
...
properties. Couple of property tests will fail with this patch.
Will fix them next.
llvm-svn: 50818
2008-05-07 17:43:59 +00:00
Ted Kremenek
89bd0fc27d
copy-paste: NS types are not typedefs.
...
llvm-svn: 50817
2008-05-07 17:35:41 +00:00
Steve Naroff
456c0f6738
Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.
...
llvm-svn: 50816
2008-05-07 17:35:03 +00:00
Steve Naroff
6eda39c345
Fix off-by-one error.
...
llvm-svn: 50815
2008-05-07 16:50:14 +00:00
Ted Kremenek
7bf9dc773c
Do not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" from NSObject as allocators.
...
llvm-svn: 50802
2008-05-07 05:34:45 +00:00
Douglas Gregor
caa8acebe7
Diagnose attempts to use C++ default arguments outside of a function declaration
...
llvm-svn: 50799
2008-05-07 04:49:29 +00:00
Ted Kremenek
9930bd8c4f
Be less promiscuous with generating summaries for "new", "copy", "create".
...
llvm-svn: 50798
2008-05-07 04:25:59 +00:00
Ted Kremenek
08eb30f193
Added auto-summary generation for createXXX, copyXXX, newXXX methods.
...
llvm-svn: 50795
2008-05-07 03:45:05 +00:00
Steve Naroff
cab93d58c3
Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end
...
llvm-svn: 50790
2008-05-07 00:06:16 +00:00
Ted Kremenek
b95635e6ec
Fix a few glitches in scan-build with automatically generating class names from bug types.
...
llvm-svn: 50784
2008-05-06 23:51:45 +00:00
Ted Kremenek
e6d2419351
Improve HTMLDiagnostics by understanding the "Below" hint.
...
llvm-svn: 50783
2008-05-06 23:42:18 +00:00
Steve Naroff
29ce4e5d78
Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
...
llvm-svn: 50781
2008-05-06 23:20:07 +00:00
Fariborz Jahanian
eeb7fae063
Print ObjC methods of ObjC classes.
...
llvm-svn: 50779
2008-05-06 23:14:25 +00:00
Ted Kremenek
aec1811c6c
Don't report leaks for autoreleased objects.
...
llvm-svn: 50777
2008-05-06 23:07:13 +00:00
Steve Naroff
ac81a5aad5
Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead of putting them in the preamble?
...
llvm-svn: 50774
2008-05-06 22:45:19 +00:00
Ted Kremenek
aa63ca9272
Added "DisplayHint" to PathDiagnosticPiece to provide a hint for the
...
PathDiagnosticClient of where to display a string (beyond just the SourceLocation).
llvm-svn: 50773
2008-05-06 21:33:07 +00:00
Ted Kremenek
767d0742c7
More comments.
...
"#if 0" out some assumptions when auto-generating method summaries.
llvm-svn: 50772
2008-05-06 21:26:51 +00:00
Devang Patel
243d5cd283
Fix PR2101 - Codegen crash during bitfield initialization.
...
llvm-svn: 50769
2008-05-06 19:57:59 +00:00
Steve Naroff
13e74879b0
Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice when two interfaces use it in same file
...
llvm-svn: 50767
2008-05-06 18:26:51 +00:00
Fariborz Jahanian
6a70e2019b
Test was accidently nullified in previous check-in.
...
llvm-svn: 50758
2008-05-06 18:14:26 +00:00
Ted Kremenek
10427bdbb9
Experiment with not converting bug names to lower case.
...
llvm-svn: 50753
2008-05-06 18:11:36 +00:00
Ted Kremenek
8bcc1bd3d5
More refactorings in GeneratePathDiagnostic: use ExecutionContinues to display
...
"Execution continues..." message, which does a better job at handling corner cases.
llvm-svn: 50751
2008-05-06 18:11:09 +00:00
Fariborz Jahanian
09367d68ff
Patch to refactor setter/getter names of property attributes into Selector
...
(was IdentifierInfo * before). This will make method declartations whole
lot easier.
llvm-svn: 50747
2008-05-06 18:09:04 +00:00
Ted Kremenek
cb2e636606
Generate "stop" summaries for selectors involving receivers whose type is not NSxxxx.
...
llvm-svn: 50721
2008-05-06 15:44:25 +00:00
Ted Kremenek
68f463b88e
Use strncmp correctly.
...
llvm-svn: 50715
2008-05-06 06:17:42 +00:00
Ted Kremenek
5f478e9a0a
Make string comparison legible and remove buffer overrun introduced by typo.
...
llvm-svn: 50714
2008-05-06 06:09:09 +00:00
Ted Kremenek
2f08fedec1
String comparison cleanups.
...
Added test case.
llvm-svn: 50711
2008-05-06 04:28:05 +00:00
Ted Kremenek
041d02201f
Fix logic error in string processing.
...
llvm-svn: 50710
2008-05-06 04:21:38 +00:00
Ted Kremenek
c9f4948bba
Remove assertion.
...
llvm-svn: 50709
2008-05-06 04:21:10 +00:00
Ted Kremenek
015c3561ad
Use EvalSummary to process message expressions, thereby unifying the checker
...
logic for function calls and message expressions.
Use the following heuristic to infer "allocating" instance methods:
[ClassName classWithXXX] allocates an object
Update testcase to reflect this heuristic.
llvm-svn: 50708
2008-05-06 04:20:12 +00:00
Ted Kremenek
bc51f71c5b
Fixed subtle bug in the an GRAuditor object could mark a node as a sink
...
after it was already added to the destination NodeSet.
llvm-svn: 50701
2008-05-06 03:26:52 +00:00
Ted Kremenek
821537ecdb
Added receiver effects to EvalSummary.
...
llvm-svn: 50700
2008-05-06 02:41:27 +00:00
Ted Kremenek
b0862dca6c
Expand summaries to include "Receiver" effects.
...
llvm-svn: 50697
2008-05-06 02:26:56 +00:00
Chris Lattner
dbcc2ca6b2
simplify some builder calls.
...
llvm-svn: 50694
2008-05-06 00:56:42 +00:00
Chris Lattner
222c6123df
remove a stray printout
...
llvm-svn: 50691
2008-05-06 00:44:00 +00:00
Ted Kremenek
be7c56ed78
Added initialization code to generate initial set of ObjC method summaries (non-instance methods).
...
llvm-svn: 50690
2008-05-06 00:38:54 +00:00
Ted Kremenek
0806f910d4
Added code to generate initial set of summaries for instance methods.
...
llvm-svn: 50689
2008-05-06 00:30:21 +00:00
Steve Naroff
125d73dc84
Several fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests). Expect to enable it very soon.
...
llvm-svn: 50688
2008-05-06 00:23:44 +00:00
Ted Kremenek
3d1e972275
Add summary generation for "initXXX" methods.
...
llvm-svn: 50684
2008-05-05 23:55:01 +00:00
Ted Kremenek
046845e842
Make CF retain diagnostics more succinct.
...
In a leak's "name", indicate GC or non-GC bugs.
llvm-svn: 50680
2008-05-05 23:16:31 +00:00
Ted Kremenek
f15cd14a3d
Emit dead store warnings for ++ and -- operators.
...
llvm-svn: 50679
2008-05-05 23:12:21 +00:00
Chris Lattner
4dd2710222
Fix rdar://5905347 a crash on invalid builtin, due to the
...
params not getting installed for builtins when synthesized.
llvm-svn: 50676
2008-05-05 22:18:14 +00:00
Ted Kremenek
00daccdd2a
Initial work on refactoring the CFRefCount checker so that it is more
...
generic and handles reference counts for NSObjects.
llvm-svn: 50674
2008-05-05 22:11:16 +00:00
Chris Lattner
00e2607de2
Add support for -Wimplicit-function-declaration, rdar://5907433
...
llvm-svn: 50672
2008-05-05 21:18:06 +00:00
Chris Lattner
ca2b318233
Fix typo, improve comment.
...
llvm-svn: 50666
2008-05-05 20:09:27 +00:00
Chris Lattner
db65ff7223
Fix a few more bugs in preprocessor expressions w.r.t. ?:. Now I
...
think it is really right. :) This fixes PR2284.
llvm-svn: 50665
2008-05-05 20:07:41 +00:00
Fariborz Jahanian
8d91686b0d
percolate @optional/@required protocols down to ASTs for
...
properties declared in the protocol.
llvm-svn: 50662
2008-05-05 18:51:55 +00:00
Ted Kremenek
627c3074dd
Improve leak diagnostics to not report a leak on the same line where
...
the object was last used. This can be confusing to users.
For example:
// 'y' is leaked
x = foo(y);
instead:
x = foo(y);
// 'y' is leaked
llvm-svn: 50661
2008-05-05 18:50:19 +00:00
Ted Kremenek
3917b82e85
Improved leak diagnostics.
...
llvm-svn: 50657
2008-05-05 17:53:17 +00:00
Ted Kremenek
875db81301
Minor refactorings/cleanups in CF retain checker and added support for NSMakeCollectable.
...
Added test case for NSMakeCollectable.
llvm-svn: 50653
2008-05-05 16:51:50 +00:00
Ted Kremenek
db04a9e967
When reporting branch conditions that evaluate to an uninitialized value,
...
highlight the most nested subexpression that appears most responsible (giving
the user better diagnostic feedback).
Updated test cases to illustrate this feature.
Implements: <rdar://problem/5880443>
llvm-svn: 50647
2008-05-05 15:56:53 +00:00
Chris Lattner
7f5b4fcafa
Fix a bug from when this was a pointer instead of vector.
...
llvm-svn: 50639
2008-05-05 07:03:40 +00:00
Chris Lattner
3565c8e343
Neil pointed out that clang doesn't generate ranges from diagnostics
...
related to pp-expressions. Doing so is pretty simple and this
patch implements it, yielding nice diagnostics like:
t.c:2:7: error: division by zero in preprocessor expression
#if 1 / (0 + 0)
~ ^ ~~~~~~~
t.c:5:14: error: expected ')' in preprocessor expression
#if (412 + 42
~~~~~~~~^
t.c:5:5: error: to match this '('
#if (412 + 42
^
t.c:10:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574
#if (-42 + 0U) / -2
~~~ ^ ~~
t.c:10:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614
#if (-42 + 0U) / -2
~~~~~~~~~~ ^ ~~
5 diagnostics generated.
llvm-svn: 50638
2008-05-05 06:45:50 +00:00
Chris Lattner
3c57f7ebab
fix a bug handling right associative operators that Neil noticed, hopefully
...
the final part of PR2279
llvm-svn: 50635
2008-05-05 04:10:51 +00:00
Chris Lattner
de977c0a5c
Fix PR2281: these two warnings should be promoted to error on
...
pedantic error. Perhaps I should add a class of 'extension' that is
'extension that warns by default', which would be cleaner.
llvm-svn: 50633
2008-05-04 23:52:02 +00:00
Chris Lattner
ca671b0e51
||/&& do not do UAC's either. This silences a bogus warning on #if -1 || 4U.
...
llvm-svn: 50632
2008-05-04 23:46:17 +00:00
Chris Lattner
4af72c76dd
Neil points out that commas don't do UACs either.
...
llvm-svn: 50631
2008-05-04 23:38:48 +00:00
Chris Lattner
d89e458ce0
Fix the rest of PR2279:
...
a) correct rejection of ',' in pp expressions.
b) the precedence of ',' was wrong w.r.t. ?:.
Thanks again to Neil for finding these and providing testcases.
llvm-svn: 50625
2008-05-04 18:36:18 +00:00
Chris Lattner
a08f869c22
Fix PR2279 part C: shifts don't perform the UACs, thanks to Neil
...
for pointing this out.
llvm-svn: 50624
2008-05-04 18:25:32 +00:00
Chris Lattner
1e151816b2
use simplified API for making fp constants.
...
llvm-svn: 50623
2008-05-04 18:23:51 +00:00
Chris Lattner
0a9718eab0
fix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).
...
llvm-svn: 50617
2008-05-04 07:15:21 +00:00
Chris Lattner
7b9293ba20
Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
...
Fix 'swapping' of attributes to not insert null values into the
DeclAttrs map.
llvm-svn: 50612
2008-05-04 02:29:49 +00:00
Chris Lattner
bc22b5b327
if a decl is both 'static' and weak or static and inline, its linkage
...
type should be internal, not weak/linkonce.
llvm-svn: 50611
2008-05-04 01:44:26 +00:00
Chris Lattner
cfcabaeb7f
add testcase for pr2050 which is now fixed.
...
llvm-svn: 50610
2008-05-04 01:13:36 +00:00
Chris Lattner
c8cb4ca202
improve array type comments.
...
llvm-svn: 50609
2008-05-04 01:11:46 +00:00
Chris Lattner
033352b036
add a testcase
...
llvm-svn: 50608
2008-05-04 00:56:25 +00:00
Ted Kremenek
1108d6eef3
Remove debugging statement.
...
llvm-svn: 50598
2008-05-02 23:40:49 +00:00
Ted Kremenek
a5e2df015a
Rename member variable.
...
llvm-svn: 50597
2008-05-02 23:21:21 +00:00
Ted Kremenek
5f56cbbf7d
Output better paths to display in bug reports and compute a common
...
prefix for all files.
llvm-svn: 50592
2008-05-02 22:04:53 +00:00
Fariborz Jahanian
9964c9c64d
Another test case for properties in protocols.
...
llvm-svn: 50589
2008-05-02 21:09:40 +00:00
Ted Kremenek
983be7cee6
Improved diagnostics for leaks: now we report which variable was leaked.
...
llvm-svn: 50588
2008-05-02 20:53:50 +00:00
Fariborz Jahanian
98a6c4fa77
This patch is about merging ObjC2's properties declared in class
...
protocols into class's property list and performing semantics
on them for while doing so.
llvm-svn: 50587
2008-05-02 19:17:30 +00:00
Ted Kremenek
3b33e2544a
Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.
...
llvm-svn: 50585
2008-05-02 18:40:22 +00:00
Ted Kremenek
789942cfda
When running the reference count checker twice (GC and non-GC mode), only emit
...
basic warnings (dead stores, null dereferences) on the first pass.
llvm-svn: 50584
2008-05-02 18:01:49 +00:00
Ted Kremenek
a06e7120bb
Bug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic methods (also did some cosmetic cleanups in the printing output).
...
llvm-svn: 50583
2008-05-02 17:32:38 +00:00
Ted Kremenek
86237c3774
testcase cleanup
...
llvm-svn: 50581
2008-05-02 17:14:07 +00:00
Ted Kremenek
5102a25bf8
Static analysis test case for noreturn on exceptions.
...
llvm-svn: 50580
2008-05-02 17:13:14 +00:00
Ted Kremenek
bb7386aff5
Really noreturn on exceptions.
...
llvm-svn: 50579
2008-05-02 17:12:56 +00:00
Ted Kremenek
0a87d5a0b3
Lexicographically order enum declarations in AttributeList::Kind.
...
llvm-svn: 50577
2008-05-02 16:50:46 +00:00
Ted Kremenek
63d76df236
Fix copy-paste bug.
...
llvm-svn: 50557
2008-05-01 23:38:35 +00:00
Ted Kremenek
2722f36465
Remove no longer valid assertion.
...
llvm-svn: 50556
2008-05-01 23:28:56 +00:00
Ted Kremenek
1097b4c61f
Added line number diagnostics to indicate the allocation site of the leaked object.
...
llvm-svn: 50553
2008-05-01 23:13:35 +00:00
Ted Kremenek
fabfb4677d
Do not highlight bogus ranges for leaks.
...
llvm-svn: 50549
2008-05-01 22:50:36 +00:00
Steve Naroff
f8ecff2a94
Replace Sema::CheckInitializerListTypes() with a helper class (InitListChecker) that synthesizes implicit InitListExpr's when appropriate (see InitListExpr comments in Expr.h for more details). I also moved the code to SemaInit.cpp, to help reduce clutter in SemaDecl.cpp.
...
NOTE: This work is incomplete and still fails many tests (as a result, it isn't enabled yet). Nevertheless, I wanted to check it in so I can work on it from home.
llvm-svn: 50544
2008-05-01 22:18:59 +00:00
Argyrios Kyrtzidis
2be96ae68b
Convert CRLF to LF.
...
llvm-svn: 50542
2008-05-01 21:44:34 +00:00
Ted Kremenek
8a56b06b5c
Correctly invalidate reference count state when passing objects by reference in message expressions we don't understand.
...
llvm-svn: 50541
2008-05-01 21:31:50 +00:00
Ted Kremenek
4f3d7cd12e
Add missing "-" that prefix arguments to forward to clang.
...
llvm-svn: 50540
2008-05-01 21:26:22 +00:00
Argyrios Kyrtzidis
694dda1e4e
Implicitly defined functions were getting the DeclContext of the function where they appeared, causing the bug: http://llvm.org/bugs/show_bug.cgi?id=2266 .
...
Fix it by making implicitly defined functions get the DeclContext of translation unit.
llvm-svn: 50538
2008-05-01 21:04:16 +00:00
Ted Kremenek
7f824734e0
Added temporary fix for Obj-C exception handling in the static analyzer: treat these as panic functions.
...
llvm-svn: 50535
2008-05-01 18:33:28 +00:00
Ted Kremenek
88f8ebdf76
Added default ctor to Selector.
...
REASON: Without a default ctor we cannot do "new Selector[xxx]" and similar
operations with ADTs that need to default constructor selectors.
llvm-svn: 50534
2008-05-01 18:32:59 +00:00
Ted Kremenek
f0b0f2edfe
Renamed static method.
...
llvm-svn: 50533
2008-05-01 18:31:44 +00:00
Fariborz Jahanian
f303bdabdf
Patch to match and issue diagnostics on property type mismatch.
...
llvm-svn: 50532
2008-05-01 18:05:01 +00:00
Ted Kremenek
b99d01269a
Added __assert_rtn to list of panic functions.
...
llvm-svn: 50530
2008-05-01 17:52:49 +00:00
Ted Kremenek
b8861a6ccf
Use pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields". This saves us a pointer.
...
Implemented serialization for ObjCMessageExpr.
llvm-svn: 50528
2008-05-01 17:26:20 +00:00
Ted Kremenek
ed36e4b9a4
Added ziperr as a panic function. Eventually inter-procedural analysis
...
should catch this one easily.
llvm-svn: 50526
2008-05-01 15:55:59 +00:00
Ted Kremenek
aec2b6e360
Added comments to ObjCMessageExpr.
...
llvm-svn: 50525
2008-05-01 15:55:24 +00:00
Ted Kremenek
9f696852c4
When processing "release", "retain", and "autorelease" messages return the
...
lval passed as an argument.
Fix: Inverted diagnostic messages.
llvm-svn: 50513
2008-05-01 04:02:04 +00:00
Ted Kremenek
4828aa3152
Added support for "autorelease" message in CF ref. count checker.
...
llvm-svn: 50512
2008-05-01 02:18:37 +00:00
Steve Naroff
20348b5653
Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initializer rewrite I am doing).
...
llvm-svn: 50511
2008-05-01 02:04:18 +00:00
Fariborz Jahanian
7cf18862c2
More ObjC2 property semantics work. Work in progress.
...
llvm-svn: 50508
2008-05-01 00:03:38 +00:00
Ted Kremenek
b0f87c48cb
added preliminary diagnostics in scan-build results to denote whether
...
a CF memory leak occurred with GC enabled, etc.
llvm-svn: 50507
2008-04-30 23:47:44 +00:00
Ted Kremenek
0ae9ed7fab
scan-build: Disable distributed builds for xcodebuild
...
llvm-svn: 50506
2008-04-30 23:47:12 +00:00
Ted Kremenek
f20e2285c9
More cleanups with ObjCQualifiedIdType in the static analyzer.
...
llvm-svn: 50503
2008-04-30 22:48:21 +00:00
Ted Kremenek
a16dacb6aa
Add placeholder code in the static analyzer for MemberExprs involving struct temporaries.
...
llvm-svn: 50502
2008-04-30 22:17:15 +00:00
Ted Kremenek
ca67cab1e8
Add workaround for __builtin_offsetof in the static analyzer.
...
llvm-svn: 50500
2008-04-30 21:45:55 +00:00
Ted Kremenek
99057462aa
Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof of a ObjCInterfaceType.
...
llvm-svn: 50499
2008-04-30 21:31:12 +00:00
Ted Kremenek
e0e8b535cf
Support implicit casts from pointers to references.
...
llvm-svn: 50498
2008-04-30 21:10:19 +00:00
Ted Kremenek
84dea154fc
When creating LVals for array entries, canonicalize entries with a 0 index.
...
llvm-svn: 50497
2008-04-30 21:05:35 +00:00
Ted Kremenek
20d8006e93
Teach more of the static analyzer about ObjCQualifiedIdType.
...
llvm-svn: 50494
2008-04-30 20:17:27 +00:00
Ted Kremenek
0940b99e3b
Teach the static analysis engine about ObjCQualifiedIdType.
...
llvm-svn: 50493
2008-04-30 20:01:29 +00:00
Ted Kremenek
5ce35cc514
Add conjured symbols for decl initializations.
...
Add db_error as panic function.
llvm-svn: 50489
2008-04-30 17:54:04 +00:00
Ted Kremenek
39a736f723
Handle lval::ArrayOffset and lval::FieldOffset in EvalNE and EvalEQ.
...
llvm-svn: 50486
2008-04-30 16:07:22 +00:00
Chris Lattner
dd477ce32b
Verify the whole module after codegen to catch silly IR bugs.
...
llvm-svn: 50485
2008-04-30 16:05:42 +00:00
Chris Lattner
e16406d2b1
fix 'var unused' warning.
...
llvm-svn: 50484
2008-04-30 16:04:01 +00:00
Ted Kremenek
772d9f0aae
Added test case for the static analyzer.
...
llvm-svn: 50467
2008-04-30 04:40:48 +00:00
Ted Kremenek
5cc9e60a5f
Invalidate old subexpression bindings when binding UnknownVal.
...
llvm-svn: 50466
2008-04-30 04:23:07 +00:00
Ted Kremenek
9700bd42f0
Simplify RemoveDeadBindings.
...
llvm-svn: 50458
2008-04-29 23:58:03 +00:00
Ted Kremenek
10bad41159
Added test case to test null dereference checking with lval::ArrayOffset.
...
llvm-svn: 50454
2008-04-29 23:25:09 +00:00
Ted Kremenek
10246e8bfa
Add lval::ArrayOffset, which represent the locations of entries in an array.
...
llvm-svn: 50453
2008-04-29 23:24:44 +00:00
Fariborz Jahanian
2dfcec129f
Default visbility for instance variables is protected.
...
Patch by Emerson Murhpy-Hill.
llvm-svn: 50452
2008-04-29 23:03:51 +00:00
Ted Kremenek
0d2ccffa83
Added lval::FieldOffset, which represents symbolic lvalues for field offsets from other Lvalues.
...
This removes the failure in null-deref-ps.c (test suite).
llvm-svn: 50449
2008-04-29 22:17:41 +00:00
Ted Kremenek
fa5a3d0fe7
Major rewrite/refactoring of static analysis engine. We now use
...
EvalStore/EvalLoad to handle all loads/stores from symbolic memory, allowing us
to do checks for null dereferences, etc., at any arbitrary load/store (these
were missed checks before). This also resulted in some major cleanups, some
conceptual, and others just in the structure of the code.
This temporarily introduces a regression in the test suite (null-deref-ps.c)
before I add a new LVal type for structure fields.
llvm-svn: 50443
2008-04-29 21:04:26 +00:00
Ted Kremenek
a8197366db
Pass fobjc-gc-only and fobjc-gc options down to clang.
...
llvm-svn: 50426
2008-04-29 16:24:23 +00:00
Ted Kremenek
a374ea9a35
Update typestate logic to support GC-mode.
...
llvm-svn: 50396
2008-04-29 05:44:10 +00:00
Ted Kremenek
4b7ca776cf
Implement semantics of CFMakeCollectable for the CF-reference count checker.
...
llvm-svn: 50395
2008-04-29 05:33:51 +00:00
Ted Kremenek
4d1f422c6f
Provide the option to run the CF-retain checker in GC enabled mode.
...
The transfer functions for the checker don't do anything special yet in GC mode.
llvm-svn: 50394
2008-04-29 05:13:59 +00:00
Ted Kremenek
25a3b878e5
Convert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
...
llvm-svn: 50388
2008-04-29 04:43:50 +00:00
Ted Kremenek
d796c18d7b
Add -fobjc-gc and -fobjc-gc-only options to the driver.
...
Add corresponding enum in LangOptions.
llvm-svn: 50387
2008-04-29 04:37:03 +00:00
Ted Kremenek
6065ef6b9b
Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
...
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.
Fixes: <rdar://problem/5892265>
llvm-svn: 50364
2008-04-28 18:00:46 +00:00
Argyrios Kyrtzidis
8eab584388
Call ExitScope before ActOnFinishNamespaceDef.
...
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope.
llvm-svn: 50322
2008-04-27 14:10:57 +00:00
Argyrios Kyrtzidis
081148986a
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.
llvm-svn: 50321
2008-04-27 13:50:30 +00:00
Argyrios Kyrtzidis
ed1eec4812
Use PushOnScopeChains to introduce a decl into scope.
...
llvm-svn: 50320
2008-04-27 13:30:35 +00:00
Argyrios Kyrtzidis
fa2d2f2886
Make assertions for all addresses passed to ProgramPoint that they have at least an 8-byte alignment.
...
llvm-svn: 50310
2008-04-26 15:19:51 +00:00
Ted Kremenek
e5aa10cec4
Pass down more -iXXX options that clang supports
...
llvm-svn: 50304
2008-04-25 21:28:20 +00:00
Ted Kremenek
d71ba91a7d
fix broken tag
...
llvm-svn: 50299
2008-04-25 20:31:58 +00:00
Ted Kremenek
c7dde7a25b
Another link fix.
...
llvm-svn: 50298
2008-04-25 20:30:34 +00:00
Ted Kremenek
d6db434162
Fix links.
...
llvm-svn: 50297
2008-04-25 20:29:37 +00:00
Ted Kremenek
dd38e0bd0d
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>.
llvm-svn: 50286
2008-04-25 19:01:27 +00:00
Ted Kremenek
6d2eeddff5
Added some notes about the LLVM "checker". This isn't a public link yet; still refining.
...
llvm-svn: 50283
2008-04-25 18:44:36 +00:00
Chris Lattner
73669defed
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).
llvm-svn: 50263
2008-04-25 15:47:13 +00:00
Nuno Lopes
0276933b4b
initial support for recognizing __transparent_union__ attributes
...
comments on the ML will follow
llvm-svn: 50262
2008-04-25 09:32:00 +00:00
Ted Kremenek
99131c9f5a
Handle dereferences of function pointers (which return a handle to the function).
...
llvm-svn: 50246
2008-04-25 01:56:50 +00:00
Ted Kremenek
2e5092320e
Don't abort on GetRVal when the LVal is a StringLiteralVal.
...
llvm-svn: 50245
2008-04-25 01:45:38 +00:00
Ted Kremenek
4dd412e022
Don't emit empty strings for path diagnostics when taking the default branch of a switch statement that has no label.
...
llvm-svn: 50242
2008-04-25 01:29:56 +00:00
Ted Kremenek
ecbdf75049
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.
llvm-svn: 50241
2008-04-25 01:25:15 +00:00
Ted Kremenek
b0daf2f6f5
Add preliminary support for flagging leaks around when they happen (doesn't work yet).
...
llvm-svn: 50237
2008-04-24 23:57:27 +00:00
Ted Kremenek
64fa3beccc
Better handling for directory names in HTML diagnostics. Work in progress.
...
llvm-svn: 50234
2008-04-24 23:37:03 +00:00
Ted Kremenek
ae8014cb7e
More boilerplate for handling specialized-transfer function logic for dead symbols.
...
llvm-svn: 50233
2008-04-24 23:35:58 +00:00
Fariborz Jahanian
0a070ff570
Patch to diagnose inconsistancies between properties declared in current and
...
its super class. This patch is incomplete.
llvm-svn: 50228
2008-04-24 19:58:34 +00:00
Ted Kremenek
3812b7676c
Added initial boilerplate in GRExprEngine to allow checker-specific transfer
...
function logic to act when symbols become dead.
llvm-svn: 50221
2008-04-24 18:31:42 +00:00
Ted Kremenek
6e06f91085
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>.
llvm-svn: 50220
2008-04-24 18:28:14 +00:00
Ted Kremenek
78120c8b3a
Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).
...
llvm-svn: 50219
2008-04-24 18:17:14 +00:00
Ted Kremenek
f7141597e8
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.
llvm-svn: 50214
2008-04-24 17:22:33 +00:00
Ted Kremenek
b44485b835
Have ValidateOutputConstraint return false instead of firing an assertion
...
when processing a constraint we don't understand. This allows the frontend
to gracefully fail.
llvm-svn: 50213
2008-04-24 16:36:38 +00:00
Ted Kremenek
21bf6006b0
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>.
llvm-svn: 50197
2008-04-23 23:35:07 +00:00
Ted Kremenek
05e6267466
Fix minor regression in bug report generation.
...
llvm-svn: 50195
2008-04-23 23:04:32 +00:00
Ted Kremenek
f26bc55b9a
When building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with a single path that BugReport objects can safely walk and introspect.
...
llvm-svn: 50194
2008-04-23 23:02:12 +00:00
Ted Kremenek
dd43aeee54
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.
llvm-svn: 50176
2008-04-23 20:12:28 +00:00
Ted Kremenek
467297ab48
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.
llvm-svn: 50149
2008-04-23 16:25:39 +00:00
Ted Kremenek
d2419a0730
Remove false path where the default branch in a switch statement would
...
always be taken even if it was not feasible.
llvm-svn: 50132
2008-04-23 05:03:18 +00:00
Chris Lattner
68a27fac9d
fix a rewriter crash on zero length files.
...
llvm-svn: 50126
2008-04-23 03:21:50 +00:00
Ted Kremenek
ef9af73887
Added panic function "assfail".
...
llvm-svn: 50119
2008-04-23 00:41:25 +00:00
Fariborz Jahanian
6efdf1ddab
Patch to build AST for property implementation declarations and
...
to print declaration from its AST.
llvm-svn: 50117
2008-04-23 00:06:01 +00:00
Ted Kremenek
0224ac57e0
For default branches in switch statements with no default label, print out
...
the line we are going to.
llvm-svn: 50113
2008-04-22 22:29:46 +00:00
Ted Kremenek
3b42715930
Rewrote VisitDeclStmt to properly handle initializers that can do anything.
...
llvm-svn: 50112
2008-04-22 22:25:27 +00:00
Ted Kremenek
c79c0591d6
Added lval type (and tracking) for StringLiterals.
...
llvm-svn: 50109
2008-04-22 21:39:21 +00:00
Ted Kremenek
eccf3e5821
Added "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowing us to track lvals when they are casted back to pointers.
...
llvm-svn: 50108
2008-04-22 21:10:18 +00:00
Chris Lattner
bec41348e2
"This patch renames
...
DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC
It makes the code more consistent."
Patch by Zhongxing Xu!
llvm-svn: 50105
2008-04-22 18:39:57 +00:00
Ted Kremenek
9718c9e8ee
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).
llvm-svn: 50102
2008-04-22 16:15:03 +00:00
Argyrios Kyrtzidis
901a4e406b
Use back() instead of end()-1
...
llvm-svn: 50098
2008-04-22 07:37:18 +00:00
Ted Kremenek
80f2c111bd
Added panic function "dtrace_assfail".
...
llvm-svn: 50091
2008-04-22 06:09:33 +00:00
Ted Kremenek
24d4888a85
Add VisitArraySubscriptExpr.
...
llvm-svn: 50090
2008-04-22 05:40:28 +00:00
Ted Kremenek
a2cca7dbdf
Hardcode "Assert" as a no-return function (panic).
...
llvm-svn: 50089
2008-04-22 05:37:33 +00:00
Nate Begeman
2908fa0715
Add some basic ARM asm constraints
...
llvm-svn: 50085
2008-04-22 05:03:19 +00:00
Ted Kremenek
6fdd3b35dc
Added null dereference test involving arrays.
...
llvm-svn: 50084
2008-04-22 04:56:55 +00:00
Ted Kremenek
da5cdda248
Added null-dereference check for ArraySubscriptExpr.
...
llvm-svn: 50083
2008-04-22 04:56:29 +00:00
Nate Begeman
f0168bd208
Don't double-increment counter for -arch and -isysroot
...
llvm-svn: 50082
2008-04-22 04:47:32 +00:00
Fariborz Jahanian
a591a12ea5
Allow property in base class to be implemented in a
...
derived class.
llvm-svn: 50074
2008-04-21 23:57:08 +00:00
Ted Kremenek
efa92f1dfc
Added missing expected-warning.
...
llvm-svn: 50073
2008-04-21 23:45:26 +00:00
Ted Kremenek
503924bb9c
Added null dereference test case looking for null dereferences involving MemberExpr.
...
llvm-svn: 50072
2008-04-21 23:44:17 +00:00
Ted Kremenek
38213f9573
Added support for detected bad dereferences involving MemberExprs, e.g. x->f where "x" is NULL.
...
llvm-svn: 50071
2008-04-21 23:43:38 +00:00
Ted Kremenek
405cf2daf9
Remove unused "verbose" argument to compile(). Also unbreaks ccc-analyzer.
...
llvm-svn: 50066
2008-04-21 21:58:05 +00:00
Fariborz Jahanian
c6bec7b6dc
More semantics checks of properties. Property implementation can implicitly use
...
ivar of same name.
Better diagnostics to bring home this point.
llvm-svn: 50065
2008-04-21 21:57:36 +00:00
Fariborz Jahanian
f2a7d7c949
Support for @dynamic AST build.
...
More property semantics checking.
First test case for ObjC2's property implementation.
llvm-svn: 50057
2008-04-21 21:05:54 +00:00
Ted Kremenek
74a58d780a
Pass "-arch" down to clang.
...
llvm-svn: 50056
2008-04-21 20:28:01 +00:00
Chris Lattner
0dcd9aa8fd
Fix pasto, thanks to Anders for pointing this out.
...
llvm-svn: 50055
2008-04-21 20:19:54 +00:00
Fariborz Jahanian
a054e99fa8
Continuation of work on ObjC2's properties.
...
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.
llvm-svn: 50050
2008-04-21 19:04:53 +00:00
Chris Lattner
17df24e736
add arm support
...
llvm-svn: 50049
2008-04-21 18:56:49 +00:00
Douglas Gregor
89f238cbe1
Clean up handling of function redeclarations
...
llvm-svn: 50021
2008-04-21 02:02:58 +00:00
Ted Kremenek
5fa90e49a9
Fix improper dereference of end() iterator. Patch by Argiris Kirtzidis!
...
llvm-svn: 50012
2008-04-20 23:54:24 +00:00
Nate Begeman
1c906206b8
Fix PR2236
...
Add test
Implement feedback from Chris re: PR1998
llvm-svn: 50001
2008-04-20 20:38:08 +00:00
Chris Lattner
14cd1ee95f
Two improvements to initializer parsing:
...
1. If we hit a semantic error, try harder to recover to emit
diagnostics for later initializer errors (PR2241).
2. Don't leak parsed initializers on an error.
llvm-svn: 49998
2008-04-20 19:07:56 +00:00
Chris Lattner
4885b97664
for exponent-related errors, emit the diagnostic on the 'e' or 'p'.
...
llvm-svn: 49997
2008-04-20 18:47:55 +00:00
Chris Lattner
48a9b9beeb
when emitting diagnostics about some character in a numeric
...
literal, indicate what character the error is about or where
it would be. For example:
pr2241.c:1:17: error: exponent has no digits
float f[] = { 1e , 1ee0 };
^
llvm-svn: 49996
2008-04-20 18:41:46 +00:00
Nate Begeman
8e8d498d34
Only generate code for static functions and global variables that are actually used.
...
Warn about unused static functions and variables.
This fixes PR1998.
llvm-svn: 49987
2008-04-20 06:29:50 +00:00
Chris Lattner
2cc4e23252
Restructure and simplify Sema::ObjCQualifiedIdTypesAreCompatible,
...
deleting dead code, making other code more obvious, and fixing a
bug. This fixes these (bogus) warnings in release mode:
SemaExprObjC.cpp:383: warning: 'RHSProtoE' may be used uninitialized in this function
SemaExprObjC.cpp:383: warning: 'RHSProtoI' may be used uninitialized in this function
llvm-svn: 49984
2008-04-20 02:09:31 +00:00
Ted Kremenek
076d13387d
html::EscapeText (using the Rewriter) now replaces tabs by default.
...
llvm-svn: 49982
2008-04-20 01:02:33 +00:00
Chris Lattner
ff2367c0c9
implement a fixme, add support for ++/-- on long double.
...
llvm-svn: 49980
2008-04-20 00:50:39 +00:00
Chris Lattner
1886e71e47
use simplified ConstantFP:get method.
...
llvm-svn: 49979
2008-04-20 00:45:53 +00:00
Chris Lattner
1e517a78a8
replace form feeds with an <hr> tag.
...
llvm-svn: 49975
2008-04-19 23:56:30 +00:00
Chris Lattner
1a44f7fce9
simplify the return of InitializePreprocessor to be bool instead of a fileid
...
llvm-svn: 49974
2008-04-19 23:25:44 +00:00
Chris Lattner
ba1f37bfdf
simplify ownership of the predefines buffer.
...
llvm-svn: 49973
2008-04-19 23:09:31 +00:00
Ted Kremenek
575f24ef73
Gracefully handle when the receiver of a message expression is not a pointer type.
...
llvm-svn: 49959
2008-04-19 19:12:50 +00:00
Ted Kremenek
31d2176d1e
Pass "-isysroot" option down to clang.
...
llvm-svn: 49956
2008-04-19 18:42:26 +00:00
Ted Kremenek
6267835f57
Fix spelling/grammar in comment.
...
llvm-svn: 49955
2008-04-19 18:07:44 +00:00
Ted Kremenek
b0fa31cefb
Use Digest::MD5 (a Perl module that should come bundled standard with Perl) to compute file digests instead of using the external program "sha1sum" (which may not be present).
...
llvm-svn: 49954
2008-04-19 18:05:48 +00:00
Nate Begeman
faae081131
Generate code for annotation attributes.
...
llvm-svn: 49951
2008-04-19 04:17:09 +00:00
Nate Begeman
7fab578b0d
Add support to module codegen for adding and emitting annotations
...
llvm-svn: 49944
2008-04-18 23:43:57 +00:00
Nate Begeman
46bd037c07
Ignore qualifiers when attempting to match arguments to parameter types for
...
__builtin_overload
llvm-svn: 49943
2008-04-18 23:35:14 +00:00
Nate Begeman
ce4d7fce6b
OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
...
llvm-svn: 49942
2008-04-18 23:10:10 +00:00
Ted Kremenek
423edc2384
Another bug fix in emitting warnings without a path: construct a unit PathDiagnostic as we did
...
before. This allows the HTMLDiagnostic object to retrieve the bug type, bug description, etc.
llvm-svn: 49939
2008-04-18 22:56:53 +00:00
Nuno Lopes
42dd577238
fix __attribute__(format) for struct function pointer fields
...
llvm-svn: 49938
2008-04-18 22:43:39 +00:00
Steve Naroff
472cf88ef2
Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast).
...
llvm-svn: 49935
2008-04-18 22:15:15 +00:00
Ted Kremenek
bf27dc9659
Reenable using the PathDiagnosticClient for BugReports without paths.
...
llvm-svn: 49934
2008-04-18 22:11:59 +00:00
Ted Kremenek
cf9e9c5554
Use 'clang' binary in the same dir as scan-build; if it isn't there use the one in the path
...
llvm-svn: 49933
2008-04-18 22:00:56 +00:00
Steve Naroff
24840f6748
Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs outside a method are being rewritten
...
llvm-svn: 49932
2008-04-18 21:55:08 +00:00
Ted Kremenek
8886b3021e
Turn on CF reference count checker.
...
llvm-svn: 49931
2008-04-18 21:53:01 +00:00
Steve Naroff
dcdcdcdfef
Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being rewritten properly.
...
llvm-svn: 49925
2008-04-18 21:13:19 +00:00
Ted Kremenek
31484b2477
Generalize caching mechanism for bugs reports. Now individual BugTypes
...
can decide the policy on how to cache related bugs. This allows us to
properly to handle warning about multiple leaks in the same location in the
ref count checker (not yet done).
llvm-svn: 49918
2008-04-18 20:54:29 +00:00
Ted Kremenek
c072b820cf
Fixed more caching bugs related to the one fixed in r49914. Silence
...
compiler warning introduced by a recent patch of mine.
llvm-svn: 49917
2008-04-18 20:35:30 +00:00
Ted Kremenek
acefba896c
Fixed elusive caching bug that led to false positives.
...
llvm-svn: 49914
2008-04-18 19:34:16 +00:00
Ted Kremenek
4d83728a57
Added "GetErrorNodes()" to BugType so that -trim-egraph can recognize errors
...
from registered BugTypes. This helps with debugging.
Add detection of NULL values in ref count checker; this suppresses false positives.
llvm-svn: 49912
2008-04-18 19:23:43 +00:00
Ted Kremenek
3388381993
Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluating
...
the checker-specific logic of symbolic assumptions.
llvm-svn: 49910
2008-04-18 17:20:23 +00:00
Nate Begeman
65bea23674
Tabs -> spaces
...
llvm-svn: 49909
2008-04-18 17:17:24 +00:00
Ted Kremenek
532ba14fdb
Spelling fix.
...
llvm-svn: 49908
2008-04-18 16:58:34 +00:00
Ted Kremenek
d004c418b6
Fixed bug in GREndPathNodeBuilder: only return a node if it wasn't in the node cache.
...
llvm-svn: 49907
2008-04-18 16:30:14 +00:00
Ted Kremenek
b06817e914
scan-build now fixes permissions of report files and directories, which may
...
be created as "temporary files" that are not world readable.
llvm-svn: 49904
2008-04-18 15:18:20 +00:00
Ted Kremenek
4bf02a0856
Compute a digest of each report file, and nuke reports that have the same
...
digest as a file already added to the index. This a workaround for the
analyzer analyzing the same file more than once, which can happen when building
multiple targets.
llvm-svn: 49903
2008-04-18 15:09:30 +00:00
Nate Begeman
c00bed3871
Initialize default double width and alignment
...
llvm-svn: 49899
2008-04-18 05:49:49 +00:00
Nate Begeman
26ed25253e
Allow targets to override double size, alignment, and semantics, and tie this
...
information into the IR type codegen. This allows a target to codegen the C
'double' type as either double or float.
llvm-svn: 49898
2008-04-18 05:41:31 +00:00
Ted Kremenek
71c41d9561
Restore macro expansion for HTMLPrint by using the original Preprocessor.
...
This is a workaround until we figure out why a freshly create Preprocessor
doesn't expand macros from headers.
llvm-svn: 49897
2008-04-18 05:35:23 +00:00
Ted Kremenek
a960be4bd4
Provide a version of html::HighlightMacros that takes a Preprocessor&.
...
llvm-svn: 49896
2008-04-18 05:34:33 +00:00
Ted Kremenek
f03e07c34d
More grammar fixes.
...
llvm-svn: 49895
2008-04-18 05:32:44 +00:00
Ted Kremenek
ca8892b456
Fix plurality debacle.
...
llvm-svn: 49894
2008-04-18 05:13:26 +00:00
Ted Kremenek
9e48b0c4ed
Fixed range highlighting bug in HTML diagnostics.
...
llvm-svn: 49893
2008-04-18 05:01:33 +00:00
Ted Kremenek
40d601f958
Added path diagnostics for reference counts.
...
llvm-svn: 49892
2008-04-18 04:55:01 +00:00
Chris Lattner
4bbd164a7a
Make tab insertion really right: the number of spaces inserted
...
depends on the column number of the start of the tab.
llvm-svn: 49891
2008-04-18 04:54:20 +00:00
Ted Kremenek
c88fb63da0
Several Expr subclasses did not mark "getSourceRange()" virtual. Fixed.
...
llvm-svn: 49890
2008-04-18 04:18:16 +00:00
Ted Kremenek
396f43620f
BugReport::VisitNode now takes BugReporter& instead of ASTContext&.
...
Shuffled around code in CFRefCount to better pair classes with implementation,
and started adding subclasses of RangedBugReport to handle better diagnostics
for reference count bugs.
llvm-svn: 49889
2008-04-18 03:39:05 +00:00
Ted Kremenek
a3d02636ef
Use HTML5 doctype when generating HTML.
...
llvm-svn: 49888
2008-04-18 03:37:38 +00:00
Ted Kremenek
89e6a9b98c
Added null check.
...
llvm-svn: 49887
2008-04-18 02:24:50 +00:00
Ted Kremenek
a821e087de
Updated CSS colors. Patch by Cedric Venet!
...
llvm-svn: 49886
2008-04-18 02:12:39 +00:00
Ted Kremenek
217e9bff2b
Added test cases to test for reference count leaks.
...
llvm-svn: 49885
2008-04-18 02:00:02 +00:00
Ted Kremenek
cffe635699
Simplified internal logic of BugReporter, consolidating EmitWarning and
...
EmitPathWarning into one method. We now properly handle emitting warnings
without a PathDiagnosticClient when the warning does not involve a particular
statement.
llvm-svn: 49884
2008-04-18 01:56:37 +00:00
Fariborz Jahanian
d83bdd3841
Fixed a bug in categories and properties.
...
llvm-svn: 49883
2008-04-18 00:30:47 +00:00
Fariborz Jahanian
ffe97a3925
Initial work for property implementation declarations.
...
Mostly semantic checking in this patch. This is on going
and incomplete.
llvm-svn: 49882
2008-04-18 00:19:30 +00:00
Steve Naroff
be89ba0c38
Update VC++ project files.
...
llvm-svn: 49881
2008-04-17 23:51:38 +00:00
Ted Kremenek
69049c272f
Modified BugReport::getEndPath() to handle the case where end path is at
...
the exit block of the CFG.
llvm-svn: 49880
2008-04-17 23:44:37 +00:00
Ted Kremenek
cc0951bde1
Hook up reporting reference count memory leaks to the BugReporter mechanism.
...
llvm-svn: 49879
2008-04-17 23:43:50 +00:00
Chris Lattner
54349c5f4d
Fix a problem noticed by Nuno, where we wouldn't escape characters in
...
macro expansions.
llvm-svn: 49877
2008-04-17 23:03:14 +00:00
Ted Kremenek
f42f3fb47d
class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.
...
clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
passes it to the preprocessor object.
clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main().
html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new
Preprocessor to highlight macros.
class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros().
Updated clients of HTMLDiagnostics to use this new interface.
llvm-svn: 49875
2008-04-17 22:31:54 +00:00
Chris Lattner
7c7e9b3bbe
Handle text escaping (e.g. & -> &) last, to avoid interactions between 'replace' operations and insert operations. This fixes a problem with "&;&" on line 666 of the gcc.c example I sent out.
...
llvm-svn: 49874
2008-04-17 22:24:51 +00:00
Ted Kremenek
306492d8cb
Generate the Preprocessor using a local PreprocessorFactory object.
...
While this adds no extra functionality now, we will soon pass the
PreprocessorFactory object to some ASTConsumers.
llvm-svn: 49873
2008-04-17 21:38:34 +00:00
Chris Lattner
6929bd8047
don't give macros a background
...
llvm-svn: 49871
2008-04-17 21:32:46 +00:00
Chris Lattner
f219126107
Make sure popup is on top over other spans. wrap long line.
...
llvm-svn: 49870
2008-04-17 21:28:41 +00:00
Ted Kremenek
219bab3be9
Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand.
...
llvm-svn: 49868
2008-04-17 21:23:07 +00:00
Ted Kremenek
c2c08caf9c
Add support in HTML macro expansion for hovering over a macro and automatically
...
expanding its definition. This is a pure CSS solution.
Tested on IE7, Firefox 3b4, and Safari 3.1.
Patch by Cedric Venet!
llvm-svn: 49865
2008-04-17 19:57:27 +00:00
Ted Kremenek
aabc986766
Temporarily disable macro expansion in the HTML output of HTMLDiagnostics to
...
avoid corrupting Preprocessor state. Working on a fix.
llvm-svn: 49864
2008-04-17 18:39:57 +00:00
Ted Kremenek
8bb90b8152
HAve HTMLDiagnostics use html::HighlightRange to highlight message ranges.
...
llvm-svn: 49863
2008-04-17 18:37:23 +00:00
Fariborz Jahanian
8e36cddde0
Added property decl support for protocols.
...
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.
llvm-svn: 49862
2008-04-17 18:25:18 +00:00
Ted Kremenek
a506fec90a
Added transfer function support for ReturnStmt to support detecting leaks
...
involving objects that are returned but have an excessive reference count.
llvm-svn: 49861
2008-04-17 18:12:53 +00:00
Nate Begeman
36c49278b5
Allow redirecting text diagnostic printer output to any llvm::OStream, rather
...
than hard coding llvm::cerr.
llvm-svn: 49860
2008-04-17 18:06:57 +00:00
Argyrios Kyrtzidis
6d05303342
Use TranslationUnitDecl as DeclContext of builtin functions.
...
llvm-svn: 49856
2008-04-17 14:47:13 +00:00
Argyrios Kyrtzidis
c3b69ae815
Addition of TranslationUnitDecl to the AST:
...
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope
llvm-svn: 49855
2008-04-17 14:40:12 +00:00
Argyrios Kyrtzidis
fc2f058230
Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"
...
llvm-svn: 49853
2008-04-17 13:52:22 +00:00
Chris Lattner
f1c70d79b8
insert macro expansions into floating divs. For now, they are always displayed,
...
but we want some javascript or something toggle their display.
llvm-svn: 49836
2008-04-17 00:40:45 +00:00