]> granicus.if.org Git - clang/log
clang
16 years agoTighten up handling of __func__ and friends: it should be an array
Chris Lattner [Sat, 12 Jan 2008 18:39:25 +0000 (18:39 +0000)]
Tighten up handling of __func__ and friends: it should be an array
of const char, and it should error if it occurs outside a function.

Is it valid in an objc method?  If so we should handle that too.

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

16 years agoFix the type of predefined identifiers like __func__. Patch by
Chris Lattner [Sat, 12 Jan 2008 08:14:25 +0000 (08:14 +0000)]
Fix the type of predefined identifiers like __func__.  Patch by
Eli Friedman!

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

16 years agoFix a fixme, by only parsing extern "C" in C++ mode.
Chris Lattner [Sat, 12 Jan 2008 07:08:43 +0000 (07:08 +0000)]
Fix a fixme, by only parsing extern "C" in C++ mode.

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

16 years agoAdd first pieces of support for parsing and representing
Chris Lattner [Sat, 12 Jan 2008 07:05:38 +0000 (07:05 +0000)]
Add first pieces of support for parsing and representing
extern "C" in C++ mode.  Patch by Mike Stump!

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

16 years agoWhen forming the squigly underline for a diagnostic, make sure to
Chris Lattner [Sat, 12 Jan 2008 06:43:35 +0000 (06:43 +0000)]
When forming the squigly underline for a diagnostic, make sure to
verify that the source range corresponds to the current file, not
just the current line.  This allows us to emit:

a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
                                         ~ ^

instead of:

a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~                                        ~ ^

for PR1906 (note the leading ~).

Thanks to Neil for noticing this.

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

16 years agoFix misspelling of "existent".
Ted Kremenek [Fri, 11 Jan 2008 20:42:05 +0000 (20:42 +0000)]
Fix misspelling of "existent".
Do not use std::cerr; use llvm::cerr instead.

Patch provided by Sam Bishop!

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

16 years agoAdded ProgramPoint.cpp, which implements several methods of the subclasses
Ted Kremenek [Fri, 11 Jan 2008 16:36:20 +0000 (16:36 +0000)]
Added ProgramPoint.cpp, which implements several methods of the subclasses
of ProgramPoint.

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

16 years agoRenamed ProgramEdge.h to ProgramPoint.h
Ted Kremenek [Fri, 11 Jan 2008 00:43:12 +0000 (00:43 +0000)]
Renamed ProgramEdge.h to ProgramPoint.h

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

16 years agoRenamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
Ted Kremenek [Fri, 11 Jan 2008 00:40:29 +0000 (00:40 +0000)]
Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).

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

16 years agoFixed 80-col violation.
Ted Kremenek [Fri, 11 Jan 2008 00:18:40 +0000 (00:18 +0000)]
Fixed 80-col violation.

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

16 years agoAvoid redefinition of __objcFastEnumerationState
Fariborz Jahanian [Thu, 10 Jan 2008 23:04:06 +0000 (23:04 +0000)]
Avoid redefinition of __objcFastEnumerationState

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

16 years ago- Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I noticed...
Steve Naroff [Thu, 10 Jan 2008 22:15:12 +0000 (22:15 +0000)]
- Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I noticed it was missing).
- Rename CheckInitializer() to CheckInitializerTypes().
- Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately.
- Added CheckForConstantInitializer().

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

16 years agoRecover from user typo not having proper @interface decl and a bad foreach decl.
Fariborz Jahanian [Thu, 10 Jan 2008 20:33:58 +0000 (20:33 +0000)]
Recover from user typo not having proper @interface decl and a bad foreach decl.

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

16 years agoRemove non-ascii chaaracter from diagnostic
Fariborz Jahanian [Thu, 10 Jan 2008 18:10:31 +0000 (18:10 +0000)]
Remove non-ascii chaaracter from diagnostic

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

16 years agoFixed non-ASCII quote.
Ted Kremenek [Thu, 10 Jan 2008 18:08:55 +0000 (18:08 +0000)]
Fixed non-ASCII quote.

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

16 years agoWarn (as gcc does) when @end does not close anything.
Fariborz Jahanian [Thu, 10 Jan 2008 17:58:07 +0000 (17:58 +0000)]
Warn (as gcc does) when @end does not close anything.

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

