]> granicus.if.org Git - clang/log
clang
16 years agomove type attribute processing into the creatively named ProcessTypeAttributes method.
Chris Lattner [Thu, 21 Feb 2008 01:07:18 +0000 (01:07 +0000)]
move type attribute processing into the creatively named ProcessTypeAttributes method.

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

16 years agoCorrectly handle address space qualifiers in declspecs. This
Chris Lattner [Thu, 21 Feb 2008 00:48:22 +0000 (00:48 +0000)]
Correctly handle address space qualifiers in declspecs.  This
allows us to correctly handle stuff like:

  _AS1 float *B;

and to reject stuff like:

  _AS1 _AS2* x;

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

16 years agomove ConvertDeclSpecToType into Sema
Chris Lattner [Wed, 20 Feb 2008 23:53:49 +0000 (23:53 +0000)]
move ConvertDeclSpecToType into Sema

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

16 years agorename some methods.
Chris Lattner [Wed, 20 Feb 2008 23:25:22 +0000 (23:25 +0000)]
rename some methods.

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

16 years agoUse getKind() in HandleDeclAttribute instead of decoding the string inline.
Chris Lattner [Wed, 20 Feb 2008 23:17:35 +0000 (23:17 +0000)]
Use getKind() in HandleDeclAttribute instead of decoding the string inline.

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

16 years agoadd a method to AttributeList that converts an identifier to an enum.
Chris Lattner [Wed, 20 Feb 2008 23:14:47 +0000 (23:14 +0000)]
add a method to AttributeList that converts an identifier to an enum.

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

16 years agoTabs are the enemy
Nate Begeman [Wed, 20 Feb 2008 22:57:40 +0000 (22:57 +0000)]
Tabs are the enemy

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

16 years agoadd some code that will be used to remove processed attrs from
Chris Lattner [Wed, 20 Feb 2008 22:04:11 +0000 (22:04 +0000)]
add some code that will be used to remove processed attrs from
declspec, it is currently nonfunctional though.

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

16 years agoChange ConvertDeclSpecToType to break out of switch instead of
Chris Lattner [Wed, 20 Feb 2008 21:40:32 +0000 (21:40 +0000)]
Change ConvertDeclSpecToType to break out of switch instead of
returning directly.  This allows us to factor handling of _Complex.

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

16 years agoAlternate address spaces work:
Chris Lattner [Wed, 20 Feb 2008 20:55:12 +0000 (20:55 +0000)]
Alternate address spaces work:

rename QualType::getQualifiers to getCVRQualifiers.
Add some fixme's and clean up some code relevant to qualifiers.
Change ASQualType to contain a Type* instead of a QualType.
Any CVR qualifiers should be on the outer qual type.

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

16 years agoImplemented transfer function logic for unary '+'
Ted Kremenek [Wed, 20 Feb 2008 04:12:31 +0000 (04:12 +0000)]
Implemented transfer function logic for unary '+'

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

16 years agoPlaced transfer function logic for dereferences in its own method, while at
Ted Kremenek [Wed, 20 Feb 2008 04:02:35 +0000 (04:02 +0000)]
Placed transfer function logic for dereferences in its own method, while at
the same time clearing up some logic of how the unary '*' operator is processed.

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

16 years agoImprove non-const initializer implementation.
Lauro Ramos Venancio [Tue, 19 Feb 2008 22:04:22 +0000 (22:04 +0000)]
Improve non-const initializer implementation.

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

16 years agoImplement CodeGenModule::getMemSetFn method.
Lauro Ramos Venancio [Tue, 19 Feb 2008 22:01:01 +0000 (22:01 +0000)]
Implement CodeGenModule::getMemSetFn method.

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

16 years agoAdded missing case in constant propagation logic for handling the Xor of
Ted Kremenek [Tue, 19 Feb 2008 20:53:37 +0000 (20:53 +0000)]
Added missing case in constant propagation logic for handling the Xor of
two concrete integer values.

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

