]> granicus.if.org Git - clang/log
clang
16 years agoFix PR1969. stdin has no FileEntry.
Chris Lattner [Fri, 1 Feb 2008 05:34:02 +0000 (05:34 +0000)]
Fix PR1969.  stdin has no FileEntry.

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

16 years agoImplement __builtin_huge_val.
Anders Carlsson [Fri, 1 Feb 2008 00:44:41 +0000 (00:44 +0000)]
Implement __builtin_huge_val.

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

16 years agoDon't try to compile .a files.
Anders Carlsson [Thu, 31 Jan 2008 23:48:19 +0000 (23:48 +0000)]
Don't try to compile .a files.

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

16 years agoAdded skeleton for new LValue class ConcereteIntLValue.
Ted Kremenek [Thu, 31 Jan 2008 22:17:03 +0000 (22:17 +0000)]
Added skeleton for new LValue class ConcereteIntLValue.

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

16 years agoadd some helper methods for removing and replacing text, this makes the
Chris Lattner [Thu, 31 Jan 2008 19:51:04 +0000 (19:51 +0000)]
add some helper methods for removing and replacing text, this makes the
rewriter more robust.

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

16 years agoAdd a new InsertText method that does the check to see if the insertion was valid...
Chris Lattner [Thu, 31 Jan 2008 19:42:41 +0000 (19:42 +0000)]
Add a new InsertText method that does the check to see if the insertion was valid.  This
fixes crashes where the insertion point was in a macro.  Instead of crashing, we want
to emit a warning.

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

16 years agomove a large method out of line
Chris Lattner [Thu, 31 Jan 2008 19:38:44 +0000 (19:38 +0000)]
move a large method out of line

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

16 years agoMake rewriter::inserttext return a bool to indicate if it failed.
Chris Lattner [Thu, 31 Jan 2008 19:37:57 +0000 (19:37 +0000)]
Make rewriter::inserttext return a bool to indicate if it failed.

Add a RewriteTest::ReplaceStmt method to factor the 'checking for
rewrite failed + emitting diagnostic if so' code.

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

16 years agoMoved RValue code in GRConstants.cpp to RValue.[h,cpp].
Ted Kremenek [Thu, 31 Jan 2008 19:34:24 +0000 (19:34 +0000)]
Moved RValue code in GRConstants.cpp to RValue.[h,cpp].
Moved ValueKey/ValueMap declaration to ValueState.h.

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

16 years agoFix http://llvm.org/bugs/show_bug.cgi?id=1967.
Steve Naroff [Thu, 31 Jan 2008 18:29:10 +0000 (18:29 +0000)]
Fix http://llvm.org/bugs/show_bug.cgi?id=1967.

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

16 years agoImplement review feedback. Use getAsPointerType instead of cast<PointerType>.
Lauro Ramos Venancio [Thu, 31 Jan 2008 15:19:04 +0000 (15:19 +0000)]
Implement review feedback. Use getAsPointerType instead of cast<PointerType>.

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

16 years agoFixed misspelling of "LLVM" due to some editor+Ted madness.
Ted Kremenek [Thu, 31 Jan 2008 06:49:09 +0000 (06:49 +0000)]
Fixed misspelling of "LLVM" due to some editor+Ted madness.

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

16 years agoFix PR1965: missing diagnostics for parameters that are missing
Chris Lattner [Thu, 31 Jan 2008 06:10:07 +0000 (06:10 +0000)]
Fix PR1965: missing diagnostics for parameters that are missing
type specifiers.  This required updating some (buggy) tests, and the
testcase was previously accidentally committed.

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

16 years agoFix a bogus test
Chris Lattner [Thu, 31 Jan 2008 06:06:29 +0000 (06:06 +0000)]
Fix a bogus test

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

16 years agoRemainder of the __builtin_overload feedback
Nate Begeman [Thu, 31 Jan 2008 05:38:29 +0000 (05:38 +0000)]
Remainder of the __builtin_overload feedback

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

16 years agoFix a rewriter crash when the whole body of a foreach is itself
Chris Lattner [Thu, 31 Jan 2008 05:10:40 +0000 (05:10 +0000)]
Fix a rewriter crash when the whole body of a foreach is itself
rewritten, as in Sema/rewrite-foreach-6.m.  Fariborz/Steve,
please review this to see if it is sane.

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

