]> granicus.if.org Git - clang/log
clang
16 years agoMajor rewrite/refactoring of static analysis engine. We now use
Ted Kremenek [Tue, 29 Apr 2008 21:04:26 +0000 (21:04 +0000)]
Major rewrite/refactoring of static analysis engine. We now use
EvalStore/EvalLoad to handle all loads/stores from symbolic memory, allowing us
to do checks for null dereferences, etc., at any arbitrary load/store (these
were missed checks before). This also resulted in some major cleanups, some
conceptual, and others just in the structure of the code.

This temporarily introduces a regression in the test suite (null-deref-ps.c)
before I add a new LVal type for structure fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50443 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPass fobjc-gc-only and fobjc-gc options down to clang.
Ted Kremenek [Tue, 29 Apr 2008 16:24:23 +0000 (16:24 +0000)]
Pass fobjc-gc-only and fobjc-gc options down to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50426 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate typestate logic to support GC-mode.
Ted Kremenek [Tue, 29 Apr 2008 05:44:10 +0000 (05:44 +0000)]
Update typestate logic to support GC-mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50396 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement semantics of CFMakeCollectable for the CF-reference count checker.
Ted Kremenek [Tue, 29 Apr 2008 05:33:51 +0000 (05:33 +0000)]
Implement semantics of CFMakeCollectable for the CF-reference count checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50395 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoProvide the option to run the CF-retain checker in GC enabled mode.
Ted Kremenek [Tue, 29 Apr 2008 05:13:59 +0000 (05:13 +0000)]
Provide the option to run the CF-retain checker in GC enabled mode.
The transfer functions for the checker don't do anything special yet in GC mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50394 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoConvert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
Ted Kremenek [Tue, 29 Apr 2008 04:43:50 +0000 (04:43 +0000)]
Convert CFLF to LF.  CRLF was causing this test to fail under Mac OS X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50388 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd -fobjc-gc and -fobjc-gc-only options to the driver.
Ted Kremenek [Tue, 29 Apr 2008 04:37:03 +0000 (04:37 +0000)]
Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50387 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
Ted Kremenek [Mon, 28 Apr 2008 18:00:46 +0000 (18:00 +0000)]
Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.

Fixes: <rdar://problem/5892265>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50364 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCall ExitScope before ActOnFinishNamespaceDef.
Argyrios Kyrtzidis [Sun, 27 Apr 2008 14:10:57 +0000 (14:10 +0000)]
Call ExitScope before ActOnFinishNamespaceDef.
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50322 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoParsing of namespaces:
Argyrios Kyrtzidis [Sun, 27 Apr 2008 13:50:30 +0000 (13:50 +0000)]
Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse PushOnScopeChains to introduce a decl into scope.
Argyrios Kyrtzidis [Sun, 27 Apr 2008 13:30:35 +0000 (13:30 +0000)]
Use PushOnScopeChains to introduce a decl into scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50320 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake assertions for all addresses passed to ProgramPoint that they have at least...
Argyrios Kyrtzidis [Sat, 26 Apr 2008 15:19:51 +0000 (15:19 +0000)]
Make assertions for all addresses passed to ProgramPoint that they have at least an 8-byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50310 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPass down more -iXXX options that clang supports
Ted Kremenek [Fri, 25 Apr 2008 21:28:20 +0000 (21:28 +0000)]
Pass down more -iXXX options that clang supports

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50304 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix broken tag
Ted Kremenek [Fri, 25 Apr 2008 20:31:58 +0000 (20:31 +0000)]
fix broken tag

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50299 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother link fix.
Ted Kremenek [Fri, 25 Apr 2008 20:30:34 +0000 (20:30 +0000)]
Another link fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50298 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix links.
Ted Kremenek [Fri, 25 Apr 2008 20:29:37 +0000 (20:29 +0000)]
Fix links.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50297 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix bug in BugReporter where we didn't handle emitting diagnostics for
Ted Kremenek [Fri, 25 Apr 2008 19:01:27 +0000 (19:01 +0000)]
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

16 years agoAdded some notes about the LLVM "checker". This isn't a public link yet; still refining.
Ted Kremenek [Fri, 25 Apr 2008 18:44:36 +0000 (18:44 +0000)]
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

