Граф коммитов

3134 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 09c2ad63c3 The ccc-analyzer script now interrogates environment variables to determine
where to dump HTML reports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:25:05 +00:00
Ted Kremenek 615f517709 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48986 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:23:15 +00:00
Ted Kremenek f186f303ee Disable timing diagnostics for GRSimpleVals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48981 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 16:00:32 +00:00
Ted Kremenek 02737ed29d 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 15:02:58 +00:00
Chris Lattner 8a934233d1 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 00:36:02 +00:00
Chris Lattner ce5605ecf7 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 23:25:33 +00:00
Chris Lattner 391d77a263 Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 23:03:07 +00:00
Steve Naroff a7b402dc25 Only have the rewriter produce a file when there are no errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 22:26:09 +00:00
Steve Naroff 95110968dc Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 21:37:05 +00:00
Ted Kremenek 8730e130ab 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".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 16:09:38 +00:00
Steve Naroff 9630ec5b67 Add some of Ted's recent work to the VC++ project file.
Fix a couple bozo bugs in the rewriter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 22:59:54 +00:00
Steve Naroff ba92b2ed97 Collect all the preamble code and don't insert it until the end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 22:29:16 +00:00
Ted Kremenek 4ba6283f9c Expanded NSString checking to check for nil for a few more methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 22:05:32 +00:00
Ted Kremenek 9b3fdeaca3 Add line SourceLocation to NSString checks.
Added test case to test warning about passing 'nil' to NSString's compare: method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 21:23:57 +00:00
Ted Kremenek e5d5c204c7 Hooked up initial NSString interface checking to GRSimpleVals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 21:15:17 +00:00
Ted Kremenek 0f9063c116 ProgramPoint is just a smart pointer; no reason to return a constant reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 18:11:59 +00:00
Ted Kremenek 487f827a7f Minor CSS tweaking (smaller h1 tags).
Bug fix in EscapeText (for std::string) where spaces were not properly emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:28:58 +00:00
Ted Kremenek 5d0f592b9d For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:25:28 +00:00
Ted Kremenek bc8e016aed Update Xcode project: add BasicObjCFoundationChecks.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:17:51 +00:00
Ted Kremenek 527556184b Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:17:22 +00:00
Ted Kremenek 5c6422f36c Add default ctor implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:16:06 +00:00
Ted Kremenek 053ef593fa Add html::EscapeText for std::string; use this function to escape text in message bubbles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:15:29 +00:00
Ted Kremenek 1c33975b21 Don't emit any timings for GRSimple if the CFG is not going to be built.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:14:42 +00:00
Ted Kremenek 5d00f86d62 Output directory as well as file name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:39:04 +00:00
Ted Kremenek 2e93981a62 Added <h3> tag in HTML file output that contains the name of the source file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:35:49 +00:00
Ted Kremenek fb5610d016 Added AnnotatedPath.h, GRAuditor.h, GRSimpleAPICheck.h and BasicObjCFoundationChecks.cpp to Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:26:42 +00:00
Ted Kremenek 99c6ad3f22 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:25:52 +00:00
Ted Kremenek 50e58c1623 Updated Xcode project with HTMLDiagnostics.[h,cpp]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 06:18:34 +00:00
Ted Kremenek 88f5cde90d 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 06:17:42 +00:00
Ted Kremenek 120187de4b PathDiagnosticPiece no longer contains a vector of strings; just one string.
PathDiagnostic no longer contains a diagnostic ID or diagnostic level.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 06:16:40 +00:00
Ted Kremenek 2b70af4169 Fixed copy-paste error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 05:52:45 +00:00
Ted Kremenek b8540c6e53 Added PathDiagnostic.[h,cpp] to Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 03:50:10 +00:00
Ted Kremenek d3abcdfa30 Added classes "PathDiagnosticPiece", "PathDiagnostic", and "PathDiagnosticClient", which encapsulate diagnostic reporting for paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 03:49:32 +00:00
Ted Kremenek c74840329e In ObjCMessageExpr: getSelector() const should just return "Selector", not "const Selector&" because Selector is just a smart pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 03:47:43 +00:00
Steve Naroff 49535efa7d 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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 22:28:40 +00:00
Ted Kremenek a056b4f7f0 Bug fix: use GetRVal instead of GetLVal (were getting the value of a DeclRefExpr, not it's address).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 22:21:58 +00:00
Ted Kremenek 5f67d13b3b Added test case for static analysis to warn about passing uninitialized values as arguments (not the receiver) in message expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 22:00:11 +00:00
Ted Kremenek 2daf5b622b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 21:51:44 +00:00
Ted Kremenek 5af373a0c2 Bug fix in transfer function for ObjCMessageExpr: Visit the receiver expression as an ordinary expression, not using VisitLVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 21:36:08 +00:00
Steve Naroff c5e2f34df1 Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 21:27:00 +00:00
Nuno Lopes 8c1a9a80ba allow the format attribute to be specified in function pointer prototypes
# this is my first commit here, so please be gentle :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48807 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 23:01:48 +00:00
Ted Kremenek b0982880c0 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'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 22:35:32 +00:00
Nate Begeman 8e7dafec4b Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 18:36:32 +00:00
Nate Begeman 245f1b559e Add missing files
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 18:31:12 +00:00
Ted Kremenek dbfe41acda GRSimple analysis now outputs additional diagnostic warnings about
passing an uninitialized value to a message expresion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 16:40:05 +00:00
Ted Kremenek b9308372e0 Tweak to transfer function for ObjCMessageExpr: handle both instance methods
and message expressions with a specified receiver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48773 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 16:07:41 +00:00
Ted Kremenek 23a4f917cd Added logic to check for uninitialized values as the receivers for message expressions
and uninitialized values passed-by-value as arguments to message expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 02:10:28 +00:00
Ted Kremenek 55deb97341 Added initial transfer function support for ObjCMessageExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 00:34:37 +00:00
Ted Kremenek 3fb94d87b9 Added "arg_iterators" to ObjCMessageExpr (for iterating over the arguments of a message expression)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 00:16:48 +00:00
Ted Kremenek 9d4e659fce Minor CSS tweaking: use webkit style CSS properties for shadows/rounded edges
for message bubbles.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 23:38:32 +00:00