]> granicus.if.org Git - clang/log
clang
16 years agopull .ll and .bc writing out of the ASTConsumer destructors into some top
Chris Lattner [Wed, 6 Feb 2008 01:42:25 +0000 (01:42 +0000)]
pull .ll and .bc writing out of the ASTConsumer destructors into some top
level code in clang.  This is a cleanup, but does implement "-o" for
-emit-llvm.  One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout.  Use "clang foo.c -emit-llvm -o -" or
"clang < foo.c -emit-llvm" to get the old behavior.

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

16 years agoAdded some skeleton code for performing "assume" on symbols: e.g. assume($0 != 0).
Ted Kremenek [Wed, 6 Feb 2008 00:54:14 +0000 (00:54 +0000)]
Added some skeleton code for performing "assume" on symbols: e.g. assume($0 != 0).
This action will add constraints to the possible values of a symbol.
Still needs to be debugged.

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

16 years agoinform astconsumer about tagdecls as they are defined.
Chris Lattner [Wed, 6 Feb 2008 00:51:33 +0000 (00:51 +0000)]
inform astconsumer about tagdecls as they are defined.

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

16 years agopass the astconsumer into Sema's ctor, clean up some stuff in
Chris Lattner [Wed, 6 Feb 2008 00:46:58 +0000 (00:46 +0000)]
pass the astconsumer into Sema's ctor, clean up some stuff in
Sema::ActOnTranslationUnitScope.  The various ObjC pieces at the top
of Sema.cpp should be moved into SemaObjC or something.

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

16 years agorename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp}
Chris Lattner [Wed, 6 Feb 2008 00:23:21 +0000 (00:23 +0000)]
rename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp}

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

16 years agokill the ASTStreamer class, inlining it into its only client: clang::ParseAST
Chris Lattner [Wed, 6 Feb 2008 00:15:02 +0000 (00:15 +0000)]
kill the ASTStreamer class, inlining it into its only client: clang::ParseAST

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

16 years agoEven more inline asm codegen fixes.
Anders Carlsson [Wed, 6 Feb 2008 00:11:32 +0000 (00:11 +0000)]
Even more inline asm codegen fixes.

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

16 years agosimple implementation of __builtin_alloca
Nate Begeman [Wed, 6 Feb 2008 00:02:50 +0000 (00:02 +0000)]
simple implementation of __builtin_alloca

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

16 years agoAdd a FIXME to clarify previous commit/experiment.
Steve Naroff [Tue, 5 Feb 2008 23:59:27 +0000 (23:59 +0000)]
Add a FIXME to clarify previous commit/experiment.

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

16 years agoHandle the memory clobber.
Anders Carlsson [Tue, 5 Feb 2008 23:30:20 +0000 (23:30 +0000)]
Handle the memory clobber.

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

16 years agoImprovements to inline asm code generation.
Anders Carlsson [Tue, 5 Feb 2008 23:18:57 +0000 (23:18 +0000)]
Improvements to inline asm code generation.

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

16 years agoAdded pretty-printing support for lval::SymIntConstraintVal and
Ted Kremenek [Tue, 5 Feb 2008 23:08:41 +0000 (23:08 +0000)]
Added pretty-printing support for lval::SymIntConstraintVal and
nonlval::SymIntConstraintVal.

Reworked transfer function for '==' and '!=' for LValues to return
SymIntConstraintVal when comparing a symbol with a constant.

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

16 years agoHandle simple asm statements correctly.
Anders Carlsson [Tue, 5 Feb 2008 23:03:50 +0000 (23:03 +0000)]
Handle simple asm statements correctly.

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

16 years agosimplify some code.
Chris Lattner [Tue, 5 Feb 2008 22:40:55 +0000 (22:40 +0000)]
simplify some code.

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

16 years agoMoved implementation of cast<> for SymbolData closer to SymbolData's definition.
Ted Kremenek [Tue, 5 Feb 2008 22:21:54 +0000 (22:21 +0000)]
Moved implementation of cast<> for SymbolData closer to SymbolData's definition.

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