16 years agoFix PR1921 by promoting negative indices to intptrty.
Chris Lattner [Thu, 31 Jan 2008 04:12:50 +0000 (04:12 +0000)]
Fix PR1921 by promoting negative indices to intptrty.

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

16 years agoAdded transfer function support for unary '&' and '*', providing basic
Ted Kremenek [Thu, 31 Jan 2008 02:35:41 +0000 (02:35 +0000)]
Added transfer function support for unary '&' and '*', providing basic
(local) aliasing support.

Modified ExplodedGraph pretty-printer (for GRConstants) to also print out the
pointer value of the state associated with a node.  This way one can easily
see that two states are identical.

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

16 years agoMake CallExpr::isBuiltinConstantExpr slightly more efficient.
Anders Carlsson [Thu, 31 Jan 2008 02:13:57 +0000 (02:13 +0000)]
Make CallExpr::isBuiltinConstantExpr slightly more efficient.

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

16 years agoAdd support for CallExpr::isBuiltinConstantExpr(). For now, this hook is used to...
Steve Naroff [Thu, 31 Jan 2008 01:07:12 +0000 (01:07 +0000)]
Add support for CallExpr::isBuiltinConstantExpr(). For now, this hook is used to support CFConstantStrings. Can be extended to support other built-in functions.

This allows the following code to compile without error...

#include <CoreFoundation/CoreFoundation.h>

#define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V);

CONST_STRING_DECL(kCFTimeZoneSystemTimeZoneDidChangeNotification, "kCFTimeZoneSystemTimeZoneDidChangeNotification")

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

16 years agoAdded 'SymbolicLValue' class to represent LValues whose value is symbolic.
Ted Kremenek [Thu, 31 Jan 2008 00:09:56 +0000 (00:09 +0000)]
Added 'SymbolicLValue' class to represent LValues whose value is symbolic.
Improved pretty-printing of LValues.
Parameters whose values are pointers/references are now assigned SymbolicLValues.

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

16 years agoHack Sema::MergeTypeDefDecl() to silently ignore duplicate typedef's in system header...
Steve Naroff [Wed, 30 Jan 2008 23:46:05 +0000 (23:46 +0000)]
Hack Sema::MergeTypeDefDecl() to silently ignore duplicate typedef's in system headers files.

A bizarre, non-standard hook that many compilers appear to implement (sigh:-).

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

16 years agoWe now delay adding nodes created by GRBranchNodeBuilder to the analysis
Ted Kremenek [Wed, 30 Jan 2008 23:24:39 +0000 (23:24 +0000)]
We now delay adding nodes created by GRBranchNodeBuilder to the analysis
worklist until the dstor of GRBranchNodeBuilderImpl. This way clients can mark
creates nodes as "sinks" before they are added to the worklist.

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

16 years agoImplemented some branch pruning in GRConstants using != and == for
Ted Kremenek [Wed, 30 Jan 2008 23:03:39 +0000 (23:03 +0000)]
Implemented some branch pruning in GRConstants using != and == for
constant integers.

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

16 years agoAdded method "printTerminator" to CFGBlock so that external clients can
Ted Kremenek [Wed, 30 Jan 2008 23:02:42 +0000 (23:02 +0000)]
Added method "printTerminator" to CFGBlock so that external clients can
pretty-print a block's terminator.

When building CFGs, for IfStmts ('if'), we no longer add the ParenExpr
that is the subexpression of the IfStmt to the CFG; instead we add its
first descendant subexpression that is not a ParenExpr.

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

16 years agoFix test case and add a FIXME.
Steve Naroff [Wed, 30 Jan 2008 21:50:43 +0000 (21:50 +0000)]
Fix test case and add a FIXME.

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

16 years agogetLLVMFieldNo can't be called before emitting the base value.
Lauro Ramos Venancio [Wed, 30 Jan 2008 21:23:20 +0000 (21:23 +0000)]
getLLVMFieldNo can't be called before emitting the base value.

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

