]> granicus.if.org Git - clang/log
clang
16 years agoShortened driver option for running the GR-constants analysis to --grconstants.
Ted Kremenek [Wed, 16 Jan 2008 18:21:49 +0000 (18:21 +0000)]
Shortened driver option for running the GR-constants analysis to --grconstants.

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

16 years agoAdd missing header file for GRConstants analysis.
Ted Kremenek [Wed, 16 Jan 2008 18:19:20 +0000 (18:19 +0000)]
Add missing header file for GRConstants analysis.

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

16 years agoHooked up the GRConstants analysis to the driver.
Ted Kremenek [Wed, 16 Jan 2008 18:18:48 +0000 (18:18 +0000)]
Hooked up the GRConstants analysis to the driver.
Fixed some compilation errors with GREngine that showed up during
template instantiation.

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

16 years agoMore cleanups in DoStmt. The NodeSets are now vectors instead of sets, since
Ted Kremenek [Wed, 16 Jan 2008 17:56:25 +0000 (17:56 +0000)]
More cleanups in DoStmt. The NodeSets are now vectors instead of sets, since
node caching in GREngine will guarantee that we do not insert a node twice into
a nodeset.

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

16 years agoSema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function declaratio...
Steve Naroff [Wed, 16 Jan 2008 15:01:34 +0000 (15:01 +0000)]
Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function declarations/definitions). Patch by Carl Lewis!

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

16 years agoAdjusted DSPtr::Profile method again, since my last patch broke the build.
Ted Kremenek [Wed, 16 Jan 2008 05:51:13 +0000 (05:51 +0000)]
Adjusted DSPtr::Profile method again, since my last patch broke the build.

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

16 years agoChanged 'Profile' method for DSPtr to incorporate the flags from the
Ted Kremenek [Wed, 16 Jan 2008 05:49:09 +0000 (05:49 +0000)]
Changed 'Profile' method for DSPtr to incorporate the flags from the
variant type, and not just the pointer value.

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

16 years agoRenamed some internal classes for the GR-Constant Propagation analysis.
Ted Kremenek [Wed, 16 Jan 2008 00:53:15 +0000 (00:53 +0000)]
Renamed some internal classes for the GR-Constant Propagation analysis.
Cleaned up GRConstants::AddBinding to not directly reference the
predecessor node.  Now we just manipulate the current state, and a driver
function creates nodes as needed.

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

16 years agoTypo.
Fariborz Jahanian [Wed, 16 Jan 2008 00:09:11 +0000 (00:09 +0000)]
Typo.

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

16 years agoAdded support for rewriting of continue/break statements inside ObjC2's foreach-stmt.
Fariborz Jahanian [Tue, 15 Jan 2008 23:58:23 +0000 (23:58 +0000)]
Added support for rewriting of continue/break statements inside ObjC2's foreach-stmt.

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

16 years agoAdded skeleton implementation of new constant-prop. analysis using
Ted Kremenek [Tue, 15 Jan 2008 23:55:06 +0000 (23:55 +0000)]
Added skeleton implementation of new constant-prop. analysis using
the graph reachability engine.

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

16 years agoAdded ctor to GRNodeBuilder.
Ted Kremenek [Tue, 15 Jan 2008 23:54:22 +0000 (23:54 +0000)]
Added ctor to GRNodeBuilder.

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

16 years agoFinish up handling all permutations of "complex int" (in Sema::UsualArithmeticConvers...
Steve Naroff [Tue, 15 Jan 2008 22:21:49 +0000 (22:21 +0000)]
Finish up handling all permutations of "complex int" (in Sema::UsualArithmeticConversions()).
A FIXME remains to verify the conversion rules are consistent with GCC.

Thanks to Eli for the new/improved test case...

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

16 years ago- Change Type::isComplexType() to exlude GCC's complex integer extension. In general...
Steve Naroff [Tue, 15 Jan 2008 19:36:10 +0000 (19:36 +0000)]
- Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().

This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).

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

16 years agoavoid pasting L + "foo" into L"foo".
Chris Lattner [Tue, 15 Jan 2008 05:22:14 +0000 (05:22 +0000)]
avoid pasting L + "foo" into L"foo".

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

16 years agoavoid token pasting between identifiers and wide strings:
Chris Lattner [Tue, 15 Jan 2008 05:14:19 +0000 (05:14 +0000)]
avoid token pasting between identifiers and wide strings:
   abc+L"foo" -> abc L"foo", not abcL"foo"

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