16 years agoAdded new "NonLValue" class: SymIntConstraintVal. This class represents a binary
Ted Kremenek [Tue, 5 Feb 2008 22:10:48 +0000 (22:10 +0000)]
Added new "NonLValue" class: SymIntConstraintVal. This class represents a binary
contraint between a symbol and an integer constant.

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

16 years agoMoved subclasses of LValue and NonLValue into their own namespaces.
Ted Kremenek [Tue, 5 Feb 2008 21:52:21 +0000 (21:52 +0000)]
Moved subclasses of LValue and NonLValue into their own namespaces.
This noticeably cleans up the naming of these classes.

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

16 years agoAdded "SymIntConstraint", a utility class to represent intermediate values for
Ted Kremenek [Tue, 5 Feb 2008 21:32:43 +0000 (21:32 +0000)]
Added "SymIntConstraint", a utility class to represent intermediate values for
transfer function evaluation that represent constraints between symbolic values
and constant integers.

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

16 years agoFix Parser::ParseObjCTryStmt() to allow for trailing @-keyword statements/expressions.
Steve Naroff [Tue, 5 Feb 2008 21:27:35 +0000 (21:27 +0000)]
Fix Parser::ParseObjCTryStmt() to allow for trailing @-keyword statements/expressions.

This bug fix is the result of not having 2-token lookahead to recognize specific @-keywords.

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

16 years agoAdd some binops.
Anders Carlsson [Tue, 5 Feb 2008 20:54:21 +0000 (20:54 +0000)]
Add some binops.

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

16 years agoMore improvements to inline asm CG.
Anders Carlsson [Tue, 5 Feb 2008 20:01:53 +0000 (20:01 +0000)]
More improvements to inline asm CG.

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

16 years agoAdded "batch" processing versions of Nodify and SetValue. Created typedefs
Ted Kremenek [Tue, 5 Feb 2008 19:35:18 +0000 (19:35 +0000)]
Added "batch" processing versions of Nodify and SetValue.  Created typedefs
for buffers for RValues and States.

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