16 years agoAdded special handling for UninitializedVals for the transfer function logic
Ted Kremenek [Tue, 19 Feb 2008 20:53:06 +0000 (20:53 +0000)]
Added special handling for UninitializedVals for the transfer function logic
for pointer dereferences.

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

16 years agoImplemented "getType()" for symbolic values representing the "contents" of
Ted Kremenek [Tue, 19 Feb 2008 20:51:40 +0000 (20:51 +0000)]
Implemented "getType()" for symbolic values representing the "contents" of
another symbolic value.

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

16 years agoSimplify aggregate initilizer implementation. Use the CodeGenModule::EmitConstantExpr...
Lauro Ramos Venancio [Tue, 19 Feb 2008 19:27:31 +0000 (19:27 +0000)]
Simplify aggregate initilizer implementation. Use the CodeGenModule::EmitConstantExpr method when
possible.
Fix mediabench/mpeg2/mpeg2dec test.

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

16 years agoFixed transfer function for casts to always evaluate the effects of the
Ted Kremenek [Tue, 19 Feb 2008 18:52:54 +0000 (18:52 +0000)]
Fixed transfer function for casts to always evaluate the effects of the
cast's subexpression even if the cast itself has no effect.

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

16 years agoAdded transfer function support for casting to "void".
Ted Kremenek [Tue, 19 Feb 2008 18:47:04 +0000 (18:47 +0000)]
Added transfer function support for casting to "void".

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

16 years agofix the second half of PR2041: __restrict is ok in c90 mode, even if
Chris Lattner [Tue, 19 Feb 2008 06:46:10 +0000 (06:46 +0000)]
fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't.

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

16 years agoFixed bug classof() bug with RValues that could cause an UninitializedVal
Ted Kremenek [Tue, 19 Feb 2008 02:34:18 +0000 (02:34 +0000)]
Fixed bug classof() bug with RValues that could cause an UninitializedVal
or UnknownVal to be interpreted as an actual NonLValue/LValue.

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

16 years agoFor now, --grsimple skips analyzing functions in header files.
Ted Kremenek [Tue, 19 Feb 2008 02:33:31 +0000 (02:33 +0000)]
For now, --grsimple skips analyzing functions in header files.

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

16 years agoAdded back explicit state/node creation when visiting IntegerLiterals and
Ted Kremenek [Tue, 19 Feb 2008 02:01:16 +0000 (02:01 +0000)]
Added back explicit state/node creation when visiting IntegerLiterals and
CharacterLiterals.  This may not be a permanent solution; it doesn't cost that
much, however, to create a few additional states, and solves a whole bunch
of edge cases when handling ?, ||, and &&.

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

16 years agoAdded boilerplate transfer function support for CallExprs.
Ted Kremenek [Tue, 19 Feb 2008 01:44:53 +0000 (01:44 +0000)]
Added boilerplate transfer function support for CallExprs.

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

16 years agoAllow ArraySubscriptExpr to be a base node for vector dereference. This
Nate Begeman [Tue, 19 Feb 2008 01:11:03 +0000 (01:11 +0000)]
Allow ArraySubscriptExpr to be a base node for vector dereference.  This
allows you to do things like
typedef __attribute__(( ocu_vector_type(4))) float float4;
float4 *x;
float y = x[0][2];

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

16 years agoAdded FIXME for properly handling local arrays using symbolic LValues.
Ted Kremenek [Tue, 19 Feb 2008 00:29:51 +0000 (00:29 +0000)]
Added FIXME for properly handling local arrays using symbolic LValues.
For now we just treat their values as "Unknown."

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

16 years ago--grsimple now reports the number of nodes in the ExplodedGraph for
Ted Kremenek [Tue, 19 Feb 2008 00:22:37 +0000 (00:22 +0000)]
--grsimple now reports the number of nodes in the ExplodedGraph for
an analyzed function.

GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in
the ExplodedGraph).

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

