Commit Graph

4454 Commits

Author SHA1 Message Date
Ted Kremenek b5c8225320 Use logical line number for BUGLINE.
llvm-svn: 49178
2008-04-03 17:55:57 +00:00
Ted Kremenek 406192d163 Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.
llvm-svn: 49177
2008-04-03 17:55:15 +00:00
Sam Bishop 30d70968fd Remove handling of impossible "-?" option.
llvm-svn: 49161
2008-04-03 14:29:47 +00:00
Sam Bishop 2f8a31ca92 trivial whitespace fix
llvm-svn: 49160
2008-04-03 14:20:28 +00:00
Ted Kremenek ca40664275 Handle the case when getEndPath() returns NULL.
llvm-svn: 49155
2008-04-03 07:33:55 +00:00
Ted Kremenek 4d26d194e4 Don't run the analyzer on files whose language is "unknown"
llvm-svn: 49152
2008-04-03 07:14:59 +00:00
Ted Kremenek b73d6dda84 Added guard for printing out PathDiagnostics whose last element ends with
a piece with a SourceLocation that does not have a FileID.

llvm-svn: 49151
2008-04-03 07:13:10 +00:00
Ted Kremenek c599179267 Some cleanups in EscapeText and AddLineNumbers. Still investigating performance
issues.

llvm-svn: 49150
2008-04-03 07:12:29 +00:00
Ted Kremenek ffc1147323 Remove impossible "-?" option.
llvm-svn: 49149
2008-04-03 07:11:44 +00:00
Ted Kremenek 78e30c17bc Added "isFileID()" to FullSourceLoc.
llvm-svn: 49148
2008-04-03 07:11:38 +00:00
Ted Kremenek d4bee176b6 CSS/HTML generation tweaks for index.html: Remove special "classes" for <td>
elements in table so that sorttable can sort them.

llvm-svn: 49145
2008-04-03 05:50:51 +00:00
Chris Lattner e799eb5daa Fix PR2081 (problems codegen'ing some recursive structures) patch
by Lauro Venancio!

llvm-svn: 49144
2008-04-03 05:50:42 +00:00
Sam Bishop 2289459bf6 Created a destructor so that the top-level decls can be deleted.
llvm-svn: 49142
2008-04-03 05:35:20 +00:00
Sam Bishop 5981404289 Temporarily make the Decl virtual destructor public, so that calls to "delete"
can be tested on derived classes.

llvm-svn: 49141
2008-04-03 05:29:20 +00:00
Ted Kremenek e4c029e7aa Add back bug name to PathDiagnostic.
llvm-svn: 49139
2008-04-03 05:23:19 +00:00
Chris Lattner 3a0702e631 Fix a bug where we didn't check the RHS for null, we checked
the LHS for null twice.

llvm-svn: 49138
2008-04-03 05:07:25 +00:00
Chris Lattner efdc7685d4 qualifier comparisons should be done on canonical types.
llvm-svn: 49137
2008-04-03 05:07:04 +00:00
Sam Bishop 03e662d5be Call delete on the deserialized TranslationUnit object.
llvm-svn: 49136
2008-04-03 05:03:34 +00:00
Sam Bishop ca6226628e Call "delete" on the body of FunctionDecls.
llvm-svn: 49135
2008-04-03 05:01:04 +00:00
Ted Kremenek 4e9cc3f272 When creating PathDiagnostics, created a trimmed graph first and report the
BFS path to the root.  This also avoids problems with loops in the ExplodedGraph.

llvm-svn: 49133
2008-04-03 04:59:14 +00:00
Ted Kremenek 588dcdd58b Added node_iterator to ExplodedGraph to allow iteration over all nodes in
the graph.

llvm-svn: 49132
2008-04-03 04:58:29 +00:00
Ted Kremenek 572875c43f Updated Xcode project to include BugReporter.[cpp,h].
llvm-svn: 49128
2008-04-03 04:43:40 +00:00
Ted Kremenek 505a36afc6 Created new path-sensitive bug-reporting scheme based on the classes
"BugReporter" and "BugDescription".  BugDescription is used to describe
a bug and provide pieces of the PathDiagnostic, and BugReporter creates
the actual PathDiagnostic by crawling through the ExplodedGraph.

Migrated checks done by GRSimpleVals to be reported using the new BugReporter
mechanism.

llvm-svn: 49127
2008-04-03 04:42:52 +00:00
Ted Kremenek 7c7616cf29 Added missing #ifndef...#define...#endif directives to protect against
double includes.

llvm-svn: 49126
2008-04-03 04:38:39 +00:00
Ted Kremenek 84041843af CSS tweaking on blue boxes.
llvm-svn: 49121
2008-04-02 22:50:50 +00:00
Ted Kremenek 33d03a52f0 80 col violation
llvm-svn: 49120
2008-04-02 22:08:09 +00:00
Ted Kremenek 744fb6d9e7 Added more PathDiagnostic rendering for terminators: switch, goto, loops.
llvm-svn: 49119
2008-04-02 22:03:53 +00:00
Ted Kremenek ab2a52c4bf Blue diagnostic boxes.
llvm-svn: 49117
2008-04-02 21:14:04 +00:00
Ted Kremenek 258493c188 Added path sequence numbers in HTML output of PathDiagnostics.
llvm-svn: 49116
2008-04-02 21:04:20 +00:00
Ted Kremenek 3e38d6ad3c Fix initialization bug.
llvm-svn: 49115
2008-04-02 20:44:27 +00:00
Ted Kremenek 3276af4c1a Embed BUGLINE, BUGFILE, BUGPATHLENGTH in the emitted HTML file.
llvm-svn: 49114
2008-04-02 20:44:16 +00:00
Ted Kremenek 00ab318cf2 Made bug index tables sortable.
Added line number, file information, path length, for each bug report.

llvm-svn: 49113
2008-04-02 20:43:36 +00:00
Ted Kremenek 260fc46000 Added "back()" method to PathDiagnostic to access the last piece in a path.
llvm-svn: 49112
2008-04-02 20:35:01 +00:00
Ted Kremenek c57139e104 Initial work on CSS in generated index.html.
Added "-V/--view" option to view index.html after it has been generated.

llvm-svn: 49108
2008-04-02 18:42:49 +00:00
Steve Naroff 778927532d Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.
I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)