16 years agoAdded some text about the ccc script provided by Sanghyeon Seo.
Ted Kremenek [Thu, 10 Jan 2008 04:59:05 +0000 (04:59 +0000)]
Added some text about the ccc script provided by Sanghyeon Seo.

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

16 years agoadd support for the GCC -include option.
Chris Lattner [Thu, 10 Jan 2008 01:53:41 +0000 (01:53 +0000)]
add support for the GCC -include option.

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

16 years agoCompiler driver
Seo Sanghyeon [Thu, 10 Jan 2008 01:43:47 +0000 (01:43 +0000)]
Compiler driver

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

16 years agoFix some 80 col violations
Chris Lattner [Thu, 10 Jan 2008 01:43:14 +0000 (01:43 +0000)]
Fix some 80 col violations

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

16 years agoTed apparently likes crazy whitespace at the end of line. Crush his spirit by
Chris Lattner [Thu, 10 Jan 2008 01:41:55 +0000 (01:41 +0000)]
Ted apparently likes crazy whitespace at the end of line.  Crush his spirit by
removing them, fitting the file into 80 columns. :)

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

16 years agoPut return type of synthesize method on same line as method declaration, space after...
Fariborz Jahanian [Thu, 10 Jan 2008 01:39:52 +0000 (01:39 +0000)]
Put return type of synthesize method on same line as method declaration, space after method declaration header.

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

16 years agoAdded "InfeasibleEdge" to represent an infeasible state transition.
Ted Kremenek [Thu, 10 Jan 2008 00:58:25 +0000 (00:58 +0000)]
Added "InfeasibleEdge" to represent an infeasible state transition.

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

16 years agoPass rewritten output to 'clang' for verification.
Fariborz Jahanian [Thu, 10 Jan 2008 00:30:24 +0000 (00:30 +0000)]
Pass rewritten output to 'clang' for verification.

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

16 years agoAllow messaging expression as foreach's collection expression.
Fariborz Jahanian [Thu, 10 Jan 2008 00:24:29 +0000 (00:24 +0000)]
Allow messaging expression as foreach's collection expression.

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

16 years agoAdd a FIXME to commit r45784. Thanks mrs!
Steve Naroff [Wed, 9 Jan 2008 23:44:05 +0000 (23:44 +0000)]
Add a FIXME to commit r45784. Thanks mrs!

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

16 years agoFix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls that aren...
Steve Naroff [Wed, 9 Jan 2008 23:34:55 +0000 (23:34 +0000)]
Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs).

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

16 years agoRenamed various traits and classes. Added "Infeasible" bit to ExplodedNodeImpl
Ted Kremenek [Wed, 9 Jan 2008 23:11:36 +0000 (23:11 +0000)]
Renamed various traits and classes. Added "Infeasible" bit to ExplodedNodeImpl
so that nodes can be marked as representing an infeasible program point. This
flag lets the path-sensitive solver know that no successors should be generated
for such nodes.

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

16 years agoRenamed Stmt***Edge and ***StmtEdge (where *** = "Stmt" or "Blk") classes to
Ted Kremenek [Wed, 9 Jan 2008 22:52:38 +0000 (22:52 +0000)]
Renamed Stmt***Edge and ***StmtEdge (where *** = "Stmt" or "Blk") classes to
BExpr*** and ***BExpr respectively. These edges represent program locations
between the entrance/exit of a block and Block-level Expressions.

Also added ***SExpr and SExpr*** ProgramEdges to represent the locations in the
program between the evaluation of subexpressions and block-level expressions.

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

16 years agoRemoved some files related to the path-sensitive solver as part of some
Ted Kremenek [Wed, 9 Jan 2008 22:49:37 +0000 (22:49 +0000)]
Removed some files related to the path-sensitive solver as part of some
code restructuring.  (new files will be introduced shortly)

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

16 years agoFix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 6.7.2...
Steve Naroff [Wed, 9 Jan 2008 22:43:08 +0000 (22:43 +0000)]
Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 6.7.2.2p4).
Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible...

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

16 years agoTeach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.
Steve Naroff [Wed, 9 Jan 2008 20:58:06 +0000 (20:58 +0000)]
Teach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.

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

16 years agoFix isIntegerConstantExpr to compare against zero for casts to bool instead of
Chris Lattner [Wed, 9 Jan 2008 18:59:34 +0000 (18:59 +0000)]
Fix isIntegerConstantExpr to compare against zero for casts to bool instead of
truncating.  This allows us to compile:
 void foo() {
  static _Bool foo = 4;
}