16 years agoA global without initializer must be emitted as weak.
Lauro Ramos Venancio [Tue, 19 Feb 2008 00:04:15 +0000 (00:04 +0000)]
A global without initializer must be emitted as weak.
Fix Olden/bh test.

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

16 years agoAdded "size()" and "empty()" methods to ExplodedGraphImpl.
Ted Kremenek [Mon, 18 Feb 2008 23:00:23 +0000 (23:00 +0000)]
Added "size()" and "empty()" methods to ExplodedGraphImpl.

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

16 years agoAdded more assertions and checks in transfer function logic to check for
Ted Kremenek [Mon, 18 Feb 2008 22:57:02 +0000 (22:57 +0000)]
Added more assertions and checks in transfer function logic to check for
UninitializedVals and UnknownVals.

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

16 years agoImplement multi-dimension array initalizer.
Lauro Ramos Venancio [Mon, 18 Feb 2008 22:44:02 +0000 (22:44 +0000)]
Implement multi-dimension array initalizer.
Fix McCat/08-main test.

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

16 years agoRunning -grsimple now emits diagnostics about the time spent analyzing each function...
Ted Kremenek [Mon, 18 Feb 2008 21:21:23 +0000 (21:21 +0000)]
Running -grsimple now emits diagnostics about the time spent analyzing each function.  Will
probably make this a separate command line option later.

Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.

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

16 years agoTemporary solution to push analysis through to analyzing PCRE.
Ted Kremenek [Mon, 18 Feb 2008 21:19:49 +0000 (21:19 +0000)]
Temporary solution to push analysis through to analyzing PCRE.
We will implement symbol "unification" later.

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

16 years agoAdd more supported constraints.
Anders Carlsson [Mon, 18 Feb 2008 17:00:25 +0000 (17:00 +0000)]
Add more supported constraints.

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

16 years agoTweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
Steve Naroff [Mon, 18 Feb 2008 15:14:59 +0000 (15:14 +0000)]
Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.

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

16 years agoMore bitfield improvements.
Anders Carlsson [Mon, 18 Feb 2008 07:13:09 +0000 (07:13 +0000)]
More bitfield improvements.

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

16 years agoFix bug where we would report the wrong value for __alignof__ with an expr that is...
Anders Carlsson [Mon, 18 Feb 2008 07:10:45 +0000 (07:10 +0000)]
Fix bug where we would report the wrong value for __alignof__ with an expr that is not a type.

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

16 years agoTurn handling of parameter attributes back on, fixing the ObjC breakage
Nate Begeman [Sun, 17 Feb 2008 21:20:31 +0000 (21:20 +0000)]
Turn handling of parameter attributes back on, fixing the ObjC breakage

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

16 years agoRevert this temporarily, it's breaking objc :/
Nate Begeman [Sun, 17 Feb 2008 21:04:23 +0000 (21:04 +0000)]
Revert this temporarily, it's breaking objc :/

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

16 years agoHandle parameter attributes
Nate Begeman [Sun, 17 Feb 2008 21:02:04 +0000 (21:02 +0000)]
Handle parameter attributes

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

16 years agoFix PR2042. One remaining issue: we don't currently diagnose
Chris Lattner [Sun, 17 Feb 2008 19:31:09 +0000 (19:31 +0000)]
Fix PR2042.  One remaining issue: we don't currently diagnose

 int foobar(int);
 int foobar() {}

which requires ifdef'ing out a testcase in predefined-function.c.

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

16 years agoChange alignment for doubles to 32 bits which is what X86 has.
Anders Carlsson [Sun, 17 Feb 2008 03:40:02 +0000 (03:40 +0000)]
Change alignment for doubles to 32 bits which is what X86 has.

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

16 years agoImplemnt isVariablyModifiedType correctly.
Eli Friedman [Sun, 17 Feb 2008 00:59:11 +0000 (00:59 +0000)]
Implemnt isVariablyModifiedType correctly.

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

