Chris Lattner
0c8d17fc43
remove ifdefs
...
llvm-svn: 49587
2008-04-12 20:34:05 +00:00
Chris Lattner
d154731131
Do an initial hack at replacing one of the incredibly inefficient
...
(but simple!) datastructures in the rewriter with a more complex but
more efficient one.
This replaces the Deltas vector with a specialized BTree that makes
delta lookups much more efficient. This speeds up -emit-html on a 500K
.i file from 157.154 to 27.127 seconds on my machine (5.8x).
While this code is functional, it isn't very pretty, I have much
refactoring planned for it, and will remove the USE_VECTOR ifdef.
Stay tuned.
llvm-svn: 49586
2008-04-12 20:28:24 +00:00
Argyrios Kyrtzidis
740525a6b7
Use std::list's push_back instead of resize to add an element.
...
llvm-svn: 49582
2008-04-12 12:38:58 +00:00
Chris Lattner
8f96d04ceb
don't diagnose empty source files, thanks Neil!
...
llvm-svn: 49575
2008-04-12 05:54:25 +00:00
Argyrios Kyrtzidis
dfd52220d7
Fixed comments.
...
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.
llvm-svn: 49570
2008-04-12 01:50:47 +00:00
Argyrios Kyrtzidis
b8a4920d62
Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.
...
llvm-svn: 49567
2008-04-12 00:47:19 +00:00
Fariborz Jahanian
4572b45574
AST generation for objc2's property declarations.
...
llvm-svn: 49565
2008-04-11 23:40:25 +00:00
Ted Kremenek
8784a7c006
Add some boilerplate to report memory leaks at the end of an analyzed function.
...
Still need some boilerplate in BugReporter to report bugs at the end
of a function (not associated with a particular statement).
llvm-svn: 49564
2008-04-11 22:25:11 +00:00
Ted Kremenek
bc888b47b9
Added "EvalEndPath" to GRTransferFuncs: the default implementation does not
...
change the state (and thus the GREndPathNodeBuilder automatically contructs a
node).
llvm-svn: 49563
2008-04-11 22:07:59 +00:00
Ted Kremenek
811c2b4edb
Added "GREndPathNodeBuilder", a new node builder that will be used for
...
evaluating transfer functions at the end-of-path.
llvm-svn: 49561
2008-04-11 22:03:04 +00:00
Ted Kremenek
0a86fdb1ff
Added FIXME
...
llvm-svn: 49558
2008-04-11 20:51:02 +00:00
Ted Kremenek
831f327568
Fix regression introduced by my last commit.
...
llvm-svn: 49556
2008-04-11 20:23:24 +00:00
Ted Kremenek
a7c44113bc
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.
llvm-svn: 49555
2008-04-11 20:11:19 +00:00
Steve Naroff
5a4611cdda
Add class and super class location info to ObjCInterfaceDecl...
...
llvm-svn: 49553
2008-04-11 19:35:35 +00:00
Ted Kremenek
988990f842
Use RangedBugReport to report better ranges for reference count errors.
...
llvm-svn: 49552
2008-04-11 18:40:51 +00:00
Ted Kremenek
6e38ffa517
Added "RangedBugReport".
...
llvm-svn: 49551
2008-04-11 18:40:29 +00:00
Ted Kremenek
2cf508c880
Update Xcode project with missing files.
...
llvm-svn: 49550
2008-04-11 18:30:21 +00:00
Sam Bishop
ef8b94ae84
Invoke destructors in Decl::Destroy().
...
llvm-svn: 49547
2008-04-11 18:04:39 +00:00
Fariborz Jahanian
963767476c
Minor changes per Chris L's review.
...
llvm-svn: 49539
2008-04-11 16:55:42 +00:00
Chris Lattner
9b7206eb4f
don't read off the front of the buffer. Thanks to Sam for pointing this out.
...
llvm-svn: 49535
2008-04-11 16:20:41 +00:00
Sam Bishop
703ae9624b
Stub out and start using a Decl::Destroy() method.
...
llvm-svn: 49532
2008-04-11 15:01:25 +00:00
Sam Bishop
4c088b766d
Use the ASTContext allocator when creating deserialized Decl objects.
...
llvm-svn: 49530
2008-04-11 14:49:10 +00:00
Chris Lattner
9950c80c83
two new files for previous patch, by Argiris Kirtzidis
...
llvm-svn: 49521
2008-04-11 07:06:57 +00:00
Chris Lattner
c5c95b52a8
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!
llvm-svn: 49520
2008-04-11 07:00:53 +00:00
Chris Lattner
47fb9efa5d
Fix rdar://5843510 don't assert and die when an invalid output
...
file is specified, print a happy little error message.
llvm-svn: 49518
2008-04-11 06:14:11 +00:00
Ted Kremenek
4b77209694
Fixed some logic errors in the CF ref count checker; we now can detect simple
...
use-after-release errors. Added test case.
llvm-svn: 49509
2008-04-10 23:44:06 +00:00
Fariborz Jahanian
de615836f3
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.
llvm-svn: 49506
2008-04-10 23:32:45 +00:00
Ted Kremenek
3c03d52d6e
Simplify CF ref. count checker state machine.
...
llvm-svn: 49505
2008-04-10 23:09:18 +00:00
Ted Kremenek
22bd628056
Fix some bonehead bugs in summary generation in CFRefCount.
...
llvm-svn: 49503
2008-04-10 22:58:08 +00:00
Ted Kremenek
969bb805f9
Used --checker-simple.
...
llvm-svn: 49501
2008-04-10 22:17:23 +00:00
Ted Kremenek
4a78c3ae11
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.
llvm-svn: 49500
2008-04-10 22:16:52 +00:00
Chris Lattner
5c7fce453d
reduce the amount of 'C++ magic' this code depends on :)
...
llvm-svn: 49489
2008-04-10 16:37:40 +00:00
Ted Kremenek
ea1bc3bec6
CFRefCount analysis now properly calls "EmitWarnings" after analyzing a function.
...
llvm-svn: 49488
2008-04-10 16:21:09 +00:00
Ted Kremenek
42d9db75f0
When not emitting path diagnostics in BugReporter::EmitWarning(), use the
...
BugReport-specific SourceRanges (when available).
llvm-svn: 49486
2008-04-10 16:12:38 +00:00
Ted Kremenek
83744ddbd9
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.
llvm-svn: 49485
2008-04-10 16:05:13 +00:00
Chris Lattner
a12405b0ef
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.
llvm-svn: 49468
2008-04-10 06:46:29 +00:00
Chris Lattner
32295d344a
Simplify lifetime of location object.
...
llvm-svn: 49467
2008-04-10 06:15:14 +00:00
Eric Christopher
67d650508a
Fix typo.
...
llvm-svn: 49464
2008-04-10 05:23:15 +00:00
Chris Lattner
0e91b41902
typedef void T;
...
void f(T);
is only invalid in C++ mode, not C89 mode.
llvm-svn: 49460
2008-04-10 02:26:16 +00:00
Chris Lattner
58258246ec
Several improvements from Doug Gregor related to default
...
argument handling. I'll fix up the c89 (void) thing next.
llvm-svn: 49459
2008-04-10 02:22:51 +00:00
Ted Kremenek
c8bef6a076
Hooked up initial reference-count checks to the BugReporter interface.
...
llvm-svn: 49455
2008-04-09 23:49:11 +00:00
Ted Kremenek
7acc3a36ef
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.
llvm-svn: 49453
2008-04-09 21:41:14 +00:00
Ted Kremenek
43e0633048
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.
llvm-svn: 49429
2008-04-09 15:51:31 +00:00
Ted Kremenek
1d511d3bae
Add SemaDeclCXX.cpp to Xcode project.
...
llvm-svn: 49428
2008-04-09 15:50:11 +00:00
Ted Kremenek
f17d5758fc
Micro-optimization: Don't use ostringstream when using a C-string literal
...
will work just fine.
llvm-svn: 49427
2008-04-09 15:40:40 +00:00
Ted Kremenek
ce8e881dc3
Added some boilerplate for emitting warnings from the CF-reference count checker.
...
llvm-svn: 49414
2008-04-09 01:10:13 +00:00
Ted Kremenek
3cef454e2e
Added new "BugReporterHelper" class which is used by BugReporter to emit
...
checker-specific diagnostics.
llvm-svn: 49412
2008-04-09 00:20:43 +00:00
Ted Kremenek
d4db4fa359
For -emit-html, use the Rewriter to expand tabs.
...
llvm-svn: 49409
2008-04-08 23:25:54 +00:00
Ted Kremenek
5f7ece0bff
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.
llvm-svn: 49406
2008-04-08 22:37:58 +00:00
Ted Kremenek
5d1647daf9
Add HTMLRewrite.h to Xcode project.
...
llvm-svn: 49405
2008-04-08 22:31:28 +00:00