into:
@foo1 = internal global i8 1
instead of:
@foo1 = internal global i8 4

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

16 years agoimplement proper support for _Bool in memory, which is usually i8, not i1.
Chris Lattner [Wed, 9 Jan 2008 18:47:25 +0000 (18:47 +0000)]
implement proper support for _Bool in memory, which is usually i8, not i1.
This fixes a crash reported by Seo Sanghyeon

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

16 years agoType-cast RHS of assignment to prevent warning compiling rewritten foreach code.
Fariborz Jahanian [Wed, 9 Jan 2008 18:15:42 +0000 (18:15 +0000)]
Type-cast RHS of assignment to prevent warning compiling rewritten foreach code.

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

16 years agoFixed a bug whereby a parethesized collection expression was not being rewritten...
Fariborz Jahanian [Wed, 9 Jan 2008 17:50:00 +0000 (17:50 +0000)]
Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.

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

16 years agoTypo fixed.
Fariborz Jahanian [Wed, 9 Jan 2008 01:25:54 +0000 (01:25 +0000)]
Typo fixed.

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

16 years agoAnother test case for testing rewriteing of nested foreach-statement.
Fariborz Jahanian [Wed, 9 Jan 2008 00:47:02 +0000 (00:47 +0000)]
Another test case for testing rewriteing of nested foreach-statement.

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

16 years agoRemove dependency on objc.h
Fariborz Jahanian [Wed, 9 Jan 2008 00:33:05 +0000 (00:33 +0000)]
Remove dependency on objc.h

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

16 years agoTeach Expr::isConstantExpr() about CompoundLiterals.
Steve Naroff [Wed, 9 Jan 2008 00:05:37 +0000 (00:05 +0000)]
Teach Expr::isConstantExpr() about CompoundLiterals.

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

16 years agoFix a typo, patch by Mike Stump!
Chris Lattner [Wed, 9 Jan 2008 00:00:15 +0000 (00:00 +0000)]
Fix a typo, patch by Mike Stump!

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

16 years agoPatch to rewrite ObjC2's foreach-stmt.
Fariborz Jahanian [Tue, 8 Jan 2008 22:06:28 +0000 (22:06 +0000)]
Patch to rewrite ObjC2's foreach-stmt.

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

16 years agoAdded VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.
Ted Kremenek [Tue, 8 Jan 2008 18:19:08 +0000 (18:19 +0000)]
Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.

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

16 years agoAdded VISIBILITY_HIDDEN to classes/structs in anonymous namespace.
Ted Kremenek [Tue, 8 Jan 2008 18:15:10 +0000 (18:15 +0000)]
Added VISIBILITY_HIDDEN to classes/structs in anonymous namespace.

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

16 years agoAdded most of the boilerplate to the driver needed to run the graph-reachability
Ted Kremenek [Tue, 8 Jan 2008 18:04:06 +0000 (18:04 +0000)]
Added most of the boilerplate to the driver needed to run the graph-reachability
constant propagation analysis.

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

16 years agoreadability improvement suggested by Sam Bishop, thanks!
Chris Lattner [Tue, 8 Jan 2008 04:13:21 +0000 (04:13 +0000)]
readability improvement suggested by Sam Bishop, thanks!

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

16 years agoFix Sema::CheckConditionalOperands(). The null pointer constant checks need to preced...
Steve Naroff [Tue, 8 Jan 2008 01:11:38 +0000 (01:11 +0000)]
Fix Sema::CheckConditionalOperands(). The null pointer constant checks need to precede the check for two pointer operands.

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

16 years agoAdded nodes_iterator to the GraphTrait for ExplodedNode<>.
Ted Kremenek [Tue, 8 Jan 2008 00:46:00 +0000 (00:46 +0000)]
Added nodes_iterator to the GraphTrait for ExplodedNode<>.

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

16 years agoAdded GraphTraits<> partial specializations for ExplodedNode<> classes.
Ted Kremenek [Tue, 8 Jan 2008 00:26:05 +0000 (00:26 +0000)]
Added GraphTraits<> partial specializations for ExplodedNode<> classes.

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

16 years agoRelocated comment in header.
Ted Kremenek [Tue, 8 Jan 2008 00:07:06 +0000 (00:07 +0000)]
Relocated comment in header.

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

