Chris Lattner
e58408d8db
Add a bunch of comments, move RewriteRope::MakeRopeString out of line.
...
llvm-svn: 49689
2008-04-14 21:41:00 +00:00
Ted Kremenek
f6aad13242
Fix regression in Diagnostic that caused it to not register the number
...
of errors.
llvm-svn: 49686
2008-04-14 21:21:38 +00:00
Ted Kremenek
17acadebb4
Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
...
the files of different SourceLocations. These methods correctly handle the
case where a file may have multiple FileIDs due to it being large enough
to be spread across several chunks.
llvm-svn: 49682
2008-04-14 21:04:18 +00:00
Chris Lattner
dc217191d1
fix more uninit ivars, who wrote this junk? :)
...
llvm-svn: 49679
2008-04-14 20:07:03 +00:00
Chris Lattner
ca94e4263b
Fix an assertion ted was hitting, due to an uninitialized variable.
...
llvm-svn: 49678
2008-04-14 20:05:32 +00:00
Ted Kremenek
193f185902
Only increment the number of diagnostics when the DiagnosticClient used
...
is the one attached to the Diagnostic object.
llvm-svn: 49677
2008-04-14 19:56:12 +00:00
Ted Kremenek
87bfc03f4a
Don't flag dead stores that occur in macros.
...
llvm-svn: 49672
2008-04-14 18:28:25 +00:00
Ted Kremenek
bae225d57a
Have BugReporter::EmitWarning use the PathDiagnosticClient if it is available.
...
llvm-svn: 49668
2008-04-14 18:06:42 +00:00
Chris Lattner
d80edddccd
move a ton of code out of line, from RewriteRope.h -> RewriteRope.cpp
...
llvm-svn: 49664
2008-04-14 17:54:23 +00:00
Ted Kremenek
75ff623e2e
Bug fix in dead-store checker when walking the Decls in a DeclStmt: don't
...
assume that DeclStmts only have VarDecls; they can have TypedefDecls.
llvm-svn: 49662
2008-04-14 17:52:13 +00:00
Ted Kremenek
12e721a728
Treat calls to unresolved functions in the CF-ref count checker as calls
...
to functions with NULL summaries.
llvm-svn: 49660
2008-04-14 17:45:13 +00:00
Ted Kremenek
7e15130dc9
Hooked up the dead-store checker to the BugReporter interface. Now dead-store
...
warnings are emitted as part of the warnings registered by GRSimpleVals.
llvm-svn: 49658
2008-04-14 17:39:48 +00:00
Chris Lattner
04df1bb8b5
remove ifdefs
...
llvm-svn: 49651
2008-04-14 17:12:49 +00:00
Chris Lattner
3374b039d9
Change the RewriteRope::Chunks data structure from an std::list into
...
a nice shiny B+ Tree variant. This fixes the last of the known algorithmic
issues with the rewriter, allowing a significant speedup. For example,
-emit-html on Ted's 500K .i file speeds up from 26.8s -> 0.64s in a
debug build (41x!) and 5.475s -> 0.132s (41x!) in an optimized build.
This code is functional but needs to be cleaned up, ifdefs removed, better
commented, and moved to a .cpp file. I plan to do this tomorrow.
llvm-svn: 49635
2008-04-14 07:17:29 +00:00
Nate Begeman
91f40e3680
Enable clang to codegen emmintrin.h until we have our own emmintrin.h
...
llvm-svn: 49633
2008-04-14 04:49:57 +00:00
Nate Begeman
5eee93328e
Fix typo
...
llvm-svn: 49632
2008-04-14 02:26:39 +00:00
Douglas Gregor
2daae31e9a
Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
...
llvm-svn: 49631
2008-04-14 00:26:07 +00:00
Douglas Gregor
423984d33b
Make Parser::getAccessSpecifierIfPresent const, since it does not modify the state
...
llvm-svn: 49629
2008-04-14 00:13:42 +00:00
Argyrios Kyrtzidis
25f54c72ac
Move IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.
...
llvm-svn: 49628
2008-04-14 00:09:21 +00:00
Douglas Gregor
556877c1e6
This patch adds very basic support for parsing and type-checking class
...
inheritance in C++. It'll parse the base-specifier list, e.g.,
class D : public B1, virtual public B2 { };
and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc).
llvm-svn: 49623
2008-04-13 21:30:24 +00:00
Douglas Gregor
83a586ec19
Introduce support for finding class and enum names via ordinary name lookup in C++
...
llvm-svn: 49621
2008-04-13 21:07:44 +00:00
Chris Lattner
f8f945499c
Fix PR2220, making diagnostics for unexpected tokens in pp expressions
...
more nice.
llvm-svn: 49619
2008-04-13 20:38:43 +00:00
Chris Lattner
861a226586
This patch is just the easy part of the class names patch, which
...
allows the parsing of "class" in addition to "struct" and "union" to
declare a record. So this patch allows:
class C { };
class C c1;
But it does not contain the lookup bits, so this won't work yet:
C c2;
Patch by Doug Gregor!
llvm-svn: 49613
2008-04-13 18:59:07 +00:00
Chris Lattner
cc0ef63a13
Change the btree algorithm to split nodes bottom-up instead of top-down.
...
This results in an (IMO) simpler algorithm, results in fewer splits, and
is more amenable to delta handling (there is no reason to mutate the tree
at all when adding a delta to a position that already exists in the tree).
llvm-svn: 49609
2008-04-13 08:52:45 +00:00
Chris Lattner
cdefa7a6fc
split node splitting from interior node restructuring.
...
llvm-svn: 49608
2008-04-13 08:22:30 +00:00
Chris Lattner
61705c1a6e
update to follow mainline llvm API change.
...
llvm-svn: 49607
2008-04-13 07:32:11 +00:00
Sam Bishop
fcd78b02c2
Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
...
Kirtzidis!
llvm-svn: 49603
2008-04-13 04:32:18 +00:00
Chris Lattner
b0d3844fb8
Default argument cleanups and minor improvements, patch by
...
Doug Gregor!
llvm-svn: 49598
2008-04-12 23:52:44 +00:00
Chris Lattner
8fc77b7945
final cleanup, the code is now in a reviewable state.
...
llvm-svn: 49592
2008-04-12 22:04:18 +00:00
Chris Lattner
cbb6bad435
move the DeltaTree implementation out of line, remove debugging printfs etc.
...
llvm-svn: 49591
2008-04-12 22:00:40 +00:00
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
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
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