]> granicus.if.org Git - clang/log
clang
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

16 years agoWhen adding assignment expressions to the set of block-level expressions, only
Ted Kremenek [Fri, 25 Jan 2008 18:28:28 +0000 (18:28 +0000)]
When adding assignment expressions to the set of block-level expressions, only
include the assignment expressions whose result (as in the value of the
expression) is used by other expressions.

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

16 years agoDiagnose bad receiver type.
Fariborz Jahanian [Fri, 25 Jan 2008 17:43:39 +0000 (17:43 +0000)]
Diagnose bad receiver type.

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

16 years agoImplement -print-prog-name. Patch by Nuno Lopes.
Seo Sanghyeon [Fri, 25 Jan 2008 14:57:54 +0000 (14:57 +0000)]
Implement -print-prog-name. Patch by Nuno Lopes.

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

16 years agoSupport checking and codegen of constant vector globals
Nate Begeman [Fri, 25 Jan 2008 05:34:48 +0000 (05:34 +0000)]
Support checking and codegen of constant vector globals

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

16 years agoReplace Sema::CheckVariableInitList, CheckConstantInitList, and CheckForCharArrayInit...
Steve Naroff [Fri, 25 Jan 2008 00:51:06 +0000 (00:51 +0000)]
Replace Sema::CheckVariableInitList, CheckConstantInitList, and CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers.

This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-)

Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-)

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

16 years agoFix a bug recovering from broken code with a goto that Eli reported.
Chris Lattner [Fri, 25 Jan 2008 00:01:10 +0000 (00:01 +0000)]
Fix a bug recovering from broken code with a goto that Eli reported.

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

16 years agoChange the location we return for the EOF token to actually be on the last
Chris Lattner [Fri, 25 Jan 2008 00:00:30 +0000 (00:00 +0000)]
Change the location we return for the EOF token to actually be on the last
line of the file, in the common case where a file ends with a newline.

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

16 years agoDon't add an extra line to the end of the buffer, it doesn't really exist.
Chris Lattner [Thu, 24 Jan 2008 23:25:53 +0000 (23:25 +0000)]
Don't add an extra line to the end of the buffer, it doesn't really exist.

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

16 years agoSome minor restructuring around LValue and RValue types. The value "kind"
Ted Kremenek [Thu, 24 Jan 2008 23:19:54 +0000 (23:19 +0000)]
Some minor restructuring around LValue and RValue types. The value "kind"
information is not separated into a "base" and "sub" type. Eventually the
value-tracking logic will know about LValues and RValues, but not about
specialized LValues and RValues; separating the "kind" information into bits
indicating whether an ExprValue is an LValue or an RValue from the bits that
specify the actual value type makes this separation easier.

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

16 years agoExclude vectors from Type::isScalar() predicate.
Steve Naroff [Thu, 24 Jan 2008 22:55:05 +0000 (22:55 +0000)]
Exclude vectors from Type::isScalar() predicate.

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

16 years agoenum value name change.
Ted Kremenek [Thu, 24 Jan 2008 22:44:24 +0000 (22:44 +0000)]
enum value name change.

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

16 years agoMore cleanups to pretty-printing of states in GraphViz output.
Ted Kremenek [Thu, 24 Jan 2008 22:27:20 +0000 (22:27 +0000)]
More cleanups to pretty-printing of states in GraphViz output.

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

16 years agoAdded transfer function for DeclStmt.
Ted Kremenek [Thu, 24 Jan 2008 20:55:43 +0000 (20:55 +0000)]
Added transfer function for DeclStmt.

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

16 years agoAdjusted storage of values for Stmt* so that we need only query if
Ted Kremenek [Thu, 24 Jan 2008 19:43:37 +0000 (19:43 +0000)]
Adjusted storage of values for Stmt* so that we need only query if
a Stmt* is a block-level expression when we INSERT a value into the map, and
not also when we QUERY a value.

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