16 years agoAdded more boilerplate for processing end-of-paths.
Ted Kremenek [Mon, 7 Jan 2008 22:22:13 +0000 (22:22 +0000)]
Added more boilerplate for processing end-of-paths.

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

16 years agoAdded ownership of "checker state" within the ExplodedGraph. Moved code that
Ted Kremenek [Mon, 7 Jan 2008 21:56:52 +0000 (21:56 +0000)]
Added ownership of "checker state" within the ExplodedGraph. Moved code that
creates the initial root node from the constructor of ReachabilityEngine to
ReachabilityEngine::ExecuteWorklist.

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

16 years agoPatch to start rewriting of ObjC2's foreach statement (work in progress).
Fariborz Jahanian [Mon, 7 Jan 2008 21:40:22 +0000 (21:40 +0000)]
Patch to start rewriting of ObjC2's foreach statement (work in progress).

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

16 years agoVerify/add code to make sure types passed to interfaceTypesAreCompatible
Fariborz Jahanian [Mon, 7 Jan 2008 20:12:21 +0000 (20:12 +0000)]
Verify/add code to make sure types passed to interfaceTypesAreCompatible
are canonical. Asst in interfaceTypesAreCompatible if they are not.

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

16 years agoFix a nasty corner case that Neil noticed in PR1900, where we would
Chris Lattner [Mon, 7 Jan 2008 19:50:27 +0000 (19:50 +0000)]
Fix a nasty corner case that Neil noticed in PR1900, where we would
incorrectly apply the multiple include optimization to files with
guards like:

#if !defined(x) MACRO

where MACRO could expand to different things in different contexts.
Thanks Neil!

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

16 years agoSubstituted all instances of the string "Objc" for "ObjC". This fixes
Ted Kremenek [Mon, 7 Jan 2008 19:49:32 +0000 (19:49 +0000)]
Substituted all instances of the string "Objc" for "ObjC".  This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.

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

16 years agoMake interfaceTypesAreCompatible a private method.
Fariborz Jahanian [Mon, 7 Jan 2008 19:13:39 +0000 (19:13 +0000)]
Make interfaceTypesAreCompatible a private method.

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

16 years agoRenamed SimulVertex, SimulGraph, and SimulEngine to:
Ted Kremenek [Mon, 7 Jan 2008 19:08:42 +0000 (19:08 +0000)]
Renamed SimulVertex, SimulGraph, and SimulEngine to:
  ExplodedNode, ExplodedGraph  (to match the vocabulary in the RHS paper)
  ReachabilityEngine

The implementation of the core of the path-sensitive dataflow solver has
been de-templatized and places in ReachabilityEngine.cpp.

The solver is still incomplete.

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

16 years agoMinor tweak to serialization of ObjcForCollectionStmt: the three owned pointers
Ted Kremenek [Mon, 7 Jan 2008 18:35:04 +0000 (18:35 +0000)]
Minor tweak to serialization of ObjcForCollectionStmt: the three owned pointers
are now emitted in a batch, which reduces the metadata overhead in the
serialized bitcode.

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

16 years agoLimit type of foreach's element and collection to be a pointer to
Fariborz Jahanian [Mon, 7 Jan 2008 18:14:04 +0000 (18:14 +0000)]
Limit type of foreach's element and collection to be a pointer to
objc object type.

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

16 years agoIssue diagnostics if more than one declaration in objectove-c's foreach-stmt header.
Fariborz Jahanian [Mon, 7 Jan 2008 17:52:35 +0000 (17:52 +0000)]
Issue diagnostics if more than one declaration in objectove-c's foreach-stmt header.

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

16 years agominor cleanup.
Chris Lattner [Mon, 7 Jan 2008 17:51:46 +0000 (17:51 +0000)]
minor cleanup.

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

16 years agoFix typo
Nate Begeman [Mon, 7 Jan 2008 04:01:26 +0000 (04:01 +0000)]
Fix typo

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

16 years agorearrange some code.
Chris Lattner [Sun, 6 Jan 2008 22:50:31 +0000 (22:50 +0000)]
rearrange some code.

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

16 years agosome simplifications/cleanups to ?: sema.
Chris Lattner [Sun, 6 Jan 2008 22:42:25 +0000 (22:42 +0000)]
some simplifications/cleanups to ?: sema.

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

16 years agoEmit warnings like "dereferencing void pointer" instead of trying to
Chris Lattner [Sun, 6 Jan 2008 22:21:46 +0000 (22:21 +0000)]
Emit warnings like "dereferencing void pointer" instead of trying to
pretty print the type name for void.

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