llvm-svn: 49107
2008-04-02 18:30:49 +00:00
Ted Kremenek 2cd0d63d30 Initial support for generating index.html file.
llvm-svn: 49104
2008-04-02 18:03:36 +00:00
Ted Kremenek 13c0885a8d Put "BUGDESC" comment tag on its own line.
llvm-svn: 49103
2008-04-02 18:03:20 +00:00
Ted Kremenek 383bfd27d0 Shorted bug-description.
llvm-svn: 49102
2008-04-02 18:02:54 +00:00
Chris Lattner 182f660d8d simplify some code by using PointerLikeType.
llvm-svn: 49101
2008-04-02 17:45:06 +00:00
Chris Lattner db5f1fa3d8 add a common base class "PointerLikeType" for PointerType and ReferenceType,
allowing them to be treated the same in some contexts.  A suggestion for a
better name is welcome :)

llvm-svn: 49100
2008-04-02 17:35:06 +00:00
Chris Lattner b1f7398b1c properly handle array decay in objc message exprs.
llvm-svn: 49098
2008-04-02 17:17:33 +00:00
Chris Lattner 6f6d226f63 improve error to be something end users will actually understand :)
llvm-svn: 49097
2008-04-02 17:15:17 +00:00
Ted Kremenek 018ba60f8e Added path-sensitive null dereference test case.
llvm-svn: 49095
2008-04-02 16:54:39 +00:00
Ted Kremenek 3016cdd569 More wording cleanups in --help text.
llvm-svn: 49094
2008-04-02 16:47:27 +00:00
Ted Kremenek dfd204e133 More wording fixes.
llvm-svn: 49093
2008-04-02 16:41:25 +00:00
Ted Kremenek 1cf35de3cb Added error message for unrecognized options.
llvm-svn: 49092
2008-04-02 16:35:01 +00:00
Ted Kremenek c5f113f52e Wording cleanups.
llvm-svn: 49091
2008-04-02 16:31:58 +00:00
Ted Kremenek 977b644427 Implemented "-k" support.
llvm-svn: 49090
2008-04-02 16:04:51 +00:00
Ted Kremenek 37e908a6f0 Do equality testing, not regex, when the build command is gcc. This matches
better with what compiler invocations that ccc-analyzer actually intercepts.

Fixes suggested by Sam Bishop!

llvm-svn: 49089
2008-04-02 15:34:12 +00:00
Steve Naroff 2fc93f5c43 Two changes to Sema::LookupDecl() interface.
(1) Remove IdLoc (it's never used). 
(2) Add a bool to enable/disable lazy builtin creaation (defaults to true).

This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit.

To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness. 

llvm-svn: 49087
2008-04-02 14:35:35 +00:00
Ted Kremenek d12d21c000 Beginning of some cleanups; start generating path diagnostics using objects
that describe a bug.

llvm-svn: 49086
2008-04-02 07:05:46 +00:00
Ted Kremenek e1b52ff726 Minor wording changes.
llvm-svn: 49085
2008-04-02 07:05:07 +00:00
Ted Kremenek e6eed29125 Embed "DESC" tag in HTML reports.
llvm-svn: 49084
2008-04-02 07:04:46 +00:00
Ted Kremenek a7fa4d446a Added "description" field to PathDiagnostic.
llvm-svn: 49083
2008-04-02 07:03:43 +00:00
Chris Lattner b3a176da9f Various parts of the standard require something to be an "incomplete or
object type".  Add a predicate that checks exactly this, as it is equivalent
to checking ot see if the type is *not* a function type, which is faster
to check.

llvm-svn: 49082
2008-04-02 06:59:01 +00:00
Chris Lattner daaa8ba77e 1) Enforce C99 6.7.3p2: "Types other than pointer types derived from
object or incomplete types shall not be restrict-qualified."

