Steve Naroff
a8f0d12e81
Rename a file and update the Xcode project.
...
llvm-svn: 49693
2008-04-14 22:05:54 +00:00
Steve Naroff
1dc53ef494
Rename RewriteTest->RewriteObjC.
...
llvm-svn: 49692
2008-04-14 22:03:09 +00:00
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
Steve Naroff
4fff2a08aa
Fix comment.
...
llvm-svn: 49688
2008-04-14 21:39:16 +00:00
Ted Kremenek
d61ed3b6cb
Use isFromMainFile instead of comparing FileIDs directly.
...
llvm-svn: 49687
2008-04-14 21:24:13 +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
9569e57a50
Use SourceManager::isFromMainFile()
...
llvm-svn: 49685
2008-04-14 21:14:41 +00:00
Ted Kremenek
13ad6e1234
Convert over to new SourceManager::isFromMainFile() instead of doing direct
...
FileID comparison (fixes insidious corner case with chunks).
llvm-svn: 49684
2008-04-14 21:14:03 +00:00
Ted Kremenek
bb2b224159
HTMLDiagnostics now uses the new "getCanonicalID()", "isFromMainFileID()" methods from
...
SourceManager when doing HTML pretty-printing. This resolves an insidious bug when
presenting error reports that only occurred in large source files.
llvm-svn: 49683
2008-04-14 21:06:04 +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
751d4d2d60
Added driver option "-checker-opt-analyze-headers" to force the static
...
analyzer to analyze functions declared in header files.
llvm-svn: 49675
2008-04-14 18:40:58 +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
69a4df4cb7
Updated test cases so that they do not emit warnings for dead stores.
...
llvm-svn: 49659
2008-04-14 17:40:10 +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
Ted Kremenek
cad92f2447
Added version of "getClient()" for class Diagnostic that returns a non-const
...
reference to the DiagnosticClient. This is useful for DiagnosticClients
that have internal state when processing diagnostics.
llvm-svn: 49656
2008-04-14 17:37:31 +00:00
Chris Lattner
04df1bb8b5
remove ifdefs
...
llvm-svn: 49651
2008-04-14 17:12:49 +00:00
Ted Kremenek
16a8a3be41
Added test case to dead stores checker.
...
llvm-svn: 49647
2008-04-14 15:56:17 +00:00
Sam Bishop
cb1a37b145
Handle -D and -U options in order, so that they can cancel each other out when
...
intermixed.
llvm-svn: 49645
2008-04-14 14:41:57 +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
d71f83a8cb
this started failing because a GEP was constant folded,
...
improve the robustness of the test.
llvm-svn: 49618
2008-04-13 19:54:28 +00:00
Douglas Gregor
b77653430f
Test commit: fix a typo
...
llvm-svn: 49615
2008-04-13 19:35:01 +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