16 years agoimplement codegen support for aggregates casted to void.
Chris Lattner [Sat, 16 Feb 2008 23:55:16 +0000 (23:55 +0000)]
implement codegen support for aggregates casted to void.

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

16 years agoA couple of msvc compile fixes from the ml; I haven't tested with msvc,
Eli Friedman [Sat, 16 Feb 2008 23:17:23 +0000 (23:17 +0000)]
A couple of msvc compile fixes from the ml; I haven't tested with msvc,
but the fixes are reasonable.

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

16 years agoImplement extern block var.
Lauro Ramos Venancio [Sat, 16 Feb 2008 22:30:38 +0000 (22:30 +0000)]
Implement extern block var.

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

16 years agoAdd more tests
Anders Carlsson [Sat, 16 Feb 2008 19:51:36 +0000 (19:51 +0000)]
Add more tests

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

16 years agoBetter handling of the aligned attribute.
Anders Carlsson [Sat, 16 Feb 2008 19:51:27 +0000 (19:51 +0000)]
Better handling of the aligned attribute.

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

16 years agoMore comments from Chris.
Anders Carlsson [Sat, 16 Feb 2008 03:37:41 +0000 (03:37 +0000)]
More comments from Chris.

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

16 years agoFix CheckEndOfDirective to diagnose lines that contain macros that expand to
Chris Lattner [Sat, 16 Feb 2008 01:20:36 +0000 (01:20 +0000)]
Fix CheckEndOfDirective to diagnose lines that contain macros that expand to
zero tokens.  This fixes PR2045, thanks to Neil for finding another
incredibly subtle corner case :)

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

16 years agoMake sizeof and __alignof work correctly with packed structs.
Anders Carlsson [Sat, 16 Feb 2008 01:20:23 +0000 (01:20 +0000)]
Make sizeof and __alignof work correctly with packed structs.

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

16 years agoFurther cleanup. Moved definitions for SymbolManager and ValueManager into
Ted Kremenek [Sat, 16 Feb 2008 01:12:31 +0000 (01:12 +0000)]
Further cleanup.  Moved definitions for SymbolManager and ValueManager into
their own [.cpp;.h] files.

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

16 years agoFix typo
Anders Carlsson [Sat, 16 Feb 2008 00:39:40 +0000 (00:39 +0000)]
Fix typo

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

16 years agoHandle packed attribute correctly
Anders Carlsson [Sat, 16 Feb 2008 00:29:18 +0000 (00:29 +0000)]
Handle packed attribute correctly

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

16 years agoAddress comments from Chris.
Anders Carlsson [Sat, 16 Feb 2008 00:24:09 +0000 (00:24 +0000)]
Address comments from Chris.

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

16 years agoStore attributes in a global hash map instead.
Anders Carlsson [Fri, 15 Feb 2008 23:57:38 +0000 (23:57 +0000)]
Store attributes in a global hash map instead.

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

16 years agoStore attributes in a global hash map instead.
Anders Carlsson [Fri, 15 Feb 2008 23:30:50 +0000 (23:30 +0000)]
Store attributes in a global hash map instead.

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

16 years agoRefactored code for transfer functions for binary operators involving two LValues.
Ted Kremenek [Fri, 15 Feb 2008 23:15:23 +0000 (23:15 +0000)]
Refactored code for transfer functions for binary operators involving two LValues.

Fixed bug in transfer functions for sizeof(*); we were incorrectly evaluating to
a value of the wrong type.

Fixed bug in transfer functions for compound assignments where we did not properly
handle assignments involving dereferences of symbolic values.

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

16 years agoSet Ubuntu 7.10 c++ include path.
Lauro Ramos Venancio [Fri, 15 Feb 2008 22:36:38 +0000 (22:36 +0000)]
Set Ubuntu 7.10 c++ include path.

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

16 years agoAdd c++ to "inferlanguage"
Lauro Ramos Venancio [Fri, 15 Feb 2008 22:35:25 +0000 (22:35 +0000)]
Add c++ to "inferlanguage"

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

