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.
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__; });
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.
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.
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.
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.
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.
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);
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.
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.
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.
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.
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.
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.
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).
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.
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...
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.
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.
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.
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".
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...
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).