16 years agoFixed a bug where the values of block-level expressions were being recorded in
Ted Kremenek [Thu, 24 Jan 2008 19:28:01 +0000 (19:28 +0000)]
Fixed a bug where the values of block-level expressions were being recorded in
the value map as if the expressions were non-block-level expressions.

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

16 years agoMinor tweaks in the transfer functions for pre- and post- ++/-- where
Ted Kremenek [Thu, 24 Jan 2008 19:00:57 +0000 (19:00 +0000)]
Minor tweaks in the transfer functions for pre- and post- ++/-- where
we falsely constructed an APInt to represent the constant '1' instead of
using an APSInt (which has a sign).

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

16 years agoAdded support for unary operator '-' for equality sets.
Ted Kremenek [Thu, 24 Jan 2008 08:20:02 +0000 (08:20 +0000)]
Added support for unary operator '-' for equality sets.

Added some workarounds for loss of signess information on some APSInt
operations. Considering the best route to integrate these into APSInt directly.
(FIXME's in GRConstants.cpp).

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

16 years agoAdded transfer functions for pre- and post- increment/decrement operators.
Ted Kremenek [Thu, 24 Jan 2008 02:28:56 +0000 (02:28 +0000)]
Added transfer functions for pre- and post- increment/decrement operators.

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

16 years agoAdded passing "ASTContext" to both GREngine and GRConstants.
Ted Kremenek [Thu, 24 Jan 2008 02:02:54 +0000 (02:02 +0000)]
Added passing "ASTContext" to both GREngine and GRConstants.
Added initial support for integer casting operations to GRConstants.

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

16 years agoMinor tweak in GetValue to avoid an extra check for ParenExprs.
Ted Kremenek [Thu, 24 Jan 2008 00:50:08 +0000 (00:50 +0000)]
Minor tweak in GetValue to avoid an extra check for ParenExprs.

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

16 years agoImplemented value tracking support for '*' and '*='.
Ted Kremenek [Wed, 23 Jan 2008 23:42:27 +0000 (23:42 +0000)]
Implemented value tracking support for '*' and '*='.
Added "multiplication" support for equality sets.

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

16 years agoImplemented value tracking support for '+=' and '-='.
Ted Kremenek [Wed, 23 Jan 2008 23:38:00 +0000 (23:38 +0000)]
Implemented value tracking support for '+=' and '-='.

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

16 years agoadd some assertions so that the rewriter dies violently with a useful
Chris Lattner [Wed, 23 Jan 2008 23:37:15 +0000 (23:37 +0000)]
add some assertions so that the rewriter dies violently with a useful
error instead of subtly with a mysterious one.

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

16 years agoRemoved extra GraphViz node attributes for GRConstants, as some of them were
Ted Kremenek [Wed, 23 Jan 2008 22:54:57 +0000 (22:54 +0000)]
Removed extra GraphViz node attributes for GRConstants, as some of them were
causing problems with Dot.

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

16 years agosome prettying of the GraphViz visualization of GRConstants analysis results.
Ted Kremenek [Wed, 23 Jan 2008 22:30:44 +0000 (22:30 +0000)]
some prettying of the GraphViz visualization of GRConstants analysis results.

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

16 years agoFixed a nasty bug which took a while to come up with a test case,
Fariborz Jahanian [Wed, 23 Jan 2008 20:34:40 +0000 (20:34 +0000)]
Fixed a nasty bug which took a while to come up with a test case,
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.

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

16 years agoMajor "architectural" changes to the GRConstants analysis. We now reason about
Ted Kremenek [Wed, 23 Jan 2008 19:59:44 +0000 (19:59 +0000)]
Major "architectural" changes to the GRConstants analysis. We now reason about
abstract "L-values" and "R-values" when doing value tracking, and expanding
constant tracking to encompass tracking disjunctive sets of possible constants.
Further, the tree-walking is more efficient, as we don't blindly recurse the
tree if we won't generate new states.

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

16 years agoadd support for -Wundef.
Chris Lattner [Wed, 23 Jan 2008 17:19:46 +0000 (17:19 +0000)]
add support for -Wundef.

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

16 years agoMissing ObjC stuff. Patch by Mike Stump.
Fariborz Jahanian [Wed, 23 Jan 2008 01:34:33 +0000 (01:34 +0000)]
Missing ObjC stuff. Patch by Mike Stump.

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

16 years agoProblem with ObjC's type-encoding of nested structs causing infinit recursion.
Fariborz Jahanian [Tue, 22 Jan 2008 22:44:46 +0000 (22:44 +0000)]
Problem with ObjC's type-encoding of nested structs causing infinit recursion.

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

16 years agoFix a typo.
Lauro Ramos Venancio [Tue, 22 Jan 2008 22:38:35 +0000 (22:38 +0000)]
Fix a typo.

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

16 years agoImplement bitfield write.
Lauro Ramos Venancio [Tue, 22 Jan 2008 22:36:45 +0000 (22:36 +0000)]
Implement bitfield write.

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

16 years agoImplement bitfield read.
Lauro Ramos Venancio [Tue, 22 Jan 2008 20:17:04 +0000 (20:17 +0000)]
Implement bitfield read.

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

16 years agoFix PR1936, a crash on malformed #if. Thanks to Neil for
Chris Lattner [Tue, 22 Jan 2008 19:34:51 +0000 (19:34 +0000)]
Fix PR1936, a crash on malformed #if.  Thanks to Neil for
noticing this!

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

16 years agoFix two bugs in bitfield codegen.
Lauro Ramos Venancio [Tue, 22 Jan 2008 19:15:30 +0000 (19:15 +0000)]
Fix two bugs in bitfield codegen.

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

16 years agoFix grammar.
Gordon Henriksen [Tue, 22 Jan 2008 18:46:25 +0000 (18:46 +0000)]
Fix grammar.

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

16 years agoclarify wording.
Chris Lattner [Tue, 22 Jan 2008 17:14:30 +0000 (17:14 +0000)]
clarify wording.

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

16 years ago- Add Sema::CheckStringLiteralInit, Sema::IsStringLiteralInit.
Steve Naroff [Tue, 22 Jan 2008 00:55:40 +0000 (00:55 +0000)]
- Add Sema::CheckStringLiteralInit, Sema::IsStringLiteralInit.
- Use previous hooks to simplify Sema::CheckInitializerTypes()...

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

16 years agoSema::CheckInitializerTypes(). Start simpliying and cleaning up...
Steve Naroff [Mon, 21 Jan 2008 23:53:58 +0000 (23:53 +0000)]
Sema::CheckInitializerTypes(). Start simpliying and cleaning up...

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

16 years agoAdd Ubuntu 7.10 include path.
Lauro Ramos Venancio [Mon, 21 Jan 2008 23:08:35 +0000 (23:08 +0000)]
Add Ubuntu 7.10 include path.

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

16 years agoElimate bogus warning when va_start is correctly used in
Fariborz Jahanian [Mon, 21 Jan 2008 22:59:53 +0000 (22:59 +0000)]
Elimate bogus warning when va_start is correctly used in
a method.

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

16 years agoAdd a predicate/getter when checking for incomplete array types ("[]").
Steve Naroff [Mon, 21 Jan 2008 22:59:18 +0000 (22:59 +0000)]
Add a predicate/getter when checking for incomplete array types ("[]").

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

16 years agoSimplify the bitfield codegen.
Lauro Ramos Venancio [Mon, 21 Jan 2008 22:54:57 +0000 (22:54 +0000)]
Simplify the bitfield codegen.

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

16 years agoSynthesize methods with va-arg list correctly.
Fariborz Jahanian [Mon, 21 Jan 2008 20:14:23 +0000 (20:14 +0000)]
Synthesize methods with va-arg list correctly.

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

16 years agoFix the __SIZE_TYPE__ definition on x86_32. This fixes the alloca.c (wget 1.10.2...
Lauro Ramos Venancio [Sun, 20 Jan 2008 04:02:16 +0000 (04:02 +0000)]
Fix the __SIZE_TYPE__ definition on x86_32. This fixes the alloca.c (wget 1.10.2) compilation.

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