16 years agotwiks based on Chris's comment. No need to iterate thru a list of declarations
Fariborz Jahanian [Sat, 5 Jan 2008 01:40:08 +0000 (01:40 +0000)]
twiks based on Chris's comment. No need to iterate thru a list of declarations
in a foreach-statement which is illegal (but not yet caught) .

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

16 years agoMoved serialization code for ObjcForCollectionStmt to be in alphabetical order
Ted Kremenek [Sat, 5 Jan 2008 00:57:49 +0000 (00:57 +0000)]
Moved serialization code for ObjcForCollectionStmt to be in alphabetical order
with the rest of the Objective-C serialization code.

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

16 years agoMinor refactoring of foreach's semantics code per Chris's suggetion.
Fariborz Jahanian [Fri, 4 Jan 2008 23:59:09 +0000 (23:59 +0000)]
Minor refactoring of foreach's semantics code per Chris's suggetion.

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

16 years agounnest vector handling again.
Chris Lattner [Fri, 4 Jan 2008 23:32:24 +0000 (23:32 +0000)]
unnest vector handling again.

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

16 years agoAdded a comment, minor refactoring of foreach parsing code per Chris's suggestion.
Fariborz Jahanian [Fri, 4 Jan 2008 23:23:46 +0000 (23:23 +0000)]
Added a comment, minor refactoring of foreach parsing code per Chris's suggestion.

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

16 years agowe already test for exact type matches early, so we don't have to do
Chris Lattner [Fri, 4 Jan 2008 23:20:56 +0000 (23:20 +0000)]
we already test for exact type matches early, so we don't have to do
it explicitly for vectors.  This allows us to unnest some code.

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

16 years agosimplify some of this code by removing the else/if chain and by
Chris Lattner [Fri, 4 Jan 2008 23:18:45 +0000 (23:18 +0000)]
simplify some of this code by removing the else/if chain and by
stripping down to canonical types early.

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

16 years agoMinor changes as suggested by Chris L.
Fariborz Jahanian [Fri, 4 Jan 2008 23:04:08 +0000 (23:04 +0000)]
Minor changes as suggested by Chris L.

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

16 years agomove objc expr sema to its own file.
Chris Lattner [Fri, 4 Jan 2008 22:32:30 +0000 (22:32 +0000)]
move objc expr sema to its own file.

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

16 years agoFix PR1897, patch by Wilhansen Li
Chris Lattner [Fri, 4 Jan 2008 19:12:28 +0000 (19:12 +0000)]
Fix PR1897, patch by Wilhansen Li

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

16 years agoadd comments for the various AssignConvertType's, and split int->pointer from pointer...
Chris Lattner [Fri, 4 Jan 2008 18:22:42 +0000 (18:22 +0000)]
add comments for the various AssignConvertType's, and split int->pointer from pointer->int.

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

16 years agoMerge all the 'assignment' diagnostic code into one routine, decloning
Chris Lattner [Fri, 4 Jan 2008 18:04:52 +0000 (18:04 +0000)]
Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places.  This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.

Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.

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

16 years agofix a build problem where NULL isn't implicitly defined by the headers this file...
Chris Lattner [Fri, 4 Jan 2008 16:27:03 +0000 (16:27 +0000)]
fix a build problem where NULL isn't implicitly defined by the headers this file includes.

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

16 years agoPatch to add semantics check for ObjC2's foreacn statement.
Fariborz Jahanian [Fri, 4 Jan 2008 00:27:46 +0000 (00:27 +0000)]
Patch to add semantics check for ObjC2's foreacn statement.

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

16 years agogeneralize some of the conversion warnings.
Chris Lattner [Thu, 3 Jan 2008 23:38:43 +0000 (23:38 +0000)]
generalize some of the conversion warnings.

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

16 years agoupdate for changes in diagnostic strings.
Chris Lattner [Thu, 3 Jan 2008 23:36:08 +0000 (23:36 +0000)]
update for changes in diagnostic strings.

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

16 years agoregroup assignment-related diagnostics, fix a mistake in one.
Chris Lattner [Thu, 3 Jan 2008 23:13:36 +0000 (23:13 +0000)]
regroup assignment-related diagnostics, fix a mistake in one.

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

16 years agogive better diagnostics for converting between function pointer and void*.
Chris Lattner [Thu, 3 Jan 2008 22:56:36 +0000 (22:56 +0000)]
give better diagnostics for converting between function pointer and void*.

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

