Ted Kremenek
f9561e51e8
Fix regression introduced by my last commit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 20:23:24 +00:00
Ted Kremenek
a0df99ff6f
Changed behavior of how we handle "NULL" summaries: just call
...
GRSimpleVals::EvalCal(), and don't change reference counts.
Remove "getDoNothingSummary()", as a NULL summary does the same thing.
Added temporary hack for the "Get" rule for objects that return a pointer type:
treat them as non-owned CF objects.
Added test case to detect the release of a non-owned object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 20:11:19 +00:00
Steve Naroff
d6a07aaf62
Add class and super class location info to ObjCInterfaceDecl...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 19:35:35 +00:00
Ted Kremenek
bcf50ad8c7
Use RangedBugReport to report better ranges for reference count errors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:40:51 +00:00
Ted Kremenek
5e55cda64f
Added "RangedBugReport".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:40:29 +00:00
Ted Kremenek
405cbb48a7
Update Xcode project with missing files.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:30:21 +00:00
Sam Bishop
1bb19638f2
Invoke destructors in Decl::Destroy().
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:04:39 +00:00
Fariborz Jahanian
45bc03f920
Minor changes per Chris L's review.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:55:42 +00:00
Chris Lattner
8fa3078cfe
don't read off the front of the buffer. Thanks to Sam for pointing this out.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:20:41 +00:00
Sam Bishop
bb45c512e0
Stub out and start using a Decl::Destroy() method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 15:01:25 +00:00
Sam Bishop
f3c63ae44e
Use the ASTContext allocator when creating deserialized Decl objects.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 14:49:10 +00:00
Chris Lattner
a2f42b1d18
two new files for previous patch, by Argiris Kirtzidis
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 07:06:57 +00:00
Chris Lattner
7f925cc107
Switch sema to maintaining its own scope chain information for variable
...
shadowing, instead of threading it through the AST. This patch contributed
by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 07:00:53 +00:00
Chris Lattner
8808f0020f
Fix rdar://5843510 don't assert and die when an invalid output
...
file is specified, print a happy little error message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 06:14:11 +00:00
Ted Kremenek
940b1d85d3
Fixed some logic errors in the CF ref count checker; we now can detect simple
...
use-after-release errors. Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49509 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:44:06 +00:00
Fariborz Jahanian
1d78cc4430
Patch for:
...
1) objc ivar processing is split out of ActOnField into its own ActOnIvar method.
2) the new objc ivar action takes visibility info directly, eliminating
AllVisibilities in ParseObjCClassInstanceVariables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:32:45 +00:00
Ted Kremenek
61b9f870cc
Simplify CF ref. count checker state machine.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:09:18 +00:00
Ted Kremenek
3ea0b6a087
Fix some bonehead bugs in summary generation in CFRefCount.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:58:08 +00:00
Ted Kremenek
7d311abfc2
Used --checker-simple.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:17:23 +00:00
Ted Kremenek
d71ed26dd8
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
...
code path in the clang driver.
Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:16:52 +00:00
Chris Lattner
ebe457c344
reduce the amount of 'C++ magic' this code depends on :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:37:40 +00:00
Ted Kremenek
f84afb77a0
CFRefCount analysis now properly calls "EmitWarnings" after analyzing a function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:21:09 +00:00
Ted Kremenek
4bb6ac2bb6
When not emitting path diagnostics in BugReporter::EmitWarning(), use the
...
BugReport-specific SourceRanges (when available).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:12:38 +00:00
Ted Kremenek
4d35dacf85
Fixed regressions in error reporting due to copy-paste errors (using the "begin"
...
iterator instead of "end") and not implementing "getDescription()" for Nil
argument checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:05:13 +00:00
Chris Lattner
e13594279a
refactor Parser::ParseStructDeclaration to return a vector of uninterpreted
...
declarators. This allows the clients (C structs, objc classes, objc
properties, [future] C++ classes) etc, to do custom processing before invoking
an action.
This has two benefits in the short term:
1) objc ivar processing should be split out of ActOnField into its own ActOn method.
2) the new objc ivar action can take visibility info directly, eliminating
AllVisibilities in ParseObjCClassInstanceVariables.
3) objc properties can pass their own special sauce down to sema as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 06:46:29 +00:00
Chris Lattner
60b1e3ebe4
Simplify lifetime of location object.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 06:15:14 +00:00
Eric Christopher
97d0205d16
Fix typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 05:23:15 +00:00
Chris Lattner
def026a193
typedef void T;
...
void f(T);
is only invalid in C++ mode, not C89 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:26:16 +00:00
Chris Lattner
8123a95c33
Several improvements from Doug Gregor related to default
...
argument handling. I'll fix up the c89 (void) thing next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:22:51 +00:00
Ted Kremenek
05cbe1a44e
Hooked up initial reference-count checks to the BugReporter interface.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 23:49:11 +00:00
Ted Kremenek
50a6d0ce34
Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.
...
Bugs are now reported using a combination of "BugType" (previously
BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which
generates PathDiagnostics). This provides a far more modular way of registering
bug types and plugging in diagnostics.
GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the
ExplodedGraph.
ExplodedGraph is no longer templated on the "checker", but instead on the state
contained in the nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 21:41:14 +00:00
Ted Kremenek
2979ec73b4
The dtor CGObjCRuntime::~CGObjCRuntime() was implemented twice, once
...
in CGObjCGNU.cpp and once in CGObjCEtoile.cpp. Moved its definition to
CGObjC.cpp. This resolves a build error in Xcode, and also cleans things up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:51:31 +00:00
Ted Kremenek
393be155a8
Add SemaDeclCXX.cpp to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:50:11 +00:00
Ted Kremenek
70bcba6030
Micro-optimization: Don't use ostringstream when using a C-string literal
...
will work just fine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:40:40 +00:00
Ted Kremenek
fa34b33e43
Added some boilerplate for emitting warnings from the CF-reference count checker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 01:10:13 +00:00
Ted Kremenek
6837faa083
Added new "BugReporterHelper" class which is used by BugReporter to emit
...
checker-specific diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:20:43 +00:00
Ted Kremenek
f5749aa30b
For -emit-html, use the Rewriter to expand tabs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 23:25:54 +00:00
Ted Kremenek
fa5be36172
Don't expand tabs in EscapeText, but rather expand them when writing out
...
the HTML file. This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:37:58 +00:00
Ted Kremenek
5dd18b7d56
Add HTMLRewrite.h to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:31:28 +00:00
Ted Kremenek
4ce32cb52b
When substituting tabs during HTMLification, only add " " when we are
...
"escaping" spaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:28:15 +00:00
Ted Kremenek
dab4ead083
Improve range highlighting in HTMLDiagnostic to correctly highlight ranges
...
that span multiple lines by inserting multiple "</span>" and "<span>" tags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 21:29:14 +00:00
Ted Kremenek
25ba026308
Make SourceManager::getFullFilePos() public.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 21:26:35 +00:00
Sam Bishop
670aa9d763
Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
...
the pattern of the other Decl classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 20:49:25 +00:00
Ted Kremenek
0b6c153491
Set the location of ccc-analyzer to be the same directory as where scan-build
...
is located.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 20:22:12 +00:00
Chris Lattner
06767518f5
silence some warnings when assertions are disabled.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 05:52:18 +00:00
Chris Lattner
3d1cee3698
Add support for C++ default arguments, and rework Parse-Sema
...
interaction for function parameters, fixing PR2046.
Patch by Doug Gregor!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 05:04:30 +00:00
Chris Lattner
0442108783
Add support for C++ default arguments, and rework Parse-Sema
...
interaction for function parameters, fixing PR2046.
Patch by Doug Gregor!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 04:40:51 +00:00
Chris Lattner
5db17c9b5e
Fix rdar://5846705: "clang -E foo.c -o foo.i" should remove foo.i on error.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 04:16:20 +00:00
Ted Kremenek
356708cb33
Add ids for line numbers, allowing us to jump to arbitrary line numbers within
...
an HTMLified source file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:53:30 +00:00
Ted Kremenek
d8c6d0c8a5
Left-justify text in report table.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:50:07 +00:00