2) Warn about qualifiers on function types: C99 6.7.3p8: "If the 
specification of a function type includes any type qualifiers, the 
behavior is undefined."

3) Implement restrict on C++ references.

4) fix some locations for various C++ reference diagnostics.

llvm-svn: 49081
2008-04-02 06:50:17 +00:00
Chris Lattner 53be405c3a Add a citation.
llvm-svn: 49080
2008-04-02 06:06:35 +00:00
Chris Lattner a21ad8058a Fix several bugs in array -> pointer decomposition.
First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the 
non-trivial logic for this seemingly simple operation.

llvm-svn: 49078
2008-04-02 05:18:44 +00:00
Ted Kremenek 2c71d51513 Added initial hacked support for display path diagnostics with
GRSimpleVals warnings.  Cleaning up, but now we get multiple bubbles (branches are annotated).

llvm-svn: 49077
2008-04-02 05:15:22 +00:00
Ted Kremenek 52595d7551 Fix copy-paste error.
llvm-svn: 49076
2008-04-02 05:13:10 +00:00
Chris Lattner 800817bf6d remove blank line.
llvm-svn: 49075
2008-04-02 05:09:38 +00:00
Chris Lattner 091718d300 print cvr qualifiers on simplified typedefs
llvm-svn: 49074
2008-04-02 05:06:23 +00:00
Ted Kremenek cb75937198 Added special handling when the build command is "gcc", "cc", or "llvm-gcc";
in these cases we directly call ccc-analyzer.

llvm-svn: 49073
2008-04-02 04:43:42 +00:00
Chris Lattner 24d5bfe0b2 rename some variables, fix 80 col violation. No
functionality change.

llvm-svn: 49072
2008-04-02 04:24:33 +00:00
Sam Bishop 02f78df76b a bunch of random cleanups
llvm-svn: 49071
2008-04-02 03:35:43 +00:00
Chris Lattner 81cb9e8637 Fix PR2017 and silence some bogus errors.
llvm-svn: 49068
2008-04-02 01:05:10 +00:00
Steve Naroff 9b94b17806 Fix a comment typo and add a couple suggestions from Chris.
llvm-svn: 49066
2008-04-02 00:39:51 +00:00
Steve Naroff 257520b1b4 Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).
- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...

llvm-svn: 49058
2008-04-01 23:04:06 +00:00
Ted Kremenek 94896e17bb Patch by Argiris Kirtzidis: Fix a dangling pointer error!
llvm-svn: 49057
2008-04-01 22:35:58 +00:00
Ted Kremenek ce4f31d3ce Minor cleanups.
llvm-svn: 49052
2008-04-01 21:36:28 +00:00
Ted Kremenek 33187168ab Added help text for scan-build.
llvm-svn: 49051
2008-04-01 21:22:03 +00:00
Ted Kremenek bf1a7c6440 Initial checking of 'scan-build' script, a script used to wrap builds and
interpose calls to gcc with calls to the analyzer.

llvm-svn: 49049
2008-04-01 20:47:38 +00:00
Chris Lattner 595cf9ff81 Update to match simplified llvm MemoryBuffer interfaces for files.
llvm-svn: 49042
2008-04-01 18:04:30 +00:00
Chris Lattner 4f6002c79a prune dead #includes
llvm-svn: 49033
2008-04-01 06:08:11 +00:00
Chris Lattner 47448288ee MemoryBuffer::getFile got smarter, obviating the need for readfilefast.
The new MemoryBuffer doesn't "leak" file descriptors and handles the
small file case efficiently.

llvm-svn: 49032
2008-04-01 06:06:37 +00:00
Ted Kremenek a9590d1c0d Embed linkable IDs in message bubbles.
llvm-svn: 49005
2008-03-31 23:30:12 +00:00
Chris Lattner 34cf70ede4 improve comma consistency, yes I'm anal
llvm-svn: 49004
2008-03-31 23:25:25 +00:00
Ted Kremenek 3bcfc6edc0 Better handling for tabs with message bubbles.
llvm-svn: 49001
2008-03-31 23:14:05 +00:00
Ted Kremenek 01fa5d2a1e When emitting HTML messages, take into account margin fusing due to tabs.
llvm-svn: 48998
2008-03-31 21:40:14 +00:00
Ted Kremenek b8cb8e8f90 Do not abort ccc-analyzer script if an HTML directory is not specified.
llvm-svn: 48997
2008-03-31 21:20:32 +00:00
Ted Kremenek e9f2a90d1f Do not prepend the keyword "[CHECKER]" to checker messages when using
a PathDiagnosticClient.