16 years agoAdd a comment...
Steve Naroff [Tue, 15 Jan 2008 02:05:07 +0000 (02:05 +0000)]
Add a comment...

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

16 years agoRework commit r45976, which was incorrect.
Steve Naroff [Tue, 15 Jan 2008 01:41:59 +0000 (01:41 +0000)]
Rework commit r45976, which was incorrect.

- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.

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

16 years agoRemoved implicit transitions to a "BlockExit" location; we now handle
Ted Kremenek [Tue, 15 Jan 2008 00:24:08 +0000 (00:24 +0000)]
Removed implicit transitions to a "BlockExit" location; we now handle
the end of the block by processing empty blocks (at BlockEntrance) or
when we have just processed the last statement in a block (at PostStmt).

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

16 years agoRemoved mutation of CFGBlock through operator[]. For now the underlying ASTs,
Ted Kremenek [Tue, 15 Jan 2008 00:18:01 +0000 (00:18 +0000)]
Removed mutation of CFGBlock through operator[]. For now the underlying ASTs,
however, can still be manipulated through the returned Stmt*.

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

16 years agoMake sure Sema::GetTypeForDeclarator() deals with abstract declarators when diagnosin...
Steve Naroff [Mon, 14 Jan 2008 23:33:18 +0000 (23:33 +0000)]
Make sure Sema::GetTypeForDeclarator() deals with abstract declarators when diagnosing incorrect code.

Bug submitted by Eli.

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

16 years agoAdded prototype implementation of path-sens. analysis core engine.
Ted Kremenek [Mon, 14 Jan 2008 23:24:37 +0000 (23:24 +0000)]
Added prototype implementation of path-sens. analysis core engine.

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

16 years agoAdded operator[] for CFGBlock. This provides random access to the statements
Ted Kremenek [Mon, 14 Jan 2008 23:18:55 +0000 (23:18 +0000)]
Added operator[] for CFGBlock.  This provides random access to the statements
of a block.

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

16 years agoFix build issue on cygwin, patch by Sam Bishop
Chris Lattner [Mon, 14 Jan 2008 21:47:29 +0000 (21:47 +0000)]
Fix build issue on cygwin, patch by Sam Bishop

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

16 years agoTeach Type::isIntegerType() about GCC's __complex__ integer extensions...
Steve Naroff [Mon, 14 Jan 2008 21:38:57 +0000 (21:38 +0000)]
Teach Type::isIntegerType() about GCC's __complex__ integer extensions...

Bug submitted by Eli.

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

16 years agoFix crasher when redefining functions. Not 100% pleased with this solution, but it...
Steve Naroff [Mon, 14 Jan 2008 20:51:29 +0000 (20:51 +0000)]
Fix crasher when redefining functions. Not 100% pleased with this solution, but it is clearly an improvement. Will discuss with Chris later.

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

16 years agoCleaned up comment.
Ted Kremenek [Mon, 14 Jan 2008 18:42:38 +0000 (18:42 +0000)]
Cleaned up comment.

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

16 years agoCleaned up comment.
Ted Kremenek [Mon, 14 Jan 2008 18:41:42 +0000 (18:41 +0000)]
Cleaned up comment.

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

16 years agoWhen serializing CompoundLiteralExpr, serialize out the file scope flag before
Ted Kremenek [Mon, 14 Jan 2008 18:29:39 +0000 (18:29 +0000)]
When serializing CompoundLiteralExpr, serialize out the file scope flag before
serializing the subexpression (Init), as this results in a more efficient
encoding in the bitstream.

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

16 years agoRecord if a compound literal expression is @ file scope. This allows us to implement...
Steve Naroff [Mon, 14 Jan 2008 18:19:28 +0000 (18:19 +0000)]
Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.

Bug/patch by Eli Friedman!

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

16 years agoRemoved 'inline' keywords from methods now defined in ExplodedGraph.cpp.
Ted Kremenek [Mon, 14 Jan 2008 18:11:35 +0000 (18:11 +0000)]
Removed 'inline' keywords from methods now defined in ExplodedGraph.cpp.

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

16 years agoChange uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove
Ted Kremenek [Mon, 14 Jan 2008 16:44:48 +0000 (16:44 +0000)]
Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove
#include<iostream>.

Patch provided by Sam Bishop.

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

16 years agoRevert r45951, Chris says it violates the C99 spec.
Steve Naroff [Mon, 14 Jan 2008 16:10:57 +0000 (16:10 +0000)]
Revert r45951, Chris says it violates the C99 spec.

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