16 years agoA pointer to an opaque type is an "opaque type definition".
Lauro Ramos Venancio [Wed, 30 Jan 2008 21:21:08 +0000 (21:21 +0000)]
A pointer to an opaque type is an "opaque type definition".

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

16 years agoOn an unexpected @foo keyword, return failure instead of a 'successful' null AST...
Chris Lattner [Wed, 30 Jan 2008 21:20:25 +0000 (21:20 +0000)]
On an unexpected @foo keyword, return failure instead of a 'successful' null AST.  This fixes a segfault
on things like @foo.

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

16 years agoImplement first round of feedback on __builtin_overload
Nate Begeman [Wed, 30 Jan 2008 20:50:20 +0000 (20:50 +0000)]
Implement first round of feedback on __builtin_overload

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

16 years agoTypo.
Fariborz Jahanian [Wed, 30 Jan 2008 20:03:29 +0000 (20:03 +0000)]
Typo.

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

16 years agoAbolish a bunch of Xcode inserted tabs.
Steve Naroff [Wed, 30 Jan 2008 19:17:43 +0000 (19:17 +0000)]
Abolish a bunch of Xcode inserted tabs.

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

16 years agoMinor cosmetic cleanups: replaced some integer literals with constants and
Ted Kremenek [Wed, 30 Jan 2008 18:54:06 +0000 (18:54 +0000)]
Minor cosmetic cleanups: replaced some integer literals with constants and
more cleanups with pretty-printing of analysis results.

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

16 years agoAdd TODO marker so that it is easier to search.
Devang Patel [Wed, 30 Jan 2008 18:00:07 +0000 (18:00 +0000)]
Add TODO marker so that it is easier to search.

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

16 years agoIgnore __aligned__ with zero arguments in addition to __aligned__ with
Eli Friedman [Wed, 30 Jan 2008 17:38:42 +0000 (17:38 +0000)]
Ignore __aligned__ with zero arguments in addition to __aligned__ with
one argument.  Lets stuff using pthread.h compile.

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

16 years agoFixed misc. issues raised by Chris L. on @synchronized implementation.
Fariborz Jahanian [Wed, 30 Jan 2008 17:38:29 +0000 (17:38 +0000)]
Fixed misc. issues raised by Chris L. on @synchronized implementation.

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

16 years agoFix codegen for conditionals with incommpatible pointer types. Code
Eli Friedman [Wed, 30 Jan 2008 17:02:03 +0000 (17:02 +0000)]
Fix codegen for conditionals with incommpatible pointer types.  Code
that causes this isn't really correct, but if we're going to accept
this, it should come up with a consistent AST.

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

16 years agofix a problem reported by Eli, caused by not keeping bool as i1
Chris Lattner [Wed, 30 Jan 2008 07:01:17 +0000 (07:01 +0000)]
fix a problem reported by Eli, caused by not keeping bool as i1
when in a register.

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

16 years agomake this pass by adding an expected error, add some tests.
Chris Lattner [Wed, 30 Jan 2008 06:46:30 +0000 (06:46 +0000)]
make this pass by adding an expected error, add some tests.

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

16 years agoEli points out this can only happen for scalar elements.
Chris Lattner [Wed, 30 Jan 2008 06:08:20 +0000 (06:08 +0000)]
Eli points out this can only happen for scalar elements.

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

16 years agoBe more explicit about what flavors of initlistexpr's we can see. I don't
Chris Lattner [Wed, 30 Jan 2008 05:53:56 +0000 (05:53 +0000)]
Be more explicit about what flavors of initlistexpr's we can see.  I don't
know if all of this is exactly right, but it seems like the right thing to
aim for.  Steve, please review.

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

16 years agomove some constructors out of line and fix indentation in ObjCAtThrowStmt::getSourceR...
Chris Lattner [Wed, 30 Jan 2008 05:01:46 +0000 (05:01 +0000)]
move some constructors out of line and fix indentation in ObjCAtThrowStmt::getSourceRange.

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

16 years agoMake sure to emit all the arguments to a function call. This fixes the
Eli Friedman [Wed, 30 Jan 2008 01:32:06 +0000 (01:32 +0000)]
Make sure to emit all the arguments to a function call. This fixes the
codegen of calls to functions without a prototype and varargs functions,
including printf.

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