llvm-svn: 48996
2008-03-31 20:42:43 +00:00
Steve Naroff 93eea6e1a0 Hack ReadFileFast() to raise the threshold of memory mapped files (from 4->12 pages).
This is a temporary solution to avoid running out of file descriptors (which defaults to 256).

Need to benchmark to understand the speed benefit. If the benefit is small, the simple solution is to avoid memory mapping files. If the benefit is significant, more thought is necessary.

llvm-svn: 48991
2008-03-31 18:44:59 +00:00
Ted Kremenek bb7f03f926 Include ranges in GRSimpleVals diagnostics.
llvm-svn: 48990
2008-03-31 18:44:32 +00:00
Ted Kremenek c27815ca82 Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removed
GRSimpleVals.h

Added a PathDiagnosticClient option to the driver functions for the
CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o"
argument from the driver that specifies where HTML reports should be dumped.

llvm-svn: 48989
2008-03-31 18:26:32 +00:00
Ted Kremenek 612d34641b The ccc-analyzer script now interrogates environment variables to determine
where to dump HTML reports.

llvm-svn: 48987
2008-03-31 18:25:05 +00:00
Ted Kremenek 491dc9f4a0 Added variation of the "Report" method in the class Diagnostic that takes
an optional DiagnosticClient argument that differs from the client stored
internally in the Diagnostic object.

llvm-svn: 48986
2008-03-31 18:23:15 +00:00
Ted Kremenek 9c7deb8d25 Disable timing diagnostics for GRSimpleVals.
llvm-svn: 48981
2008-03-31 16:00:32 +00:00
Ted Kremenek f646774f32 Added path-sensitive check for return statements that return the address
of a stack variable.  This is the path-sensitive version of a check that
is already done during semantic analysis.

llvm-svn: 48980
2008-03-31 15:02:58 +00:00
Chris Lattner 59a2594f3f rename Decl::CompatibleAlias -> ObjCCompatibleAlias.
Fix objc ivar lookup.  Ivar lookup should occur between lookup
of method-local values and lookup of globals.  Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
 1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
    in the AST.  This is a hack.
 2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
    not correctly handle typedefs and enum constants yet.

llvm-svn: 48972
2008-03-31 00:36:02 +00:00
Chris Lattner c00c35a857 some cleanups on top of David's patch. There are still two
remaining open issues I've communicated to him:

1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
   all parent class ivars) and flattens classes.  If A derives from B, 
   and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.

David, please review.

llvm-svn: 48970
2008-03-30 23:25:33 +00:00
Chris Lattner 4bd5596d08 Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!

llvm-svn: 48969
2008-03-30 23:03:07 +00:00
Steve Naroff f9e7c90129 Only have the rewriter produce a file when there are no errors.
llvm-svn: 48926
2008-03-28 22:26:09 +00:00
Steve Naroff 0de4199ca0 Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
llvm-svn: 48924
2008-03-28 21:37:05 +00:00
Ted Kremenek c719424caa Added skeleton checking for NSString's method initWithFormat: (do not pass nil). This won't be useful in most cases right now
because the analyzer isn't tracking expected types for an object, and [NSString alloc] just runs "id".

llvm-svn: 48917
2008-03-28 16:09:38 +00:00
Steve Naroff 60a9ef67e2 Add some of Ted's recent work to the VC++ project file.
Fix a couple bozo bugs in the rewriter.

llvm-svn: 48903
2008-03-27 22:59:54 +00:00
Steve Naroff 00a317694b Collect all the preamble code and don't insert it until the end.
llvm-svn: 48899
2008-03-27 22:29:16 +00:00
Ted Kremenek 276278e5d2 Expanded NSString checking to check for nil for a few more methods.
llvm-svn: 48898
2008-03-27 22:05:32 +00:00
Ted Kremenek 2e4e7ccb22 Add line SourceLocation to NSString checks.
Added test case to test warning about passing 'nil' to NSString's compare: method.

llvm-svn: 48896
2008-03-27 21:23:57 +00:00
Ted Kremenek 27156c8c9f Hooked up initial NSString interface checking to GRSimpleVals.
llvm-svn: 48895
2008-03-27 21:15:17 +00:00
Ted Kremenek c8948c77f7 ProgramPoint is just a smart pointer; no reason to return a constant reference.
llvm-svn: 48891
2008-03-27 18:11:59 +00:00
Ted Kremenek 64b95a024e Minor CSS tweaking (smaller h1 tags).
Bug fix in EscapeText (for std::string) where spaces were not properly emitted.