16 years agorenamed class "GRCP" (Graph Reachabilty Constant Propagation) to
Ted Kremenek [Thu, 3 Jan 2008 22:46:25 +0000 (22:46 +0000)]
renamed class "GRCP" (Graph Reachabilty Constant Propagation) to
"GREngine" (Graph Reachability Engine).  The idea is to provide a separation
of concerns between the constant prop. details and the core analysis engine.

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

16 years agoImplemented End-Of-Path processing.
Ted Kremenek [Thu, 3 Jan 2008 22:29:38 +0000 (22:29 +0000)]
Implemented End-Of-Path processing.

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

16 years agoInitial checking of GRConstantPropagation.cpp, which implements a constant
Ted Kremenek [Thu, 3 Jan 2008 22:12:28 +0000 (22:12 +0000)]
Initial checking of GRConstantPropagation.cpp, which implements a constant
propagation analysis via graph reachability. This analysis (which is incomplete)
will be the basis for later developments on the core engine for path-sensitive
analysis analysis.

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

16 years agoFixed misuse of pointer within SimulVertex::addPredecessor()
Ted Kremenek [Thu, 3 Jan 2008 22:09:27 +0000 (22:09 +0000)]
Fixed misuse of pointer within SimulVertex::addPredecessor()

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

16 years agoSimulGraph::getVertex() now also returns a bool indicating if the returned
Ted Kremenek [Thu, 3 Jan 2008 22:08:52 +0000 (22:08 +0000)]
SimulGraph::getVertex() now also returns a bool indicating if the returned
vertex was freshly created.

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

16 years agoConstified methods front() and back() in CFGBlock.
Ted Kremenek [Thu, 3 Jan 2008 22:07:58 +0000 (22:07 +0000)]
Constified methods front() and back() in CFGBlock.

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

16 years agoDe-constified the pointers returned by the Dst() and Src() methods of
Ted Kremenek [Thu, 3 Jan 2008 22:07:01 +0000 (22:07 +0000)]
De-constified the pointers returned by the Dst() and Src() methods of
the various ProgramEdge classes.

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

16 years agoCouple more uninitialized before use warning elimination.
Fariborz Jahanian [Thu, 3 Jan 2008 20:04:58 +0000 (20:04 +0000)]
Couple more uninitialized before use warning elimination.

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

16 years agoRemove cause of misc. "variable might be used uninitialized in this function" warnings.
Fariborz Jahanian [Thu, 3 Jan 2008 20:01:35 +0000 (20:01 +0000)]
Remove cause of misc. "variable might be used uninitialized in this function" warnings.

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

16 years agoFixed a bug reported by Chris, involving assiging 0 to a qualified object type.
Fariborz Jahanian [Thu, 3 Jan 2008 18:46:52 +0000 (18:46 +0000)]
Fixed a bug reported by Chris, involving assiging 0 to a qualified object type.

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

16 years agosimplify the lexer a bit, pulling stuff out of the default case.
Chris Lattner [Thu, 3 Jan 2008 17:58:54 +0000 (17:58 +0000)]
simplify the lexer a bit, pulling stuff out of the default case.

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

16 years agoPatch to parse/build AST ObjC2's foreach statement.
Fariborz Jahanian [Thu, 3 Jan 2008 17:55:25 +0000 (17:55 +0000)]
Patch to parse/build AST ObjC2's foreach statement.

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

16 years agofix long lines.
Chris Lattner [Thu, 3 Jan 2008 07:05:49 +0000 (07:05 +0000)]
fix long lines.

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

16 years agoFix a crash reported by Seo Sanghyeon.
Chris Lattner [Thu, 3 Jan 2008 06:36:51 +0000 (06:36 +0000)]
Fix a crash reported by Seo Sanghyeon.

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

16 years agoNew declarations/defs for Objc2's foreach-statement. This is work in progress.
Fariborz Jahanian [Wed, 2 Jan 2008 22:54:34 +0000 (22:54 +0000)]
New declarations/defs for Objc2's foreach-statement. This is work in progress.

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

16 years agoWhen promoting array to pointer for argument, don't lose type qualifiers.
Chris Lattner [Wed, 2 Jan 2008 22:50:48 +0000 (22:50 +0000)]
When promoting array to pointer for argument, don't lose type qualifiers.

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