16 years agoMany refinements to Sema::MergeVarDecl(). This routine still needs some re-work to...
Steve Naroff [Wed, 30 Jan 2008 00:44:01 +0000 (00:44 +0000)]
Many refinements to Sema::MergeVarDecl(). This routine still needs some re-work to fully handle tentative decls.

This includes a fix to bz1908.

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

16 years agoAdded method "markInfeasible" to GRBranchNodeBuilder to disable the
Ted Kremenek [Tue, 29 Jan 2008 23:36:02 +0000 (23:36 +0000)]
Added method "markInfeasible" to GRBranchNodeBuilder to disable the
auto-propagation of state along a branch.

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

16 years agoImplemented more boilerplate in GREngine for processing branches. Now
Ted Kremenek [Tue, 29 Jan 2008 23:32:35 +0000 (23:32 +0000)]
Implemented more boilerplate in GREngine for processing branches.  Now
we automatically generate a new successor node along an edge if the checker
did not explicitly do so (i.e., we just propagate the current state).

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

16 years agoFixed bit-setting bug for ExplodedNodeImpl::NodeGroup.
Ted Kremenek [Tue, 29 Jan 2008 23:31:09 +0000 (23:31 +0000)]
Fixed bit-setting bug for ExplodedNodeImpl::NodeGroup.

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

16 years agoHandle incomplete struct initializer.
Devang Patel [Tue, 29 Jan 2008 23:23:18 +0000 (23:23 +0000)]
Handle incomplete struct initializer.

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

16 years agoRewriting of @synchronized. This has one FIXME in it. But this should allow @sychroni...
Fariborz Jahanian [Tue, 29 Jan 2008 22:59:37 +0000 (22:59 +0000)]
Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.

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

16 years agoAdded boilerplate logic in GREngine for processing branches.
Ted Kremenek [Tue, 29 Jan 2008 22:56:11 +0000 (22:56 +0000)]
Added boilerplate logic in GREngine for processing branches.

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

16 years agoRenamed GRNodeBuilder to GRStmtNodeBuilder.
Ted Kremenek [Tue, 29 Jan 2008 22:11:49 +0000 (22:11 +0000)]
Renamed GRNodeBuilder to GRStmtNodeBuilder.

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

16 years agoMinor fix in transfer function of '!=' where a 'false' literal should
Ted Kremenek [Tue, 29 Jan 2008 21:27:49 +0000 (21:27 +0000)]
Minor fix in transfer function of '!=' where a 'false' literal should
have been 'true'.

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

16 years ago- Hooked up deserialization of ObjCAtSynchronizedStmt Stmt::Create().
Ted Kremenek [Tue, 29 Jan 2008 21:21:30 +0000 (21:21 +0000)]
- Hooked up deserialization of ObjCAtSynchronizedStmt Stmt::Create().
- Some minor optimizations of the encoding format for ObjCAtSynchronizedStmt.
- Reordered methods so that the deserialization methods for
  ObjCAtSynchronizedStmt appear in alphabetical order with the corresponding
  methods of the other AST nodes.

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

16 years agoAdded preliminary transfer function support for '==' and '!='.
Ted Kremenek [Tue, 29 Jan 2008 19:43:15 +0000 (19:43 +0000)]
Added preliminary transfer function support for '==' and '!='.

Made some internal API cleanups with creating ConcreteInt values, which lead to
some code reduction in implementing "++", "--".

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

16 years agoAST for @synchronized.
Fariborz Jahanian [Tue, 29 Jan 2008 19:14:59 +0000 (19:14 +0000)]
AST for @synchronized.

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

16 years agoTighten up ASTContext::typesAreCompatible()...it needs to make sure the qualifiers...
Steve Naroff [Tue, 29 Jan 2008 18:58:14 +0000 (18:58 +0000)]
Tighten up ASTContext::typesAreCompatible()...it needs to make sure the qualifiers match. The comment and C99 citation for this routine were correct...the code needed to conform to the comment/spec. This fixes the test added below.

Tightening up this routine forced tweaks to Sema::CheckSubtractionOperands() and Sema::CheckCompareOperands(). For example, they both need to operate on the unqualified pointee...

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