llvm-svn: 48889
2008-03-27 17:28:58 +00:00
Ted Kremenek 30560caa3d For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
llvm-svn: 48888
2008-03-27 17:25:28 +00:00
Ted Kremenek 296b4c1bc6 Update Xcode project: add BasicObjCFoundationChecks.h
llvm-svn: 48887
2008-03-27 17:17:51 +00:00
Ted Kremenek a4d60b6de3 Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the driver.
llvm-svn: 48886
2008-03-27 17:17:22 +00:00
Ted Kremenek f89469e392 Add default ctor implementation.
llvm-svn: 48885
2008-03-27 17:16:06 +00:00
Ted Kremenek 561dfe3153 Add html::EscapeText for std::string; use this function to escape text in message bubbles.
llvm-svn: 48884
2008-03-27 17:15:29 +00:00
Ted Kremenek ed9f054a9c Don't emit any timings for GRSimple if the CFG is not going to be built.
llvm-svn: 48882
2008-03-27 17:14:42 +00:00
Ted Kremenek 8d5491f40c Output directory as well as file name.
llvm-svn: 48870
2008-03-27 07:39:04 +00:00
Ted Kremenek 8cc4842a76 Added <h3> tag in HTML file output that contains the name of the source file.
llvm-svn: 48869
2008-03-27 07:35:49 +00:00
Ted Kremenek 9b7843124e Added AnnotatedPath.h, GRAuditor.h, GRSimpleAPICheck.h and BasicObjCFoundationChecks.cpp to Xcode project.
llvm-svn: 48868
2008-03-27 07:26:42 +00:00
Ted Kremenek c04149299c Added "GRAuditor" and "GRSimpleAPICheck" interface to allow simple stateless checkers to be injected into the analyzer.
Added "AnnotatedPath" class to record an annotated path that will be useful for inspecting paths.
Added some boilerplate code for simple checks of Apple's Foundation API.

llvm-svn: 48867
2008-03-27 07:25:52 +00:00
Ted Kremenek f6d2919a3e Updated Xcode project with HTMLDiagnostics.[h,cpp]
llvm-svn: 48866
2008-03-27 06:18:34 +00:00
Ted Kremenek 6efb026623 Added "HTMLDiagnostic", a generic DiagnosticClient (that also implements PathDiagnostic)
so that all diagnostics can be piped to HTML files instead of as text diagnostics using --html-diags.

llvm-svn: 48865
2008-03-27 06:17:42 +00:00
Ted Kremenek 710714c365 PathDiagnosticPiece no longer contains a vector of strings; just one string.
PathDiagnostic no longer contains a diagnostic ID or diagnostic level.