16 years agoremove the 'unused static' diagnostic from codegen. This should be
Chris Lattner [Fri, 25 Apr 2008 15:47:13 +0000 (15:47 +0000)]
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

16 years agoinitial support for recognizing __transparent_union__ attributes
Nuno Lopes [Fri, 25 Apr 2008 09:32:00 +0000 (09:32 +0000)]
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

16 years agoHandle dereferences of function pointers (which return a handle to the function).
Ted Kremenek [Fri, 25 Apr 2008 01:56:50 +0000 (01:56 +0000)]
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

16 years agoDon't abort on GetRVal when the LVal is a StringLiteralVal.
Ted Kremenek [Fri, 25 Apr 2008 01:45:38 +0000 (01:45 +0000)]
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

16 years agoDon't emit empty strings for path diagnostics when taking the default branch of a...
Ted Kremenek [Fri, 25 Apr 2008 01:29:56 +0000 (01:29 +0000)]
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

16 years agoDo a better job at computing dead symbols.
Ted Kremenek [Fri, 25 Apr 2008 01:25:15 +0000 (01:25 +0000)]
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

16 years agoAdd preliminary support for flagging leaks around when they happen (doesn't work...
Ted Kremenek [Thu, 24 Apr 2008 23:57:27 +0000 (23:57 +0000)]
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

16 years agoBetter handling for directory names in HTML diagnostics. Work in progress.
Ted Kremenek [Thu, 24 Apr 2008 23:37:03 +0000 (23:37 +0000)]
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

16 years agoMore boilerplate for handling specialized-transfer function logic for dead symbols.
Ted Kremenek [Thu, 24 Apr 2008 23:35:58 +0000 (23:35 +0000)]
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

16 years agoPatch to diagnose inconsistancies between properties declared in current and
Fariborz Jahanian [Thu, 24 Apr 2008 19:58:34 +0000 (19:58 +0000)]
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

16 years agoAdded initial boilerplate in GRExprEngine to allow checker-specific transfer
Ted Kremenek [Thu, 24 Apr 2008 18:31:42 +0000 (18:31 +0000)]
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

16 years agoAdded uninitialized-values (path-sensitive) test case as a regression test
Ted Kremenek [Thu, 24 Apr 2008 18:28:14 +0000 (18:28 +0000)]
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

16 years agoAdded test case for functionality fix in rdar://problem/5886141 (handle variadic...
Ted Kremenek [Thu, 24 Apr 2008 18:17:14 +0000 (18:17 +0000)]
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

16 years agoCF reference count checker: handle variadic functions that allocate CF objects.
Ted Kremenek [Thu, 24 Apr 2008 17:22:33 +0000 (17:22 +0000)]
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

16 years agoHave ValidateOutputConstraint return false instead of firing an assertion
Ted Kremenek [Thu, 24 Apr 2008 16:36:38 +0000 (16:36 +0000)]
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

16 years agoFor case statements involving enums, BugReporter now generates PathDiagnostics
Ted Kremenek [Wed, 23 Apr 2008 23:35:07 +0000 (23:35 +0000)]
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

16 years agoFix minor regression in bug report generation.
Ted Kremenek [Wed, 23 Apr 2008 23:04:32 +0000 (23:04 +0000)]
Fix minor regression in bug report generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50195 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with...
Ted Kremenek [Wed, 23 Apr 2008 23:02:12 +0000 (23:02 +0000)]
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

16 years agoFixed: <rdar://problem/5881148>
Ted Kremenek [Wed, 23 Apr 2008 20:12:28 +0000 (20:12 +0000)]
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

16 years agoTranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
Ted Kremenek [Wed, 23 Apr 2008 16:25:39 +0000 (16:25 +0000)]
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

16 years agoRemove false path where the default branch in a switch statement would
Ted Kremenek [Wed, 23 Apr 2008 05:03:18 +0000 (05:03 +0000)]
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

16 years agofix a rewriter crash on zero length files.
Chris Lattner [Wed, 23 Apr 2008 03:21:50 +0000 (03:21 +0000)]
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

16 years agoAdded panic function "assfail".
Ted Kremenek [Wed, 23 Apr 2008 00:41:25 +0000 (00:41 +0000)]
Added panic function "assfail".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50119 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPatch to build AST for property implementation declarations and
Fariborz Jahanian [Wed, 23 Apr 2008 00:06:01 +0000 (00:06 +0000)]
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

16 years agoFor default branches in switch statements with no default label, print out
Ted Kremenek [Tue, 22 Apr 2008 22:29:46 +0000 (22:29 +0000)]
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

16 years agoRewrote VisitDeclStmt to properly handle initializers that can do anything.
Ted Kremenek [Tue, 22 Apr 2008 22:25:27 +0000 (22:25 +0000)]
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

16 years agoAdded lval type (and tracking) for StringLiterals.
Ted Kremenek [Tue, 22 Apr 2008 21:39:21 +0000 (21:39 +0000)]
Added lval type (and tracking) for StringLiterals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowi...
Ted Kremenek [Tue, 22 Apr 2008 21:10:18 +0000 (21:10 +0000)]
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

16 years ago"This patch renames
Chris Lattner [Tue, 22 Apr 2008 18:39:57 +0000 (18:39 +0000)]
"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

16 years agoPathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
Ted Kremenek [Tue, 22 Apr 2008 16:15:03 +0000 (16:15 +0000)]
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

16 years agoUse back() instead of end()-1
Argyrios Kyrtzidis [Tue, 22 Apr 2008 07:37:18 +0000 (07:37 +0000)]
Use back() instead of end()-1

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50098 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded panic function "dtrace_assfail".
Ted Kremenek [Tue, 22 Apr 2008 06:09:33 +0000 (06:09 +0000)]
Added panic function "dtrace_assfail".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50091 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd VisitArraySubscriptExpr.
Ted Kremenek [Tue, 22 Apr 2008 05:40:28 +0000 (05:40 +0000)]
Add VisitArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50090 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHardcode "Assert" as a no-return function (panic).
Ted Kremenek [Tue, 22 Apr 2008 05:37:33 +0000 (05:37 +0000)]
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

16 years agoAdd some basic ARM asm constraints
Nate Begeman [Tue, 22 Apr 2008 05:03:19 +0000 (05:03 +0000)]
Add some basic ARM asm constraints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50085 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded null dereference test involving arrays.
Ted Kremenek [Tue, 22 Apr 2008 04:56:55 +0000 (04:56 +0000)]
Added null dereference test involving arrays.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50084 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded null-dereference check for ArraySubscriptExpr.
Ted Kremenek [Tue, 22 Apr 2008 04:56:29 +0000 (04:56 +0000)]
Added null-dereference check for ArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50083 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't double-increment counter for -arch and -isysroot
Nate Begeman [Tue, 22 Apr 2008 04:47:32 +0000 (04:47 +0000)]
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

16 years agoAllow property in base class to be implemented in a
Fariborz Jahanian [Mon, 21 Apr 2008 23:57:08 +0000 (23:57 +0000)]
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

16 years agoAdded missing expected-warning.
Ted Kremenek [Mon, 21 Apr 2008 23:45:26 +0000 (23:45 +0000)]
Added missing expected-warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50073 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded null dereference test case looking for null dereferences involving MemberExpr.
Ted Kremenek [Mon, 21 Apr 2008 23:44:17 +0000 (23:44 +0000)]
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

16 years agoAdded support for detected bad dereferences involving MemberExprs, e.g. x->f where...
Ted Kremenek [Mon, 21 Apr 2008 23:43:38 +0000 (23:43 +0000)]
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

16 years agoRemove unused "verbose" argument to compile(). Also unbreaks ccc-analyzer.
Ted Kremenek [Mon, 21 Apr 2008 21:58:05 +0000 (21:58 +0000)]
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

16 years agoMore semantics checks of properties. Property implementation can implicitly use
Fariborz Jahanian [Mon, 21 Apr 2008 21:57:36 +0000 (21:57 +0000)]
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

16 years agoSupport for @dynamic AST build.
Fariborz Jahanian [Mon, 21 Apr 2008 21:05:54 +0000 (21:05 +0000)]
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

16 years agoPass "-arch" down to clang.
Ted Kremenek [Mon, 21 Apr 2008 20:28:01 +0000 (20:28 +0000)]
Pass "-arch" down to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50056 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix pasto, thanks to Anders for pointing this out.
Chris Lattner [Mon, 21 Apr 2008 20:19:54 +0000 (20:19 +0000)]
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

16 years agoContinuation of work on ObjC2's properties.
Fariborz Jahanian [Mon, 21 Apr 2008 19:04:53 +0000 (19:04 +0000)]
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

16 years agoadd arm support
Chris Lattner [Mon, 21 Apr 2008 18:56:49 +0000 (18:56 +0000)]
add arm support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50049 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClean up handling of function redeclarations
Douglas Gregor [Mon, 21 Apr 2008 02:02:58 +0000 (02:02 +0000)]
Clean up handling of function redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50021 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix improper dereference of end() iterator. Patch by Argiris Kirtzidis!
Ted Kremenek [Sun, 20 Apr 2008 23:54:24 +0000 (23:54 +0000)]
Fix improper dereference of end() iterator.  Patch by Argiris Kirtzidis!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50012 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2236
Nate Begeman [Sun, 20 Apr 2008 20:38:08 +0000 (20:38 +0000)]
Fix PR2236
Add test
Implement feedback from Chris re: PR1998

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50001 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTwo improvements to initializer parsing:
Chris Lattner [Sun, 20 Apr 2008 19:07:56 +0000 (19:07 +0000)]
Two improvements to initializer parsing:
1. If we hit a semantic error, try harder to recover to emit
   diagnostics for later initializer errors (PR2241).
2. Don't leak parsed initializers on an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49998 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofor exponent-related errors, emit the diagnostic on the 'e' or 'p'.
Chris Lattner [Sun, 20 Apr 2008 18:47:55 +0000 (18:47 +0000)]
for exponent-related errors, emit the diagnostic on the 'e' or 'p'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49997 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agowhen emitting diagnostics about some character in a numeric
Chris Lattner [Sun, 20 Apr 2008 18:41:46 +0000 (18:41 +0000)]
when emitting diagnostics about some character in a numeric
literal, indicate what character the error is about or where
it would be.  For example:

pr2241.c:1:17: error: exponent has no digits
float f[] = { 1e  , 1ee0 };
                ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49996 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOnly generate code for static functions and global variables that are actually used.
Nate Begeman [Sun, 20 Apr 2008 06:29:50 +0000 (06:29 +0000)]
Only generate code for static functions and global variables that are actually used.
Warn about unused static functions and variables.
This fixes PR1998.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49987 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRestructure and simplify Sema::ObjCQualifiedIdTypesAreCompatible,
Chris Lattner [Sun, 20 Apr 2008 02:09:31 +0000 (02:09 +0000)]
Restructure and simplify Sema::ObjCQualifiedIdTypesAreCompatible,
deleting dead code, making other code more obvious, and fixing a
bug.  This fixes these (bogus) warnings in release mode:

SemaExprObjC.cpp:383: warning: 'RHSProtoE' may be used uninitialized in this function
SemaExprObjC.cpp:383: warning: 'RHSProtoI' may be used uninitialized in this function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49984 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agohtml::EscapeText (using the Rewriter) now replaces tabs by default.
Ted Kremenek [Sun, 20 Apr 2008 01:02:33 +0000 (01:02 +0000)]
html::EscapeText (using the Rewriter) now replaces tabs by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49982 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoimplement a fixme, add support for ++/-- on long double.
Chris Lattner [Sun, 20 Apr 2008 00:50:39 +0000 (00:50 +0000)]
implement a fixme, add support for ++/-- on long double.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49980 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agouse simplified ConstantFP:get method.
Chris Lattner [Sun, 20 Apr 2008 00:45:53 +0000 (00:45 +0000)]
use simplified ConstantFP:get method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49979 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoreplace form feeds with an <hr> tag.
Chris Lattner [Sat, 19 Apr 2008 23:56:30 +0000 (23:56 +0000)]
replace form feeds with an <hr> tag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49975 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplify the return of InitializePreprocessor to be bool instead of a fileid
Chris Lattner [Sat, 19 Apr 2008 23:25:44 +0000 (23:25 +0000)]
simplify the return of InitializePreprocessor to be bool instead of a fileid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49974 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplify ownership of the predefines buffer.
Chris Lattner [Sat, 19 Apr 2008 23:09:31 +0000 (23:09 +0000)]
simplify ownership of the predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49973 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoGracefully handle when the receiver of a message expression is not a pointer type.
Ted Kremenek [Sat, 19 Apr 2008 19:12:50 +0000 (19:12 +0000)]
Gracefully handle when the receiver of a message expression is not a pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49959 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPass "-isysroot" option down to clang.
Ted Kremenek [Sat, 19 Apr 2008 18:42:26 +0000 (18:42 +0000)]
Pass "-isysroot" option down to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49956 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix spelling/grammar in comment.
Ted Kremenek [Sat, 19 Apr 2008 18:07:44 +0000 (18:07 +0000)]
Fix spelling/grammar in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49955 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse Digest::MD5 (a Perl module that should come bundled standard with Perl) to comput...
Ted Kremenek [Sat, 19 Apr 2008 18:05:48 +0000 (18:05 +0000)]
Use Digest::MD5 (a Perl module that should come bundled standard with Perl) to compute file digests instead of using the external program "sha1sum" (which may not be present).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49954 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoGenerate code for annotation attributes.
Nate Begeman [Sat, 19 Apr 2008 04:17:09 +0000 (04:17 +0000)]
Generate code for annotation attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49951 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support to module codegen for adding and emitting annotations
Nate Begeman [Fri, 18 Apr 2008 23:43:57 +0000 (23:43 +0000)]
Add support to module codegen for adding and emitting annotations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49944 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIgnore qualifiers when attempting to match arguments to parameter types for
Nate Begeman [Fri, 18 Apr 2008 23:35:14 +0000 (23:35 +0000)]
Ignore qualifiers when attempting to match arguments to parameter types for
__builtin_overload

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49943 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
Nate Begeman [Fri, 18 Apr 2008 23:10:10 +0000 (23:10 +0000)]
OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother bug fix in emitting warnings without a path: construct a unit PathDiagnostic...
Ted Kremenek [Fri, 18 Apr 2008 22:56:53 +0000 (22:56 +0000)]
Another bug fix in emitting warnings without a path: construct a unit PathDiagnostic as we did
before.  This allows the HTMLDiagnostic object to retrieve the bug type, bug description, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49939 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix __attribute__(format) for struct function pointer fields
Nuno Lopes [Fri, 18 Apr 2008 22:43:39 +0000 (22:43 +0000)]
fix __attribute__(format) for struct function pointer fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49938 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list...
Steve Naroff [Fri, 18 Apr 2008 22:15:15 +0000 (22:15 +0000)]
Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49935 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReenable using the PathDiagnosticClient for BugReports without paths.
Ted Kremenek [Fri, 18 Apr 2008 22:11:59 +0000 (22:11 +0000)]
Reenable using the PathDiagnosticClient for BugReports without paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49934 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse 'clang' binary in the same dir as scan-build; if it isn't there use the one in...
Ted Kremenek [Fri, 18 Apr 2008 22:00:56 +0000 (22:00 +0000)]
Use 'clang' binary in the same dir as scan-build; if it isn't there use the one in the path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49933 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs...
Steve Naroff [Fri, 18 Apr 2008 21:55:08 +0000 (21:55 +0000)]
Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs outside a method are being rewritten

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49932 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTurn on CF reference count checker.
Ted Kremenek [Fri, 18 Apr 2008 21:53:01 +0000 (21:53 +0000)]
Turn on CF reference count checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49931 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix <rdar://problem/5874697> Rewriter: method arguments with complex types not being...
Steve Naroff [Fri, 18 Apr 2008 21:13:19 +0000 (21:13 +0000)]
Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being rewritten properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49925 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoGeneralize caching mechanism for bugs reports. Now individual BugTypes
Ted Kremenek [Fri, 18 Apr 2008 20:54:29 +0000 (20:54 +0000)]
Generalize caching mechanism for bugs reports.  Now individual BugTypes
can decide the policy on how to cache related bugs.  This allows us to
properly to handle warning about multiple leaks in the same location in the
ref count checker (not yet done).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49918 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed more caching bugs related to the one fixed in r49914. Silence
Ted Kremenek [Fri, 18 Apr 2008 20:35:30 +0000 (20:35 +0000)]
Fixed more caching bugs related to the one fixed in r49914.  Silence
compiler warning introduced by a recent patch of mine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49917 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed elusive caching bug that led to false positives.
Ted Kremenek [Fri, 18 Apr 2008 19:34:16 +0000 (19:34 +0000)]
Fixed elusive caching bug that led to false positives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49914 91177308-0d34-0410-b5e6-96231b3b80d8