16 years agoBunch of type defs, etc. for @synchronized.
Fariborz Jahanian [Tue, 29 Jan 2008 18:21:32 +0000 (18:21 +0000)]
Bunch of type defs, etc. for @synchronized.

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

16 years agoFix a bug where CodeGen would attempt to erase an instruction that was
Eli Friedman [Tue, 29 Jan 2008 18:13:51 +0000 (18:13 +0000)]
Fix a bug where CodeGen would attempt to erase an instruction that was
already used.

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

16 years agoAdded "SymbolManager", which manages the set of symbolic values used
Ted Kremenek [Tue, 29 Jan 2008 17:27:31 +0000 (17:27 +0000)]
Added "SymbolManager", which manages the set of symbolic values used
for analyzing a function.

The initial state for GRConstants now assigns symbolic values to parameters.

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

16 years agoImplement __builtin_offsetof.
Anders Carlsson [Tue, 29 Jan 2008 15:56:48 +0000 (15:56 +0000)]
Implement __builtin_offsetof.

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

16 years agofix comment typo
Chris Lattner [Tue, 29 Jan 2008 07:59:54 +0000 (07:59 +0000)]
fix comment typo

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

16 years agoadd diagnostic
Chris Lattner [Tue, 29 Jan 2008 07:59:42 +0000 (07:59 +0000)]
add diagnostic

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

16 years agoFix a bug where we would incorrectly emit a "cannot paste" error
Chris Lattner [Tue, 29 Jan 2008 07:54:23 +0000 (07:54 +0000)]
Fix a bug where we would incorrectly emit a "cannot paste" error
message when handling the GNU ", ## __VA_ARGS__" extension.  While
I'm at it, flag uses of this as extensions.

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

16 years agoUse the canonical type when comparing array types so the comparison
Eli Friedman [Tue, 29 Jan 2008 07:51:12 +0000 (07:51 +0000)]
Use the canonical type when comparing array types so the comparison
doesn't get confused by typedefs.

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

16 years agoImprovements to ccc. Patch by Shantonu Sen.
Anders Carlsson [Tue, 29 Jan 2008 07:21:34 +0000 (07:21 +0000)]
Improvements to ccc. Patch by Shantonu Sen.

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

16 years agoFixed bug where not all dead subexpressions were being pruned from the analysis
Ted Kremenek [Tue, 29 Jan 2008 05:25:31 +0000 (05:25 +0000)]
Fixed bug where not all dead subexpressions were being pruned from the analysis
state.

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

16 years agoModified LiveVariables to perform all of its base initialization in the ctor,
Ted Kremenek [Tue, 29 Jan 2008 05:13:23 +0000 (05:13 +0000)]
Modified LiveVariables to perform all of its base initialization in the ctor,
and now we require a FunctionDecl* object so that we can also keep track of
all of the ParmDecls.

Modified clients of LiveVariables to conform to the new interface.

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

16 years agoTweak Sema::DefaultArgumentPromotion() to call UsualUnaryConversions(). This makes...
Steve Naroff [Tue, 29 Jan 2008 02:42:22 +0000 (02:42 +0000)]
Tweak Sema::DefaultArgumentPromotion() to call UsualUnaryConversions(). This makes sure function calls that don't have a prototype get the default function/array conversion.

Patch by Eli Friedman!

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

16 years agoHandle binary or in constant expressions.
Anders Carlsson [Tue, 29 Jan 2008 01:33:32 +0000 (01:33 +0000)]
Handle binary or in constant expressions.

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

16 years agoCorrectly handle constants that refer to enums.
Anders Carlsson [Tue, 29 Jan 2008 01:28:48 +0000 (01:28 +0000)]
Correctly handle constants that refer to enums.

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

16 years agoCorrectly handle scalars in braces.
Anders Carlsson [Tue, 29 Jan 2008 01:15:48 +0000 (01:15 +0000)]
Correctly handle scalars in braces.

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

16 years agoAdded skeleton code for tracking the values of function parameters.
Ted Kremenek [Tue, 29 Jan 2008 00:43:03 +0000 (00:43 +0000)]
Added skeleton code for tracking the values of function parameters.

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

