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

3506 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 2673c9ff76 Fix bug in BugReporter where we didn't handle emitting diagnostics for
empty CFGBlocks that only contained a terminator.

Added improved diagnostics for break and continue statements and default branches in switch statements.

This fixes <rdar://problem/5889244>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50286 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 19:01:27 +00:00
Ted Kremenek ce2e33258a Added some notes about the LLVM "checker". This isn't a public link yet; still refining.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50283 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 18:44:36 +00:00
Chris Lattner 5827754da1 remove the 'unused static' diagnostic from codegen. This should be
reimplemented in Sema someday.  This is tracked in PR2236.  Until then
disabling it removes some bogus diagnostics (see 2236).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 15:47:13 +00:00
Nuno Lopes 27ae6c6531 initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 09:32:00 +00:00
Ted Kremenek 4b443a6142 Handle dereferences of function pointers (which return a handle to the function).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 01:56:50 +00:00
Ted Kremenek 2bfe9ea822 Don't abort on GetRVal when the LVal is a StringLiteralVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50245 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 01:45:38 +00:00
Ted Kremenek 567839273d Don't emit empty strings for path diagnostics when taking the default branch of a switch statement that has no label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50242 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 01:29:56 +00:00
Ted Kremenek 910e999c19 Do a better job at computing dead symbols.
Implemented support for better localized leaks in the CF reference count checker.
Now leaks should be flagged close to where they occur.

This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 01:25:15 +00:00
Ted Kremenek 652adc6c5d Add preliminary support for flagging leaks around when they happen (doesn't work yet).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:57:27 +00:00
Ted Kremenek 7fc89572d1 Better handling for directory names in HTML diagnostics. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:37:03 +00:00
Ted Kremenek 846d4e923b More boilerplate for handling specialized-transfer function logic for dead symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:35:58 +00:00
Fariborz Jahanian b5e0224173 Patch to diagnose inconsistancies between properties declared in current and
its super class. This patch is incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 19:58:34 +00:00
Ted Kremenek 77d7ef8d8a Added initial boilerplate in GRExprEngine to allow checker-specific transfer
function logic to act when symbols become dead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50221 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 18:31:42 +00:00
Ted Kremenek 43ae4b0d2b Added uninitialized-values (path-sensitive) test case as a regression test
for the fix in r50178 (http://llvm.org/viewvc/llvm-project?rev=50178&view=rev).
This fix was for <rdar://problem/5881148>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 18:28:14 +00:00
Ted Kremenek 08e48c1aff Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 18:17:14 +00:00
Ted Kremenek 891d5ccc46 CF reference count checker: handle variadic functions that allocate CF objects.
This fixes <rdar://problem/5886141>.

Part of this change resulted in creating sparser summaries.  I also added
some more comments and did some minor code cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 17:22:33 +00:00
Ted Kremenek 5ab201a324 Have ValidateOutputConstraint return false instead of firing an assertion
when processing a constraint we don't understand.  This allows the frontend
to gracefully fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50213 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 16:36:38 +00:00
Ted Kremenek 5a429954ae For case statements involving enums, BugReporter now generates PathDiagnostics
that say that we are jumping to "case a" instead of "case 0".

This is a feature implementation for <rdar://problem/5880430>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50197 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 23:35:07 +00:00
Ted Kremenek 6aaca9cbf2 Fix minor regression in bug report generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 23:04:32 +00:00
Ted Kremenek a43a1eb6e7 When building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with a single path that BugReport objects can safely walk and introspect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 23:02:12 +00:00
Ted Kremenek 186350f192 Fixed: <rdar://problem/5881148>
Problem:

In the recently refactored VisitDeref (which processes dereferences), we
were incorrectly skipping the node just generated for the subexpression
of the dereference.  This was a horrible regression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 20:12:28 +00:00
Ted Kremenek c1e9dea3d9 TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
when it is constructed via deserialization.  This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object.  This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.

The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc.  During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 16:25:39 +00:00
Ted Kremenek 5014ab113e Remove false path where the default branch in a switch statement would
always be taken even if it was not feasible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 05:03:18 +00:00
Chris Lattner c66d0aa934 fix a rewriter crash on zero length files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 03:21:50 +00:00
Ted Kremenek 688738fcf8 Added panic function "assfail".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 00:41:25 +00:00
Fariborz Jahanian 628b96f34e Patch to build AST for property implementation declarations and
to print declaration from its AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 00:06:01 +00:00
Ted Kremenek 8b90455743 For default branches in switch statements with no default label, print out
the line we are going to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50113 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 22:29:46 +00:00
Ted Kremenek 5b7dcce86c Rewrote VisitDeclStmt to properly handle initializers that can do anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 22:25:27 +00:00
Ted Kremenek a548846b47 Added lval type (and tracking) for StringLiterals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 21:39:21 +00:00
Ted Kremenek 0fe33bc94a Added "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowing us to track lvals when they are casted back to pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 21:10:18 +00:00
Chris Lattner 9fdf9c6d35 "This patch renames
DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 18:39:57 +00:00
Ted Kremenek 5585114307 PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
them to not be stack-allocated.

HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor.
This is a workaround for a problem when we trampled the Preprocessor state
when highlighting macros (sometimes resulting in an assertion failure).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 16:15:03 +00:00
Argyrios Kyrtzidis 5fc073fe3b Use back() instead of end()-1
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 07:37:18 +00:00
Ted Kremenek 9a108ae69e Added panic function "dtrace_assfail".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 06:09:33 +00:00
Ted Kremenek c5b1bf1013 Add VisitArraySubscriptExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50090 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:40:28 +00:00
Ted Kremenek 9a094cbf19 Hardcode "Assert" as a no-return function (panic).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:37:33 +00:00
Nate Begeman ad487f4ef2 Add some basic ARM asm constraints
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:03:19 +00:00
Ted Kremenek 9704eacf27 Added null dereference test involving arrays.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 04:56:55 +00:00
Ted Kremenek 540cbe2b60 Added null-dereference check for ArraySubscriptExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 04:56:29 +00:00
Nate Begeman 4cd3603978 Don't double-increment counter for -arch and -isysroot
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 04:47:32 +00:00
Fariborz Jahanian c70bee863b Allow property in base class to be implemented in a
derived class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 23:57:08 +00:00
Ted Kremenek 3603d736a7 Added missing expected-warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50073 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 23:45:26 +00:00
Ted Kremenek b9ab690786 Added null dereference test case looking for null dereferences involving MemberExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 23:44:17 +00:00
Ted Kremenek 469ecbded3 Added support for detected bad dereferences involving MemberExprs, e.g. x->f where "x" is NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 23:43:38 +00:00
Ted Kremenek fe87354769 Remove unused "verbose" argument to compile(). Also unbreaks ccc-analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 21:58:05 +00:00
Fariborz Jahanian 6cdf16d61d More semantics checks of properties. Property implementation can implicitly use
ivar of same name. 
Better diagnostics to bring home this point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50065 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 21:57:36 +00:00
Fariborz Jahanian c35b9e4e2e Support for @dynamic AST build.
More property semantics checking.
First test case for ObjC2's property implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 21:05:54 +00:00
Ted Kremenek d0eef024e9 Pass "-arch" down to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50056 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 20:28:01 +00:00
Chris Lattner d0c33d3527 Fix pasto, thanks to Anders for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 20:19:54 +00:00
Fariborz Jahanian 559c0c4bbe Continuation of work on ObjC2's properties.
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 19:04:53 +00:00