16 years ago_asm is another valid alias for asm.
Anders Carlsson [Mon, 14 Jan 2008 07:46:40 +0000 (07:46 +0000)]
_asm is another valid alias for asm.

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

16 years agoAdd codegen upport for implicit casts to aggregate exprs.
Anders Carlsson [Mon, 14 Jan 2008 06:28:57 +0000 (06:28 +0000)]
Add codegen upport for implicit casts to aggregate exprs.

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

16 years agoadd a note
Chris Lattner [Mon, 14 Jan 2008 06:27:57 +0000 (06:27 +0000)]
add a note

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

16 years agoFix ASTContext::typesAreCompatible when analyzing a function type with
Chris Lattner [Mon, 14 Jan 2008 05:45:46 +0000 (05:45 +0000)]
Fix ASTContext::typesAreCompatible when analyzing a function type with
proto and function type without proto.  It would never call
'functionTypesAreCompatible' because they have different type classes.

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

16 years agoRewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.
Steve Naroff [Mon, 14 Jan 2008 02:53:34 +0000 (02:53 +0000)]
Rewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.

Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0"

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

16 years agoChange Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Steve Naroff [Sun, 13 Jan 2008 17:10:08 +0000 (17:10 +0000)]
Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).

void
foo (void)
{
 struct b;
 struct b* x = 0;
 struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}

With this patch, the above is now allowed.

Bug/Patch by Eli Friedman!

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

16 years agoMoved destructor logic of templated class ExplodedGraph to non-templated
Ted Kremenek [Sun, 13 Jan 2008 05:33:04 +0000 (05:33 +0000)]
Moved destructor logic of templated class ExplodedGraph to non-templated
parent class ExplodedGraphImpl.

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

16 years agoAdded node cleanup to dstor of ExplodedGraph.
Ted Kremenek [Sun, 13 Jan 2008 05:03:01 +0000 (05:03 +0000)]
Added node cleanup to dstor of ExplodedGraph.

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

16 years agoCreated ExplodedGraph.cpp and moved most method implementations of
Ted Kremenek [Sun, 13 Jan 2008 04:56:13 +0000 (04:56 +0000)]
Created ExplodedGraph.cpp and moved most method implementations of
ExplodedNodeImpl::NodeGroup from being defined inline to being defined
"out-of-line" in ExplodedGraph.cpp. This removes a dependence on including
<vector> in ExplodedGraph.h, and will hopefully result in smaller generated code
with negligible performance impact.

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

16 years agoMoved 'ExplodedNodeGroup' into class 'ExplodedNode' as the nested class
Ted Kremenek [Sun, 13 Jan 2008 04:20:10 +0000 (04:20 +0000)]
Moved 'ExplodedNodeGroup' into class 'ExplodedNode' as the nested class
'NodeGroup.'

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

16 years agoFixed lines preventing compilation.
Ted Kremenek [Sun, 13 Jan 2008 04:18:40 +0000 (04:18 +0000)]
Fixed lines preventing compilation.

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

16 years agoNow include "CFG.h" because the inline methods of "BlockEntrance" accessor
Ted Kremenek [Sun, 13 Jan 2008 04:08:45 +0000 (04:08 +0000)]
Now include "CFG.h" because the inline methods of "BlockEntrance" accessor
the methods of CFGBlock.

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

16 years agoFixed some comments.
Ted Kremenek [Sun, 13 Jan 2008 04:03:38 +0000 (04:03 +0000)]
Fixed some comments.

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

16 years agoRemoved ExplodedNode.h, since its contents are now in ExplodedGraph.h
Ted Kremenek [Sun, 13 Jan 2008 04:00:44 +0000 (04:00 +0000)]
Removed ExplodedNode.h, since its contents are now in ExplodedGraph.h

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

16 years agoMerged ExplodedNode.h into ExplodedGraph.h, since the ExplodedNode class will
Ted Kremenek [Sun, 13 Jan 2008 04:00:16 +0000 (04:00 +0000)]
Merged ExplodedNode.h into ExplodedGraph.h, since the ExplodedNode class will
only be used in the context of the ExplodedGraph class.

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

16 years agoChanged implementation of successor and predecessor sets for ExplodedNode
Ted Kremenek [Sun, 13 Jan 2008 03:55:50 +0000 (03:55 +0000)]
Changed implementation of successor and predecessor sets for ExplodedNode
to optimize for the common case of having a single predecessor and a single
successor.

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

16 years agoallow __func__ in objc methods.
Chris Lattner [Sat, 12 Jan 2008 19:32:28 +0000 (19:32 +0000)]
allow __func__ in objc methods.

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

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