16 years agoDriver now passes the top-level FunctionDecl* to GRConstants.
Ted Kremenek [Tue, 29 Jan 2008 00:33:40 +0000 (00:33 +0000)]
Driver now passes the top-level FunctionDecl* to GRConstants.

Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext,
and the top-level FunctionDecl into ExplodedGraphImpl.

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

16 years agoFix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualif...
Steve Naroff [Tue, 29 Jan 2008 00:15:50 +0000 (00:15 +0000)]
Fix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualified parameter types (per C99 6.7.5.3p15).

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

16 years agoAdded RValue class "UninitializedValue".
Ted Kremenek [Mon, 28 Jan 2008 22:51:57 +0000 (22:51 +0000)]
Added RValue class "UninitializedValue".

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

16 years agoAdded transfer function logic for "%=" operator.
Ted Kremenek [Mon, 28 Jan 2008 22:28:54 +0000 (22:28 +0000)]
Added transfer function logic for "%=" operator.

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

16 years agoAdded transfer function hookups for "modulo" operator.
Ted Kremenek [Mon, 28 Jan 2008 22:26:15 +0000 (22:26 +0000)]
Added transfer function hookups for "modulo" operator.

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

16 years agoMinor tweaking with hierarchy of NonLValue objects: SymbolValue is
Ted Kremenek [Mon, 28 Jan 2008 22:25:21 +0000 (22:25 +0000)]
Minor tweaking with hierarchy of NonLValue objects: SymbolValue is
now SymbolicNonLValue.

Cleaned up some casts.

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

16 years agoSome additional cleanups with method names.
Ted Kremenek [Mon, 28 Jan 2008 22:09:13 +0000 (22:09 +0000)]
Some additional cleanups with method names.

Renamed ExprValue to RValue, as all expression values are RValues, and this
keeps with the C terminology (renamed old "RValue" class to "NonLValue").

Introduced "ConcreteInt", a class that represents a concrete, integer
constant as an RValue.

Temporarily removed classes to represent set of possible constants and set of !=
constants. Will replace with a more general class representing a set of
constraints.

Added some foundational code to track "symbolic" values, which are used to
accrue constraints on an abstract value that is shared between multiple
variables.  e.g:

   x = y;      // at this point "x" and "y" share the same "value"
   if (x > 1)
     ...       // at this point, the value shared by "x" and "y" is "> 1".

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

16 years agoImplement "private extern" on function decls!
Steve Naroff [Mon, 28 Jan 2008 21:57:15 +0000 (21:57 +0000)]
Implement "private extern" on function decls!

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

16 years agoAdd -Wno-rewrite-macros to silence the following warning when using -rewrite-test:
Steve Naroff [Mon, 28 Jan 2008 21:34:52 +0000 (21:34 +0000)]
Add -Wno-rewrite-macros to silence the following warning when using -rewrite-test:

xx.m:10:3: warning: rewriting sub-expression within a macro (may not be correct)

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

16 years agoFix a bug with struct initializers (in Sema::CheckInitializerListTypes()).
Steve Naroff [Mon, 28 Jan 2008 02:00:41 +0000 (02:00 +0000)]
Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()).
Test case included from bz1948 (thanks Neil!).
Also fixed an 80 column violation...

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

16 years agoMake -o work with -E, patch contributed by Shantonu Sen!
Chris Lattner [Sun, 27 Jan 2008 23:55:11 +0000 (23:55 +0000)]
Make -o work with -E, patch contributed by Shantonu Sen!

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

16 years agoTweaks to EmitLValue in CGExprConstant. Patch by Eli Friedman.
Anders Carlsson [Sat, 26 Jan 2008 04:30:23 +0000 (04:30 +0000)]
Tweaks to EmitLValue in CGExprConstant. Patch by Eli Friedman.

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

16 years agoAdd CodeGen for AddrOf in constant initializers. Original patch by Eli Friedman.
Anders Carlsson [Sat, 26 Jan 2008 02:08:50 +0000 (02:08 +0000)]
Add CodeGen for AddrOf in constant initializers. Original patch by Eli Friedman.

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