16 years agoAdded a "ConstantNotEq" map to ValueState (and added necessary typedefs and factory...
Ted Kremenek [Tue, 5 Feb 2008 18:51:06 +0000 (18:51 +0000)]
Added a "ConstantNotEq" map to ValueState (and added necessary typedefs and factory objects to ValueStateManager).

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

16 years agoAdded some comments.
Ted Kremenek [Tue, 5 Feb 2008 18:24:17 +0000 (18:24 +0000)]
Added some comments.

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

16 years agoRenamed typedef "iterator" in ValueState to "vb_iterator" (for "VariableBindings").
Ted Kremenek [Tue, 5 Feb 2008 18:19:15 +0000 (18:19 +0000)]
Renamed typedef "iterator" in ValueState to "vb_iterator" (for "VariableBindings").

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

16 years agoReordered fields/methods in ValueState to make it more aesthetically pleasing.
Ted Kremenek [Tue, 5 Feb 2008 18:17:58 +0000 (18:17 +0000)]
Reordered fields/methods in ValueState to make it more aesthetically pleasing.

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

16 years agoUse correct flag value.
Anders Carlsson [Tue, 5 Feb 2008 17:26:36 +0000 (17:26 +0000)]
Use correct flag value.

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

16 years agoAppend input argument to args vector.
Anders Carlsson [Tue, 5 Feb 2008 16:57:38 +0000 (16:57 +0000)]
Append input argument to args vector.

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

16 years agoAdd code generation for inline asm statements.
Anders Carlsson [Tue, 5 Feb 2008 16:35:33 +0000 (16:35 +0000)]
Add code generation for inline asm statements.

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

16 years agorewrite some of the type refinement code to eliminate dangling pointers
Chris Lattner [Tue, 5 Feb 2008 08:06:13 +0000 (08:06 +0000)]
rewrite some of the type refinement code to eliminate dangling pointers
simplify the code and generally make it more robust.

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

16 years agoOverhauling of "ValueState" so that it represents its own functional data
Ted Kremenek [Tue, 5 Feb 2008 07:17:49 +0000 (07:17 +0000)]
Overhauling of "ValueState" so that it represents its own functional data
structure that can contain several maps, not just one.

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

16 years agoChange the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
Chris Lattner [Tue, 5 Feb 2008 06:55:31 +0000 (06:55 +0000)]
Change the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
Type*'s can change as types are refined, so we can't use them as a stable key in
the map.  Decls don't change, so use them instead.

This patch was written by Anders, but he's too shy to commit it himself :)

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

16 years agoRelax an assertion, fixing PR1968
Chris Lattner [Tue, 5 Feb 2008 06:37:34 +0000 (06:37 +0000)]
Relax an assertion, fixing PR1968

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

16 years agoValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph.
Ted Kremenek [Tue, 5 Feb 2008 05:15:51 +0000 (05:15 +0000)]
ValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph.

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

16 years agoUpdate outdated comment.
Devang Patel [Tue, 5 Feb 2008 03:17:42 +0000 (03:17 +0000)]
Update outdated comment.

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

16 years agoCleanup InitListExpr code generation code.
Devang Patel [Tue, 5 Feb 2008 02:39:50 +0000 (02:39 +0000)]
Cleanup InitListExpr code generation code.
Handle padding fields while initializing struct (fix PR 1962)

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

16 years agoFix memory corruption from the type map being modified while a reference
Eli Friedman [Tue, 5 Feb 2008 02:18:07 +0000 (02:18 +0000)]
Fix memory corruption from the type map being modified while a reference
to a cell is being held.

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

16 years agoKeep track of padding fields.
Devang Patel [Tue, 5 Feb 2008 01:40:48 +0000 (01:40 +0000)]
Keep track of padding fields.

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

16 years agoSimplified transfer functions for '++' and '--'
Ted Kremenek [Tue, 5 Feb 2008 00:43:43 +0000 (00:43 +0000)]
Simplified transfer functions for '++' and '--'

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

16 years agoImplemented initial transfer function support for '&&', '||', '?', and
Ted Kremenek [Tue, 5 Feb 2008 00:26:40 +0000 (00:26 +0000)]
Implemented initial transfer function support for '&&', '||', '?', and
__builtin_choose.

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

16 years agoAdded file that should have been in my previous commit.
Ted Kremenek [Mon, 4 Feb 2008 21:59:22 +0000 (21:59 +0000)]
Added file that should have been in my previous commit.

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

16 years agoCreated ValueStateManager, a full-blown class to manage the states
Ted Kremenek [Mon, 4 Feb 2008 21:59:01 +0000 (21:59 +0000)]
Created ValueStateManager, a full-blown class to manage the states
created for GRConstants.  Moved instances of ValueManager and SymbolManager
inside this class.  The goal is to gradually separate more of the state
management from the state transformation.

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

16 years agoImplemented transfer function for unary '~'.
Ted Kremenek [Mon, 4 Feb 2008 16:58:30 +0000 (16:58 +0000)]
Implemented transfer function for unary '~'.

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

16 years agoAdd ending newline to test.
Christopher Lamb [Mon, 4 Feb 2008 02:35:11 +0000 (02:35 +0000)]
Add ending newline to test.

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

16 years agoAdd experimental support for address space qualified types. Address space
Christopher Lamb [Mon, 4 Feb 2008 02:31:56 +0000 (02:31 +0000)]
Add experimental support for address space qualified types. Address space
qualifiers use the __attribute__((address_space(id))) syntax.

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

16 years ago- ccc creates output objects in same directory as the source file, and
Bill Wendling [Sun, 3 Feb 2008 21:27:46 +0000 (21:27 +0000)]
- ccc creates output objects in same directory as the source file, and
  not in the current directory. This doesn't work with VPATH builds in
  autotooled builds.
- ccc now creates object files without an extension.
- Return exit code 1 if code > 255.

Patch by Torok!

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

16 years agoFix PR1966 by ignoring non-error diagnostics from system headers even if they are
Chris Lattner [Sun, 3 Feb 2008 09:00:04 +0000 (09:00 +0000)]
Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
*mapped* onto errors.

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

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