]> granicus.if.org Git - clang/log
clang
16 years agothe macro start and macro end bits in source location are dead, remove them.
Chris Lattner [Sun, 3 Feb 2008 08:24:13 +0000 (08:24 +0000)]
the macro start and macro end bits in source location are dead, remove them.

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

16 years agoMake ccc work with older Python versions. Patch by Sam Bishop.
Seo Sanghyeon [Sun, 3 Feb 2008 03:40:41 +0000 (03:40 +0000)]
Make ccc work with older Python versions. Patch by Sam Bishop.

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

16 years agoImplement support for __extension__ which silences extwarnings in its
Chris Lattner [Sat, 2 Feb 2008 20:20:10 +0000 (20:20 +0000)]
Implement support for __extension__ which silences extwarnings in its
scope.  This is part of the fix for PR1966

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

16 years agominor tweak to anders patch: (only) ocu vectors support splatting, but
Chris Lattner [Sat, 2 Feb 2008 04:51:41 +0000 (04:51 +0000)]
minor tweak to anders patch: (only) ocu vectors support splatting, but
ocu vectors should not treat bitcasts from int <-> vector as a splat
unless it is of the element type.

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

16 years agoAdd RUN line.
Anders Carlsson [Sat, 2 Feb 2008 04:49:12 +0000 (04:49 +0000)]
Add RUN line.

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

16 years agotestcase for previous patch.
Chris Lattner [Sat, 2 Feb 2008 04:45:42 +0000 (04:45 +0000)]
testcase for previous patch.

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

16 years agofix codegen on static variables which have multiple decl nodes. These
Chris Lattner [Sat, 2 Feb 2008 04:43:11 +0000 (04:43 +0000)]
fix codegen on static variables which have multiple decl nodes.  These
should be merged just like normal globals.  This fixes this testcase
that Anders provided:

static struct s a;
static struct s *ap1 = &a;
static struct s a =  { 10 };

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

16 years agoCleanup previous patch (based on feedback from Ted).
Steve Naroff [Sat, 2 Feb 2008 00:10:46 +0000 (00:10 +0000)]
Cleanup previous patch (based on feedback from Ted).

Since this behavior is useful for most classes, we might consider adding a simple 3 method class that implements the behavior. Ted said that Boost has such a class.

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

16 years agoMake sure SourceManager/HeaderSearch don't support default copy constructors (since...
Steve Naroff [Fri, 1 Feb 2008 23:31:13 +0000 (23:31 +0000)]
Make sure SourceManager/HeaderSearch don't support default copy constructors (since they result in bad runtime behavior).

I'm sure there are other classes that might need this "guard", however I was bitten by these 2 recently (so I thought I'd fix them).

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

16 years agoAdd trailing newline.
Anders Carlsson [Fri, 1 Feb 2008 23:27:51 +0000 (23:27 +0000)]
Add trailing newline.

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

16 years agoOnly OCU vectors can be splatted.
Anders Carlsson [Fri, 1 Feb 2008 23:17:55 +0000 (23:17 +0000)]
Only OCU vectors can be splatted.

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

16 years agoRename diagnostic to reflect it's role...
Steve Naroff [Fri, 1 Feb 2008 22:44:48 +0000 (22:44 +0000)]
Rename diagnostic to reflect it's role...

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

16 years agoMinor API cleanup...
Steve Naroff [Fri, 1 Feb 2008 22:08:12 +0000 (22:08 +0000)]
Minor API cleanup...

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

16 years agoRemove temporary workaround (thanks to Ted for fixing ObjCAtCatchStmt so quickly:-).
Steve Naroff [Fri, 1 Feb 2008 21:51:39 +0000 (21:51 +0000)]
Remove temporary workaround (thanks to Ted for fixing ObjCAtCatchStmt so quickly:-).

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

16 years agoFor ObjCAtCatchStmt, removed field 'NextAtCatchStmt' (which referenced the next ...
Ted Kremenek [Fri, 1 Feb 2008 21:28:59 +0000 (21:28 +0000)]
For ObjCAtCatchStmt, removed field 'NextAtCatchStmt' (which referenced the next @catch)
and put the the next ObjcAtCatchStmt* as part of SubExprs.  This fixes a bug with
iterating over the children of ObjcAtCatch, where the next @catch was not
properly being iterated over as a child.

Altered serialization of ObjCAtCatchStmt to reflect this new layout of
its subexpressions, and fixed an ownership issue with the next @catch not
being serialized as an owned pointer.

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

16 years agoFix two rewriter bugs with @catch.
Steve Naroff [Fri, 1 Feb 2008 20:02:07 +0000 (20:02 +0000)]
Fix two rewriter bugs with @catch.

- Support @catch(...), rather than crash:-)
- Make sure all catch bodies get rewritten. This "fix" is really a workaround until the iterator for the "try" AST is fixed. Will fix this in a separate commit.

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

16 years agoMoved "Rewriter" tests from test/Sema to test/Rewriter.
Ted Kremenek [Fri, 1 Feb 2008 17:05:54 +0000 (17:05 +0000)]
Moved "Rewriter" tests from test/Sema to test/Rewriter.

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

16 years agoGenerate correct code for __builtin_huge_val
Anders Carlsson [Fri, 1 Feb 2008 16:06:34 +0000 (16:06 +0000)]
Generate correct code for __builtin_huge_val

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

16 years agogetPrimaryDecl can return null.
Anders Carlsson [Fri, 1 Feb 2008 16:01:31 +0000 (16:01 +0000)]
getPrimaryDecl can return null.

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

16 years agoIt is allowed to get the address of an array subscript, even if the array has the...
Anders Carlsson [Fri, 1 Feb 2008 07:15:58 +0000 (07:15 +0000)]
It is allowed to get the address of an array subscript, even if the array has the register qualifier, if the array is really a pointer.

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

16 years agomake some diagnostics more terse, update testcases.
Chris Lattner [Fri, 1 Feb 2008 06:57:39 +0000 (06:57 +0000)]
make some diagnostics more terse, update testcases.

Fix Sema::ActOnInstanceMessage to correctly do things in terms of canonical
types, fixing bogus errors like:

NSDistantObject.m:10383:120: error: bad receiver type 'typeof((id<NSMutableCopying>)self)'
    id mess = ({ id __inv__ = ((void *)0); id __mb__ = _NSMessageBuilder((id <NSMutableCopying>)self, &__inv__); (void)[(__typeof__((id <NSMutableCopying>)self))__mb__ mutableCopyWithZone:((void *)0)]; if (!objc_collecting_enabled()) object_dispose(__mb__); __inv__; });

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

16 years agoSema::ActOnInstanceMessage is generally doing bad things with typedefs, but
Chris Lattner [Fri, 1 Feb 2008 06:43:02 +0000 (06:43 +0000)]
Sema::ActOnInstanceMessage is generally doing bad things with typedefs, but
here I fix just one.  The loop that rips through pointers should use
getAsPointerType() not static_cast<PointerType*> to get the pointee.  This
fixes a crash on a large testcase.

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

16 years agoAdded back 'CodeGen' to test suite (accidentally removed in my last patch).
Ted Kremenek [Fri, 1 Feb 2008 06:37:46 +0000 (06:37 +0000)]
Added back 'CodeGen' to test suite (accidentally removed in my last patch).

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

16 years agoImplemented casts for ConcreteInt and ConcreteIntLValue.
Ted Kremenek [Fri, 1 Feb 2008 06:36:40 +0000 (06:36 +0000)]
Implemented casts for ConcreteInt and ConcreteIntLValue.
Implemented '==' and '!=' for ConcreteIntLValue.

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

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