16 years agoFactor out the constant generation into its own file.
Anders Carlsson [Sat, 26 Jan 2008 01:36:00 +0000 (01:36 +0000)]
Factor out the constant generation into its own file.

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

16 years agoAdded back logic in patch r46361 (http://llvm.org/viewvc/llvm-project?rev=46361&view...
Ted Kremenek [Sat, 26 Jan 2008 00:03:27 +0000 (00:03 +0000)]
Added back logic in patch r46361 (http://llvm.org/viewvc/llvm-project?rev=46361&view=rev) with the addition of
some previously missing NULL pointer checks.

Modified the UninitializedValues analysis to not expect that every Expr* at the
block-level is a block-level expression (we probably need to change the name of
such expressions to something truer to their meaning).

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

16 years agoImplemented transfer function for '/='.
Ted Kremenek [Fri, 25 Jan 2008 23:45:34 +0000 (23:45 +0000)]
Implemented transfer function for '/='.

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

16 years agoFurther refactoring of transfer functions by having APSIntSetOp take
Ted Kremenek [Fri, 25 Jan 2008 23:43:12 +0000 (23:43 +0000)]
Further refactoring of transfer functions by having APSIntSetOp take
a template-template parameter.

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

16 years agoReverting r46361 (http://llvm.org/viewvc/llvm-project?rev=46361&view=rev) until
Ted Kremenek [Fri, 25 Jan 2008 23:22:27 +0000 (23:22 +0000)]
Reverting r46361 (http://llvm.org/viewvc/llvm-project?rev=46361&view=rev) until
I diagnose the source of the failures it causes in the test suite.

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

16 years agoRenamed RValueDisjunctiveEqual to RValEqualityORSet.
Ted Kremenek [Fri, 25 Jan 2008 22:55:56 +0000 (22:55 +0000)]
Renamed RValueDisjunctiveEqual to RValEqualityORSet.
Renamed RValueConjunctiveUnequal to RValInequalityANDSet.

Refactored add/subtract/multiple (and now divide) operations for
RValEqualityORSet to be based on a single template function.

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

16 years agoAdd more support for Apple's "private extern" extension...
Steve Naroff [Fri, 25 Jan 2008 22:14:40 +0000 (22:14 +0000)]
Add more support for Apple's "private extern" extension...

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

16 years agoFixed 80 col. violation.
Ted Kremenek [Fri, 25 Jan 2008 22:07:26 +0000 (22:07 +0000)]
Fixed 80 col. violation.

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

16 years agoRenamed RValueMayEqualSet to RValueDisjunctiveEqual.
Ted Kremenek [Fri, 25 Jan 2008 22:06:07 +0000 (22:06 +0000)]
Renamed RValueMayEqualSet to RValueDisjunctiveEqual.

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

16 years agoAdd support for dispatching an objc message to a variable
Chris Lattner [Fri, 25 Jan 2008 19:43:26 +0000 (19:43 +0000)]
Add support for dispatching an objc message to a variable
in an initializer list.

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

16 years agoFirst half of a fix for the "objc message send in initializer" bug. This only
Chris Lattner [Fri, 25 Jan 2008 19:37:24 +0000 (19:37 +0000)]
First half of a fix for the "objc message send in initializer" bug.  This only
handles message sends with typenames to start with.

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

16 years agoFactor a complex predicate out to a helper method.
Chris Lattner [Fri, 25 Jan 2008 19:25:00 +0000 (19:25 +0000)]
Factor a complex predicate out to a helper method.

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

16 years agofix isIntegerConstantExpr evaluation of unary !.
Chris Lattner [Fri, 25 Jan 2008 19:16:19 +0000 (19:16 +0000)]
fix isIntegerConstantExpr evaluation of unary !.

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

16 years agosplit the second half of ParseObjCMessageExpression into a new
Chris Lattner [Fri, 25 Jan 2008 18:59:06 +0000 (18:59 +0000)]
split the second half of ParseObjCMessageExpression into a new
ParseObjCMessageExpressionBody method.

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

16 years agoremove an implemented todo
Chris Lattner [Fri, 25 Jan 2008 18:58:06 +0000 (18:58 +0000)]
remove an implemented todo

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