16 years agoAdded transfer function support for conditional branches with a NULL condition (e...
Ted Kremenek [Fri, 15 Feb 2008 22:29:00 +0000 (22:29 +0000)]
Added transfer function support for conditional branches with a NULL condition (e.g., "for(;;)").
Fixed bug in transfer function for compound assignment operators when both operands where variables but had a non-pointer type (we fired an assertion).

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

16 years agoSimplified transfer function logic for ++/-- operators.
Ted Kremenek [Fri, 15 Feb 2008 22:09:30 +0000 (22:09 +0000)]
Simplified transfer function logic for ++/-- operators.
Added more boilerplate transfer function support for pointer arithmetic.
Added more pretty-printing support for symbolic constraints.
Added transfer function support for handling enum values.
Minor pointer types cleanup in ExplodedGraphImpl.

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

16 years agoAdded predicate function "UnaryOperator::isIncrementOp()".
Ted Kremenek [Fri, 15 Feb 2008 22:04:52 +0000 (22:04 +0000)]
Added predicate function "UnaryOperator::isIncrementOp()".

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

16 years agoDon't call non-existent method... sorry about the spam; the fix seemed
Eli Friedman [Fri, 15 Feb 2008 19:53:52 +0000 (19:53 +0000)]
Don't call non-existent method... sorry about the spam; the fix seemed
trivial, but I forgot that method doesn't exist yet.

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

16 years agoGet rid of unused variable warning.
Eli Friedman [Fri, 15 Feb 2008 19:49:39 +0000 (19:49 +0000)]
Get rid of unused variable warning.

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

16 years agoSplit out incomplete arrays from VariableArrayType into
Eli Friedman [Fri, 15 Feb 2008 18:16:39 +0000 (18:16 +0000)]
Split out incomplete arrays from VariableArrayType into
IncompleteArrayType.  This should make code dealing with both incomplete
and variable length arrays much more readable, plus it allows properly
making the distinction between isVariableArrayType() and
isVariablyModifiedType().  The patch is a little big, but it's
strightforward. so I don't think there should be any issues.

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

16 years agoFix PR2041: restrict is not a keyword in c90.
Chris Lattner [Fri, 15 Feb 2008 18:02:59 +0000 (18:02 +0000)]
Fix PR2041: restrict is not a keyword in c90.

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

16 years agoPart of clearing up the whole VariableArrayType + incomplete arrays
Eli Friedman [Fri, 15 Feb 2008 12:53:51 +0000 (12:53 +0000)]
Part of clearing up the whole VariableArrayType + incomplete arrays
thing.  Some cleanups that can be done independently of the fix.

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

16 years agoRemove unnecessary references to VariableArrayType from Analysis.
Eli Friedman [Fri, 15 Feb 2008 12:28:27 +0000 (12:28 +0000)]
Remove unnecessary references to VariableArrayType from Analysis.

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

16 years agoRemove useless parameter from isConstantSizeType.
Eli Friedman [Fri, 15 Feb 2008 12:20:59 +0000 (12:20 +0000)]
Remove useless parameter from isConstantSizeType.

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

16 years agoGet rid of AttributeList in the AST and use the new Attr class instead
Anders Carlsson [Fri, 15 Feb 2008 07:04:12 +0000 (07:04 +0000)]
Get rid of AttributeList in the AST and use the new Attr class instead

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

16 years agoGet rid of outdated code that masks type errors. Fixes PR2036.
Eli Friedman [Fri, 15 Feb 2008 06:56:02 +0000 (06:56 +0000)]
Get rid of outdated code that masks type errors. Fixes PR2036.

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

16 years agoNevermind, these tests work... I messed up my testing.
Eli Friedman [Fri, 15 Feb 2008 06:29:53 +0000 (06:29 +0000)]
Nevermind, these tests work... I messed up my testing.

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

16 years agoPartial fix for struct compatibility; there's still something messy
Eli Friedman [Fri, 15 Feb 2008 06:03:44 +0000 (06:03 +0000)]
Partial fix for struct compatibility; there's still something messy
going on with mixing scopes, though.

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

16 years agoAdded boilerplate transfer function support for pointer arithmetic operations.
Ted Kremenek [Fri, 15 Feb 2008 00:52:26 +0000 (00:52 +0000)]
Added boilerplate transfer function support for pointer arithmetic operations.

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

16 years agoAdded --grsimple-view option to clang driver; this is the same as
Ted Kremenek [Fri, 15 Feb 2008 00:35:38 +0000 (00:35 +0000)]
Added --grsimple-view option to clang driver; this is the same as
--grsimple except that it visualizes the ExplodedGraph using dot and
outputs the current function being analyzed.  --grsimple is now silent
except when it emits diagnostics.

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

16 years agoAdded "symbol iterators" for RValues, allowing easy iteration over the symbols
Ted Kremenek [Thu, 14 Feb 2008 23:25:54 +0000 (23:25 +0000)]
Added "symbol iterators" for RValues, allowing easy iteration over the symbols
referenced by an RValue, instead of having to query the type of the RValue.

Modified ValueState::RemoveDeadBindings to also prune dead symbols.

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

16 years agoWhen visualizing ExplodedNodes created by GRExprEngine, color nodes with
Ted Kremenek [Thu, 14 Feb 2008 22:54:53 +0000 (22:54 +0000)]
When visualizing ExplodedNodes created by GRExprEngine, color nodes with
null-dereferences or bad control-flow red.

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

16 years agoDon't analyze functions when we have parse errors.
Ted Kremenek [Thu, 14 Feb 2008 22:54:17 +0000 (22:54 +0000)]
Don't analyze functions when we have parse errors.

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

16 years agoRenamed GRConstants => GRSimpleVals.
Ted Kremenek [Thu, 14 Feb 2008 22:36:46 +0000 (22:36 +0000)]
Renamed GRConstants => GRSimpleVals.
Moved driver logic for --grsimple to GRSimpleVals.cpp.

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

16 years ago#include cleanups in GRExprEngine.cpp/GRExprEngine.h. Moved GRExprEngine to
Ted Kremenek [Thu, 14 Feb 2008 22:16:04 +0000 (22:16 +0000)]
#include cleanups in GRExprEngine.cpp/GRExprEngine.h.  Moved GRExprEngine to
clang namespace.

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

16 years agoPartitioned definition/implementation of GRExperEngine into .h and .cpp.
Ted Kremenek [Thu, 14 Feb 2008 22:13:12 +0000 (22:13 +0000)]
Partitioned definition/implementation of GRExperEngine into .h and .cpp.
Still some cleanup to do, but this initial checkin compiles and runs correctly.

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

16 years agoMigrated transfer functions for binary operators for simple value tracking
Ted Kremenek [Thu, 14 Feb 2008 19:37:24 +0000 (19:37 +0000)]
Migrated transfer functions for binary operators for simple value tracking
from RValues to GRTransferFuncs/GRSimpleVals.

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

16 years agoParseCompoundStatementBody expects to only be called with { as the current
Chris Lattner [Thu, 14 Feb 2008 19:27:54 +0000 (19:27 +0000)]
ParseCompoundStatementBody expects to only be called with { as the current
token.  Diagnose when the { is missing in objc @try blocks instead of aborting.

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

16 years agoMigrated transfer functions for unary "~" and "-" to GRTransferFuncs/GRSimpleVals.
Ted Kremenek [Thu, 14 Feb 2008 18:40:24 +0000 (18:40 +0000)]
Migrated transfer functions for unary "~" and "-" to GRTransferFuncs/GRSimpleVals.

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

16 years agoStarted partitioning of transfer function logic (and thus the policy behind
Ted Kremenek [Thu, 14 Feb 2008 18:28:23 +0000 (18:28 +0000)]
Started partitioning of transfer function logic (and thus the policy behind
these operations) into GRTransferFuncs and its subclasses.  Originally all
of this logic was handled by the class RValue, but in reality different
analyses will want more flexibility on how they evaluate different values.

Transfer functions migrated so far: "Cast"

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

16 years agoMoved Rvalues.h from "Analysis/" to "include/clang/Analysis/PathSensitive".
Ted Kremenek [Thu, 14 Feb 2008 17:30:51 +0000 (17:30 +0000)]
Moved Rvalues.h from "Analysis/" to "include/clang/Analysis/PathSensitive".

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

16 years agoCompleted note
Nate Begeman [Thu, 14 Feb 2008 08:19:48 +0000 (08:19 +0000)]
Completed note

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

16 years agoAddress comments from Chris.
Anders Carlsson [Thu, 14 Feb 2008 07:43:43 +0000 (07:43 +0000)]
Address comments from Chris.

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

16 years agoAdd Attr.h which is an AST-level class for GCC attributes.
Anders Carlsson [Thu, 14 Feb 2008 07:14:34 +0000 (07:14 +0000)]
Add Attr.h which is an AST-level class for GCC attributes.

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

16 years agoRemove DeclSpec::Invalid, a recently added bool that allowed the parser to detect...
Steve Naroff [Thu, 14 Feb 2008 03:30:24 +0000 (03:30 +0000)]
Remove DeclSpec::Invalid, a recently added bool that allowed the parser to detect if the decl spec was invalid.

For now, we will stick with the original strategy - clients of Parse::ParseDeclarationSpecifiers() should never have to know this.

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

16 years agoA much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987.
Steve Naroff [Thu, 14 Feb 2008 02:58:32 +0000 (02:58 +0000)]
A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987.

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

16 years agoAdded support to GRCoreEngine/GRExprEngine for processing control-flow
Ted Kremenek [Wed, 13 Feb 2008 23:08:21 +0000 (23:08 +0000)]
Added support to GRCoreEngine/GRExprEngine for processing control-flow
from switch...case...default statements.

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

16 years agoAdjust for APInt's isPositive being renamed to isNonNegative.
Dan Gohman [Wed, 13 Feb 2008 22:09:49 +0000 (22:09 +0000)]
Adjust for APInt's isPositive being renamed to isNonNegative.

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

16 years agoWhen creating the CFGBlocks for a switch statement, we now have the "default"
Ted Kremenek [Wed, 13 Feb 2008 22:05:39 +0000 (22:05 +0000)]
When creating the CFGBlocks for a switch statement, we now have the "default"
branch ALWAYS be the last successor for a switch-terminated block. This allows
clients to distinguish cases like the following:

switch(...)
  case XXX:
    switch(...) {
      case YYY: ...
    }

  case ZZZ: ..
}

In this case, the block with "case ZZZ:" is the default block for the inner
switch statement, but that case is associated with the outer switch statement,
and not the inner one. Clients can test for this behavior by checking if a
successor block is the last one (and thus just assume that this is the "default"
case).

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

16 years agoFixed bug in CFG construction when processing switch statements that contain no
Ted Kremenek [Wed, 13 Feb 2008 21:46:34 +0000 (21:46 +0000)]
Fixed bug in CFG construction when processing switch statements that contain no
"default" case. In such cases, we now correctly add the CFGBlock representing
the code after the switch statement as a successor to the block terminated by
the switch statement.

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

16 years agoFixed 80 col violations.
Ted Kremenek [Wed, 13 Feb 2008 18:06:44 +0000 (18:06 +0000)]
Fixed 80 col violations.

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

16 years agoavoid making implicit casts that just remove typedefs.
Chris Lattner [Wed, 13 Feb 2008 18:01:07 +0000 (18:01 +0000)]
avoid making implicit casts that just remove typedefs.

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

16 years agoUnbreak the build.
Ted Kremenek [Wed, 13 Feb 2008 17:45:18 +0000 (17:45 +0000)]
Unbreak the build.

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