llvm-svn: 48864
2008-03-27 06:16:40 +00:00
Ted Kremenek c875201ee1 Fixed copy-paste error.
llvm-svn: 48863
2008-03-27 05:52:45 +00:00
Ted Kremenek 9c27b057da Added PathDiagnostic.[h,cpp] to Xcode project.
llvm-svn: 48862
2008-03-27 03:50:10 +00:00
Ted Kremenek 4fa20c9bba Added classes "PathDiagnosticPiece", "PathDiagnostic", and "PathDiagnosticClient", which encapsulate diagnostic reporting for paths.
llvm-svn: 48861
2008-03-27 03:49:32 +00:00
Ted Kremenek afa66e246e In ObjCMessageExpr: getSelector() const should just return "Selector", not "const Selector&" because Selector is just a smart pointer.
llvm-svn: 48860
2008-03-27 03:47:43 +00:00
Steve Naroff c10c2e339f Fix rewriter tests to work with new output file logic. This changes forces the output to standard out (rather than generate a .cpp file, which is the new default for the rewriter).
llvm-svn: 48847
2008-03-26 22:28:40 +00:00
Ted Kremenek ea128437b3 Bug fix: use GetRVal instead of GetLVal (were getting the value of a DeclRefExpr, not it's address).
llvm-svn: 48846
2008-03-26 22:21:58 +00:00
Ted Kremenek 9dd6ddec63 Added test case for static analysis to warn about passing uninitialized values as arguments (not the receiver) in message expressions.
llvm-svn: 48845
2008-03-26 22:00:11 +00:00
Ted Kremenek a1d9ed137a Added test case for static analyzer to detect uses of uninitialized pointers as receivers in Objective-C message expressions.
Added test case directory "Analysis-Apple" which is only run on Apple (darwin) machines.

llvm-svn: 48844
2008-03-26 21:51:44 +00:00
Ted Kremenek cb047289a8 Bug fix in transfer function for ObjCMessageExpr: Visit the receiver expression as an ordinary expression, not using VisitLVal.
llvm-svn: 48842
2008-03-26 21:36:08 +00:00
Steve Naroff c06ee808d7 Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
llvm-svn: 48841
2008-03-26 21:27:00 +00:00
Nuno Lopes 623207d603 allow the format attribute to be specified in function pointer prototypes
# this is my first commit here, so please be gentle :)

llvm-svn: 48807
2008-03-25 23:01:48 +00:00
Ted Kremenek 5efdf8457f Added hacked version of ccc script used to invoke the static analyzer. This
will gradually get pruned down, as it doesn't need to be as functional as
'ccc'.

llvm-svn: 48806
2008-03-25 22:35:32 +00:00
Nate Begeman c506c78117 Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.

llvm-svn: 48784
2008-03-25 18:36:32 +00:00
Nate Begeman 03851eb91f Add missing files
llvm-svn: 48783
2008-03-25 18:31:12 +00:00
Ted Kremenek 4b55badc39 GRSimple analysis now outputs additional diagnostic warnings about
passing an uninitialized value to a message expresion.

llvm-svn: 48776
2008-03-25 16:40:05 +00:00
Ted Kremenek 3335120f69 Tweak to transfer function for ObjCMessageExpr: handle both instance methods
and message expressions with a specified receiver.

llvm-svn: 48773
2008-03-25 16:07:41 +00:00
Ted Kremenek 945a246ad8 Added logic to check for uninitialized values as the receivers for message expressions
and uninitialized values passed-by-value as arguments to message expressions.

llvm-svn: 48760
2008-03-25 02:10:28 +00:00
Ted Kremenek 64100da427 Added initial transfer function support for ObjCMessageExpr.
llvm-svn: 48757
2008-03-25 00:34:37 +00:00
Ted Kremenek 7082a61074 Added "arg_iterators" to ObjCMessageExpr (for iterating over the arguments of a message expression)
llvm-svn: 48756
2008-03-25 00:16:48 +00:00
Ted Kremenek b2f4d3138f Minor CSS tweaking: use webkit style CSS properties for shadows/rounded edges
for message bubbles.

llvm-svn: 48754
2008-03-24 23:38:32 +00:00
Steve Naroff 65838bb2d5 Add a couple files to VC++ project and cleanup an "#if 0".
llvm-svn: 48748
2008-03-24 22:03:25 +00:00
Andrew Lenharth 10051b97fd debian amd64 testing
llvm-svn: 48745
2008-03-24 21:39:05 +00:00
Andrew Lenharth d8cde6f45d debian ia32 testing
llvm-svn: 48742
2008-03-24 21:25:48 +00:00
Chris Lattner 22fc992f59 Avoid overflowing buffer, patch by Algeris Kirtzidis!
llvm-svn: 48741
2008-03-24 21:14:55 +00:00
Sam Bishop ac92a13c86 The newest version of valgrind, 3.3.0, no longer appends PIDs to log filenames
by default.  Adding a %p works with this new version and is backwards
compatible, though it looks a little funny.

llvm-svn: 48698
2008-03-23 03:42:18 +00:00
Ted Kremenek fb475ec504 Changed merge operation for uninitialized values analysis to "intersect" (previous union).
The effect is that if a variable is uninitialized along a branch (but initialized along another), at merge points it is considered uninitialized.  Previously we had the opposite behavior.  The new behavior is more conservative, and more in line with gcc's behavior.

llvm-svn: 48689
2008-03-22 20:11:00 +00:00
Chris Lattner 97d496c182 Teach the rewriter how to respect the -o option.
llvm-svn: 48669
2008-03-22 00:08:40 +00:00
Chris Lattner 4f55259237 fix this test.
llvm-svn: 48668
2008-03-22 00:07:50 +00:00
Ted Kremenek 181f72369f Rename "Nodify" to "MakeNode"
llvm-svn: 48659
2008-03-21 21:30:14 +00:00
Sam Bishop f4303edfa3 Only invoke the preprocessor; it's the only thing being tested. Also, check
the output to make sure that the macros and comments are being treated as such.

llvm-svn: 48638
2008-03-21 08:05:55 +00:00
Sam Bishop 27654983dc Plug a memory leak in the "this macro expands into a single trivially-
expanded token" case.

llvm-svn: 48637
2008-03-21 07:13:02 +00:00
Sam Bishop 558447416d Use the -E option when invoking clang. Only the preprocessor is
required to perform this test.

llvm-svn: 48636
2008-03-21 07:02:04 +00:00
Gabor Greif 56c563ad3f Add ability to run clang tests under valgrind. Patch by Sam Bishop.
llvm-svn: 48621
2008-03-20 22:50:54 +00:00
Ted Kremenek b7151c7ca8 LiveVariables analysis now uses intersect for the merge of block-level expression liveness information.
The rationale is that a block-level expression cannot be live in a parent block unless it is live in all of the successor blocks.

llvm-svn: 48618
2008-03-20 21:46:49 +00:00
Gabor Greif fc39f15802 Use make's -C option to enter directories.
Also, do not try to remove build/ dir when
cleaning, this does not exist any more.

llvm-svn: 48599
2008-03-20 14:43:48 +00:00
Gabor Greif f5eb286707 reduce chattyness of makefiles
llvm-svn: 48597
2008-03-20 14:28:22 +00:00
Gabor Greif 4fa19e4047 scan testdirs only once, patch by Mike Stump, thanks!
llvm-svn: 48589
2008-03-20 08:09:10 +00:00
Ted Kremenek bc24962566 Added HTML highlighting for ranges.
llvm-svn: 48572
2008-03-19 23:55:53 +00:00
Steve Naroff 157c403cb8 Fix typo.
llvm-svn: 48571
2008-03-19 23:46:26 +00:00
Steve Naroff c5f8120ad0 Fix http://llvm.org/bugs/show_bug.cgi?id=2161.
llvm-svn: 48568
2008-03-19 23:07:49 +00:00
Ted Kremenek 161d16e083 Change colors of HTML message bubble.
llvm-svn: 48563
2008-03-19 22:44:21 +00:00
Ted Kremenek 7ee6a1474f More CSS enhancements to HTML code printing.
llvm-svn: 48557
2008-03-19 22:06:25 +00:00
Ted Kremenek 1651b7cd2d Misc. cleanups to HTML printing: make code rendered using tables; add
better div positioning for messages.

llvm-svn: 48555
2008-03-19 21:59:05 +00:00
Ted Kremenek 6189849d29 Minor speed tweak per Chris's suggestion: use &S[0] instead of S.c_str().
llvm-svn: 48544
2008-03-19 16:32:34 +00:00
Ted Kremenek a46655c5a3 Integrated some of Chris's comments; check for an empty string in InsertStrXXX()
before descending into the bowels of the Rewriter.

llvm-svn: 48541
2008-03-19 08:00:50 +00:00
Ted Kremenek 216624ce58 Initial experimentation with adding boxed "annotations" to HTMLized source.
llvm-svn: 48540
2008-03-19 07:53:42 +00:00
Ted Kremenek c6a8352820 Convert tabs to spaces.
llvm-svn: 48539
2008-03-19 07:31:52 +00:00
Ted Kremenek 966da4acc3 Moved generation of html header/footer with builtin CSS to the rewriter library.
llvm-svn: 48537
2008-03-19 06:14:37 +00:00
Chris Lattner 554221e9fb simplify code by using the variadic StructType::get method.
llvm-svn: 48535
2008-03-19 05:24:56 +00:00
Chris Lattner 3e593cdb98 simplify the clang codegen by using the new Builder.CreateStructGEP method.
llvm-svn: 48534
2008-03-19 05:19:41 +00:00
Ted Kremenek 3f8392626b More cleanups to the HTML rewriter (with line formatting), with better
pretty-printing of line numbers.

llvm-svn: 48533
2008-03-19 05:07:26 +00:00
Ted Kremenek d900897bb0 Added InsertStrXXX/InsertCStrXXX methods to the Rewriter to provide a simpler
interface to the rewriter when clients have NULL terminated strings or std::string.

llvm-svn: 48532
2008-03-19 05:06:49 +00:00
Ted Kremenek 54d62b6d64 Change "style" to "class" in HTML output.
llvm-svn: 48525
2008-03-19 01:44:27 +00:00
Ted Kremenek 5ddff02861 More cleanups to HTML rewriter API: remove the InsertTag method; was too complicated
and clients can achieve a cleaner design just by inserting tags directly.  Reserve
the "html" namespace for meta-level operations (e.g., escaping text, etc.)

llvm-svn: 48524
2008-03-19 01:30:02 +00:00
Ted Kremenek 8800ae68a0 More HTML rewriter cleanups. Preliminary CSS support in code pretty-printing.
llvm-svn: 48518
2008-03-18 23:55:46 +00:00
Ted Kremenek 5792cebb08 Some cleanups to the HTMLRewrite API. Added support for printing out line
numbers (more work to be done on aesthetics).

llvm-svn: 48512
2008-03-18 23:08:51 +00:00
Ted Kremenek b0c409a235 Added HTML pretty-printer.
llvm-svn: 48507
2008-03-18 22:21:07 +00:00
Ted Kremenek 1b580f98aa Modified "InsertTag" (HTML rewriter) to have an optional "OutermostTag" flag to
indicate whether or not the new tag should be the outermost tag at the specified
location (in the case that other tags have been inserted at the same spot).

llvm-svn: 48506
2008-03-18 21:26:34 +00:00
Ted Kremenek 7dcc82220e Added the beginning of a set of rewriter functions for pretty-printing source
code as HTML.  Added a new driver option "--emit-html" to dump the source
of the main input file as HTML.

llvm-svn: 48505
2008-03-18 21:19:49 +00:00
Ted Kremenek 45467ef372 Added variant of "InsertText" in the Rewriter to support inserting text both
*before* and after a specific location.

llvm-svn: 48504
2008-03-18 21:17:59 +00:00
Ted Kremenek af5b820af3 Bug fix in RewriteBuffer::getMappedOffset: potentially multiple deltas
need to be skipped over when AfterInserts == true, as multiple deltas
may share the same FileLoc.

llvm-svn: 48503
2008-03-18 21:00:57 +00:00
Ted Kremenek fa7ceba528 Fix comment.
llvm-svn: 48501
2008-03-18 20:13:06 +00:00
Steve Naroff 40af380782 Update project files.
llvm-svn: 48500
2008-03-18 20:05:40 +00:00
Steve Naroff ab63b6bd41 Test.
llvm-svn: 48499
2008-03-18 20:05:01 +00:00
Ted Kremenek d161e1f917 Added method "getSourceMgr" to class Rewriter.
llvm-svn: 48496
2008-03-18 19:43:13 +00:00
Gabor Greif 831c7c52c7 add 'clean' targets, make sure that 'make test' works after 'make clean'
llvm-svn: 48488
2008-03-18 07:03:00 +00:00
Gabor Greif 8bdc7b057d let the %t magic happen, thanks Chris!
llvm-svn: 48487
2008-03-18 06:42:43 +00:00
Gabor Greif 2d2b401c0e Switch over to the parallelized makefile, but keep old serial
makefile around (just change Makefile.parallel to Makefile to
get back old functionality).

To run parallel tests, specify

    make -jN test # where N = num of CPUs * 2

to get detailed output, run

    make -jN test VERBOSE=1

to only get error descriptions *after the tests have run*, type

    make report

this gives you the extra information which was omitted in non-VERBOSE
mode.

llvm-svn: 48486
2008-03-18 06:14:16 +00:00
Chris Lattner 0725a3e055 move #include to the file that needs it.
llvm-svn: 48485
2008-03-18 05:59:11 +00:00
Nate Begeman c24a1e3223 Fix a typo
llvm-svn: 48482
2008-03-18 03:38:14 +00:00
Steve Naroff 327f0f4c3a Fix <rdar://problem/5716940> rewriter generates invalid C code when no selector found.
llvm-svn: 48479
2008-03-18 02:02:04 +00:00
Steve Naroff 034bcb5bfa Wrap up __NSConstantStringImpl (the replacement for __builtin___CFStringMakeConstantString).
llvm-svn: 48477
2008-03-18 01:47:18 +00:00
Ted Kremenek a9b30c0651 Fix assertion.
llvm-svn: 48470
2008-03-17 22:18:22 +00:00
Ted Kremenek 9eae403cde Fix integer overflow bug when processing switch statements.
llvm-svn: 48469
2008-03-17 22:17:56 +00:00
Ted Kremenek 58021a617b Properly hook up inline asm transfer function logic to the main GRExprEngine logic.
llvm-svn: 48468
2008-03-17 21:31:48 +00:00
Ted Kremenek a9bd82634b Updated VS project files to reference all libraries in the "lib" subdirectory.
llvm-svn: 48467
2008-03-17 21:21:04 +00:00
Ted Kremenek 7c7a331f74 Added initial transfer function support for inline asm.
llvm-svn: 48466
2008-03-17 21:11:24 +00:00
Ted Kremenek 8628318085 Added "inputs" and "outputs" iterator (expression) for AsmStmt.
llvm-svn: 48465
2008-03-17 21:05:33 +00:00
Gabor Greif 1ac5215798 finishing touches: teminate the dots with a newline
llvm-svn: 48462
2008-03-17 18:36:14 +00:00
Nate Begeman 0c185c45a9 Check in a couple fixes for vector extensions.
llvm-svn: 48461
2008-03-17 17:22:18 +00:00
Ted Kremenek fff4fc7e6d Bug fix in CFG construction: VisitCompoundStmt should return the last created block.
llvm-svn: 48460
2008-03-17 17:19:44 +00:00
Gabor Greif 5434053f6d Implemented verbose mode.
make test VERBOSE=1
should now produce the same output like
the Makefile normally does.
Without VERBOSE only the names of failed tests
are printed.

I am pretty comfortable with this version, and
I think it is time to switch over to Makefile.parallel
to be the default.

What do you think? Did I forget some piece of feedback?

llvm-svn: 48458
2008-03-17 16:29:58 +00:00
Gabor Greif 430efdb95b Simplify further by creating *.testresults files
inside of the Output/ directory.
The testclean target could be removed now.

llvm-svn: 48457
2008-03-17 15:58:58 +00:00
Gabor Greif 4892b3fd5b Get rid of the creation of secondary makefile "Makefile.tests".
This implements second part of
<http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080310/004727.html>.

llvm-svn: 48456
2008-03-17 15:37:09 +00:00
Gabor Greif 2fc473069d More review feedback implemented:
Get rid of "awk" dependence by using same "make"
functionality:

<http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080310/004727.html>

llvm-svn: 48455
2008-03-17 15:07:59 +00:00
Gabor Greif d8d1b60237 Actually expand the %t1 patterns (in RUN: lines) to a unique
filename.
This fixes (e.g.) CodeGen/struct-x86-darwin.c which
raced at writing to "%t1" with other tests when parallel
testing was specified with a high "-j XX" value.

Also gets rid of the file tools/clang/test/%t1
when doing an "svn st" after testing.

llvm-svn: 48454
2008-03-17 13:45:47 +00:00