]> granicus.if.org Git - clang/log
clang
16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 18 Nov 2008 00:57:33 +0000 (00:57 +0000)]
Update Xcode project.

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

16 years agoAdded conditional guard 'if (CurLexer)' when using SetCommentRetentionState().
Ted Kremenek [Tue, 18 Nov 2008 00:43:07 +0000 (00:43 +0000)]
Added conditional guard 'if (CurLexer)' when using SetCommentRetentionState().
This is because the PTHLexer will not support this method. Performance testing
on preprocessing Cocoa.h shows that this results in a negligible performance
difference (less than 1%).

I tried making Lexer::SetCommentRetentionState() an out-of-line function (a
precursor to making it a virtual function in PreprocessorLexer) and noticed a 1%
decrease in speed (it is called in a hot part of the Preprocessor).

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

16 years agoChange a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be the
Ted Kremenek [Tue, 18 Nov 2008 00:34:22 +0000 (00:34 +0000)]
Change a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be the
alias for the current PreprocessorLexer. No functionality change. Performance
testing shows this results in no performance degradation when preprocessing
Cocoa.h.

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

16 years ago- Add 'CurPPLexer' to Preprocessor to keep track of the current
Ted Kremenek [Tue, 18 Nov 2008 00:12:49 +0000 (00:12 +0000)]
- Add 'CurPPLexer' to Preprocessor to keep track of the current
  PreprocessorLexer, which will either be a 'Lexer' or 'PTHLexer'.
- Added stub field 'CurPTHLexer' to keep track of the current PTHLexer.
- Modified IncludeStackInfo to track both the current PTHLexer and
  current PreprocessorLexer.

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

16 years agoImplement effects of 'mutable', and a few comments from Chris on its parsing.
Sebastian Redl [Mon, 17 Nov 2008 23:24:37 +0000 (23:24 +0000)]
Implement effects of 'mutable', and a few comments from Chris on its parsing.

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

16 years agoEliminate all of the placeholder identifiers used for constructors,
Douglas Gregor [Mon, 17 Nov 2008 22:58:34 +0000 (22:58 +0000)]
Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.

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

16 years agoFold assertion into second valid else branch. This removes a compiler warning
Ted Kremenek [Mon, 17 Nov 2008 22:55:12 +0000 (22:55 +0000)]
Fold assertion into second valid else branch.  This removes a compiler warning
where the control reaches the end of a non-void function and also allows the
compiler to generate better code.  When this assertion is false we can easily
add more else cases.

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

16 years agoFix <rdar://problem/6333904> [sema] message lookup on super is incorrect
Steve Naroff [Mon, 17 Nov 2008 22:29:32 +0000 (22:29 +0000)]
Fix <rdar://problem/6333904> [sema] message lookup on super is incorrect

Missing special lookup rule in Sema::ActOnInstanceMessage().

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

16 years agoOnly test test/CodeGenObjC/synchronized.m as a i686-apple-darwin8 target
Douglas Gregor [Mon, 17 Nov 2008 20:45:14 +0000 (20:45 +0000)]
Only test test/CodeGenObjC/synchronized.m as a i686-apple-darwin8 target

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

16 years agoUpdated IdentifierResolver to deal with DeclarationNames. The names of
Douglas Gregor [Mon, 17 Nov 2008 20:34:05 +0000 (20:34 +0000)]
Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

  return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.

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

16 years agoImplement rdar://6319320: give a good diagnostic for cases where people
Chris Lattner [Mon, 17 Nov 2008 19:51:54 +0000 (19:51 +0000)]
Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension.  We don't and
will hopefully never support this.

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

16 years agoFix <rdar://problem/6316324> [sema] spurious warning on comparison of qualified id.
Steve Naroff [Mon, 17 Nov 2008 19:49:16 +0000 (19:49 +0000)]
Fix <rdar://problem/6316324> [sema] spurious warning on comparison of qualified id.

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

16 years agoUpdated checker build.
Ted Kremenek [Mon, 17 Nov 2008 19:26:13 +0000 (19:26 +0000)]
Updated checker build.

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

16 years agoTest case for objective-c's @synchronized statement.
Fariborz Jahanian [Mon, 17 Nov 2008 18:03:28 +0000 (18:03 +0000)]
Test case for objective-c's @synchronized statement.

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

16 years agoAdd TODO item for adding more source-range information to declarators
Douglas Gregor [Mon, 17 Nov 2008 17:14:10 +0000 (17:14 +0000)]
Add TODO item for adding more source-range information to declarators

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

16 years agoFix <rdar://problem/6320086> parser rejects block capturing ivar.
Steve Naroff [Mon, 17 Nov 2008 16:28:52 +0000 (16:28 +0000)]
Fix <rdar://problem/6320086> parser rejects block capturing ivar.

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

16 years agoSome cleanups for C++ operator overloading
Douglas Gregor [Mon, 17 Nov 2008 16:14:12 +0000 (16:14 +0000)]
Some cleanups for C++ operator overloading

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

16 years agoSimplify error messages for two-parameter overloaded increment/decrement operators
Douglas Gregor [Mon, 17 Nov 2008 15:03:30 +0000 (15:03 +0000)]
Simplify error messages for two-parameter overloaded increment/decrement operators

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

16 years agoIntroduction the DeclarationName class, as a single, general method of
Douglas Gregor [Mon, 17 Nov 2008 14:58:09 +0000 (14:58 +0000)]
Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.

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

16 years agopad header out to 80 cols
Chris Lattner [Mon, 17 Nov 2008 04:06:37 +0000 (04:06 +0000)]
pad header out to 80 cols

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

16 years agoadd OperatorKinds.* to the project.
Chris Lattner [Mon, 17 Nov 2008 04:05:52 +0000 (04:05 +0000)]
add OperatorKinds.* to the project.

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

16 years agoline up some columns, no functionality change.
Chris Lattner [Mon, 17 Nov 2008 04:03:07 +0000 (04:03 +0000)]
line up some columns, no functionality change.

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

16 years agoA few corrections to the expr constant work. Not enabled at the
Eli Friedman [Mon, 17 Nov 2008 03:57:28 +0000 (03:57 +0000)]
A few corrections to the expr constant work. Not enabled at the
moment.

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

16 years agoMore expr constant work. (Off by default).
Anders Carlsson [Mon, 17 Nov 2008 01:58:55 +0000 (01:58 +0000)]
More expr constant work. (Off by default).

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

16 years agoAddress some comments Eli had.
Anders Carlsson [Sun, 16 Nov 2008 22:46:56 +0000 (22:46 +0000)]
Address some comments Eli had.

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

16 years agouse HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)
Nuno Lopes [Sun, 16 Nov 2008 22:06:39 +0000 (22:06 +0000)]
use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)

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

16 years agoMore complex float evaluator support.
Anders Carlsson [Sun, 16 Nov 2008 21:51:21 +0000 (21:51 +0000)]
More complex float evaluator support.

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

16 years agoDescribe how constant folding and i-c-e diagnosing should work.
Chris Lattner [Sun, 16 Nov 2008 21:48:07 +0000 (21:48 +0000)]
Describe how constant folding and i-c-e diagnosing should work.
Unfortunately, we're not here yet, but eventually Expr::isConstantExpr
and friends should go away.

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

16 years agorename Expr::tryEvaluate to Expr::Evaluate.
Chris Lattner [Sun, 16 Nov 2008 21:24:15 +0000 (21:24 +0000)]
rename Expr::tryEvaluate to Expr::Evaluate.

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

16 years agoAdd very limited support for evaluating complex floats.
Anders Carlsson [Sun, 16 Nov 2008 20:27:53 +0000 (20:27 +0000)]
Add very limited support for evaluating complex floats.

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

16 years agoTrivial tidying
Chris Lattner [Sun, 16 Nov 2008 20:22:05 +0000 (20:22 +0000)]
Trivial tidying

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

16 years agoadd PTHLexer.h to project
Chris Lattner [Sun, 16 Nov 2008 20:18:49 +0000 (20:18 +0000)]
add PTHLexer.h to project

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

16 years agofix folding of comma if given a non-constant operand.
Nuno Lopes [Sun, 16 Nov 2008 20:09:07 +0000 (20:09 +0000)]
fix folding of comma if given a non-constant operand.
Eli please take a look, as I'm not sure if this gets the extension warning in the right place

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

16 years agomake IntExprEvaluator fold the ?: operator
Nuno Lopes [Sun, 16 Nov 2008 19:28:31 +0000 (19:28 +0000)]
make IntExprEvaluator fold the ?: operator

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

16 years agoMore work on the constant evaluator. Eli, it would be great if you could have a look...
Anders Carlsson [Sun, 16 Nov 2008 19:01:22 +0000 (19:01 +0000)]
More work on the constant evaluator. Eli, it would be great if you could have a look at this.

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

16 years agoFix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.
Chris Lattner [Sun, 16 Nov 2008 18:43:46 +0000 (18:43 +0000)]
Fix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.

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

16 years agoFix PR3077: tokens that come from macro expansions whose macro was
Chris Lattner [Sun, 16 Nov 2008 18:36:34 +0000 (18:36 +0000)]
Fix PR3077: tokens that come from macro expansions whose macro was
defined in a system header should be treated as system header tokens
even if they are instantiated in a different place.

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

16 years agoadd targe triple commandline option to fix test failure on Linux.
Zhongxing Xu [Sun, 16 Nov 2008 09:17:52 +0000 (09:17 +0000)]
add targe triple commandline option to fix test failure on Linux.

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

16 years agoadd dump and print methods, add operator<< for APValue.
Chris Lattner [Sun, 16 Nov 2008 07:46:48 +0000 (07:46 +0000)]
add dump and print methods, add operator<< for APValue.

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

16 years agomove some APValue methods out of line.
Chris Lattner [Sun, 16 Nov 2008 07:35:53 +0000 (07:35 +0000)]
move some APValue methods out of line.

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

16 years agoAdd the ability to evaluate comparison operators with floating point numbers as operands.
Anders Carlsson [Sun, 16 Nov 2008 07:17:21 +0000 (07:17 +0000)]
Add the ability to evaluate comparison operators with floating point numbers as operands.

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

16 years agoEnhance modularization: return a <state,loc> pair to let GRExprEngine modify the
Zhongxing Xu [Sun, 16 Nov 2008 07:06:26 +0000 (07:06 +0000)]
Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the
environment.

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

16 years agoMore constant expr work.
Anders Carlsson [Sun, 16 Nov 2008 06:23:45 +0000 (06:23 +0000)]
More constant expr work.

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

16 years agodaniel prefers completed thoughts.
Chris Lattner [Sun, 16 Nov 2008 06:16:27 +0000 (06:16 +0000)]
daniel prefers completed thoughts.

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

16 years agoRe-enable array-struct test.
Zhongxing Xu [Sun, 16 Nov 2008 04:47:39 +0000 (04:47 +0000)]
Re-enable array-struct test.

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

16 years agoEnhances SCA to process untyped region to typed region conversion.
Zhongxing Xu [Sun, 16 Nov 2008 04:07:26 +0000 (04:07 +0000)]
Enhances SCA to process untyped region to typed region conversion.
 - RegionView and RegionViewMap is introduced to assist back-mapping from
   super region to subregions.
 - GDM is used to carry RegionView information.
 - AnonTypedRegion is added to represent a typed region introduced by pointer
   casting. Later AnonTypedRegion can be used in other similar cases, e.g.,
   malloc()'ed region.
 - The specific conversion is delegated to store manager.

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

16 years agoStart implementing support for @synchonized with the darwin ObjC API.
Chris Lattner [Sat, 15 Nov 2008 21:26:17 +0000 (21:26 +0000)]
Start implementing support for @synchonized with the darwin ObjC API.

Patch by Fariborz!

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

16 years agoCheck in code that uses tryEvaluate for emitting constant exprs (not used yet).
Anders Carlsson [Sat, 15 Nov 2008 20:45:50 +0000 (20:45 +0000)]
Check in code that uses tryEvaluate for emitting constant exprs (not used yet).

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

16 years agoHandle padding in the constant CFString struct. Fixes PR3046.
Anders Carlsson [Sat, 15 Nov 2008 18:54:24 +0000 (18:54 +0000)]
Handle padding in the constant CFString struct. Fixes PR3046.

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

16 years agoUse IgnoreParenCasts. No functionality change.
Anders Carlsson [Sat, 15 Nov 2008 18:52:06 +0000 (18:52 +0000)]
Use IgnoreParenCasts. No functionality change.

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

16 years agoUse the allocator of ExplodedGraph. The whole static analysis module uses it.
Zhongxing Xu [Sat, 15 Nov 2008 08:19:58 +0000 (08:19 +0000)]
Use the allocator of ExplodedGraph. The whole static analysis module uses it.

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

16 years agoFix silly bug spotted by Daniel Dunbar
Anders Carlsson [Sat, 15 Nov 2008 06:35:36 +0000 (06:35 +0000)]
Fix silly bug spotted by Daniel Dunbar

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

16 years agoImprove zero value generation.
Zhongxing Xu [Sat, 15 Nov 2008 05:18:50 +0000 (05:18 +0000)]
Improve zero value generation.

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

16 years agoAdd isUnsigned option.
Zhongxing Xu [Sat, 15 Nov 2008 05:17:04 +0000 (05:17 +0000)]
Add isUnsigned option.

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

16 years agoReduce permissiveness of assertion.
Ted Kremenek [Sat, 15 Nov 2008 05:00:27 +0000 (05:00 +0000)]
Reduce permissiveness of assertion.

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

16 years agoUpdated checker build.
Ted Kremenek [Sat, 15 Nov 2008 04:57:19 +0000 (04:57 +0000)]
Updated checker build.

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

16 years agoAdd a test case for compound assignments that lazily symbolicate the value of the...
Ted Kremenek [Sat, 15 Nov 2008 04:44:13 +0000 (04:44 +0000)]
Add a test case for compound assignments that lazily symbolicate the value of the LHS when the computation type is an integer of more bits.

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

16 years agoReverted part of r59335: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon...
Ted Kremenek [Sat, 15 Nov 2008 04:01:56 +0000 (04:01 +0000)]
Reverted part of r59335: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20081110/009243.html
In that patch I added a bogus type promotion for unary '!'.

The real bug was more fallout from edges cases with compound assignments and conjured symbolic values.  Now the conjured value has the type of the LHS expression, and we do a promotion to the computation type.  We also now correctly do a conversion from the computation type back to the LHS type.

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

16 years agoRe-enable an assertion that I mistakenly removed.
Ted Kremenek [Sat, 15 Nov 2008 02:35:08 +0000 (02:35 +0000)]
Re-enable an assertion that I mistakenly removed.

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

16 years agoHandle complex return values.
Anders Carlsson [Sat, 15 Nov 2008 01:29:05 +0000 (01:29 +0000)]
Handle complex return values.

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

16 years agoUse the correct QualType when creating the '0' constant.
Ted Kremenek [Sat, 15 Nov 2008 00:40:08 +0000 (00:40 +0000)]
Use the correct QualType when creating the '0' constant.

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

16 years agoImplement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit conversions...
Ted Kremenek [Sat, 15 Nov 2008 00:20:05 +0000 (00:20 +0000)]
Implement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit conversions caused by the '!' operator.  This required adding some logic to GRSimpleVals to reason about nonloc::LocAsInteger SVals.  This code appears to work fine, but it should eventually be cleaned up.

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

16 years agoFlush llvm::errs() when printing out SVals.
Ted Kremenek [Sat, 15 Nov 2008 00:16:53 +0000 (00:16 +0000)]
Flush llvm::errs() when printing out SVals.

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

16 years agoAdd handy method.
Zhongxing Xu [Fri, 14 Nov 2008 23:49:15 +0000 (23:49 +0000)]
Add handy method.

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

16 years agoImplement parsing and semantic checking of the 'mutable' keyword.
Sebastian Redl [Fri, 14 Nov 2008 23:42:31 +0000 (23:42 +0000)]
Implement parsing and semantic checking of the 'mutable' keyword.
Thanks to Doug for the review. Actual effects of mutable to follow.

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

16 years agoUse ReadPtr, not ReadUIntPtr through a reinterpret_cast.
Argyrios Kyrtzidis [Fri, 14 Nov 2008 23:32:45 +0000 (23:32 +0000)]
Use ReadPtr, not ReadUIntPtr through a reinterpret_cast.
Thanks to Sebastian for the suggestion.

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

16 years agoRemove Parser::isTokenUnqualifiedId, it's not getting used anywhere.
Argyrios Kyrtzidis [Fri, 14 Nov 2008 21:41:24 +0000 (21:41 +0000)]
Remove Parser::isTokenUnqualifiedId, it's not getting used anywhere.

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

16 years agoFix <rdar://problem/6372970> clang ObjC rewriter: incorrect cast when passing block...
Steve Naroff [Fri, 14 Nov 2008 21:36:12 +0000 (21:36 +0000)]
Fix <rdar://problem/6372970> clang ObjC rewriter: incorrect cast when passing block argument

SynthBlockInitExpr() was not adding by-ref arguments to the init expr.

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

16 years agoMinor tweaks to liveness analysis:
Ted Kremenek [Fri, 14 Nov 2008 21:07:14 +0000 (21:07 +0000)]
Minor tweaks to liveness analysis:
- Block-expression for 'ObjCForCollectionStmt' is not alive before it occurs
- Recursively visit 'element' expression for ObjCForCollectionStmt to get liveness for referenced block-level expressions and variables.

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

16 years agoSecond attempt at implementation transfer function support for ObjCForCollectionStmt...
Ted Kremenek [Fri, 14 Nov 2008 19:47:18 +0000 (19:47 +0000)]
Second attempt at implementation transfer function support for ObjCForCollectionStmt.  We now assume that the 'element' expression can be any lvalue.

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

16 years agoFlow-sensitive uninitialized values analysis: properly handle the 'element' expressio...
Ted Kremenek [Fri, 14 Nov 2008 18:21:25 +0000 (18:21 +0000)]
Flow-sensitive uninitialized values analysis: properly handle the 'element' expression of ObjCForCollectionStmt (can be anything).

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

16 years agoAdd a new expression node, CXXOperatorCallExpr, which expresses a
Douglas Gregor [Fri, 14 Nov 2008 16:09:21 +0000 (16:09 +0000)]
Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.

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

16 years agoFix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS
Steve Naroff [Fri, 14 Nov 2008 14:10:01 +0000 (14:10 +0000)]
Fix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS

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

16 years agoDon't require us to manually number the statements and expressions in StmtNodes.def...
Douglas Gregor [Fri, 14 Nov 2008 12:46:07 +0000 (12:46 +0000)]
Don't require us to manually number the statements and expressions in StmtNodes.def. We don't need stable numbers yet, renumbering is a pain, and LAST_STMT had the wrong value anyway.

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

16 years agoImprove comments.
Zhongxing Xu [Fri, 14 Nov 2008 09:23:38 +0000 (09:23 +0000)]
Improve comments.

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

16 years agoHandle the case where 'element' in ObjCforCollectionstmt is not a DeclStmt or DeclRef...
Ted Kremenek [Fri, 14 Nov 2008 01:58:12 +0000 (01:58 +0000)]
Handle the case where 'element' in ObjCforCollectionstmt is not a DeclStmt or DeclRefExpr.

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

16 years agoFix CFG construction for ObjCForCollectionStmt: 'element' expression can be anything...
Ted Kremenek [Fri, 14 Nov 2008 01:57:41 +0000 (01:57 +0000)]
Fix CFG construction for ObjCForCollectionStmt: 'element' expression can be anything that evaluates to an lvalue

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

16 years agoUpdate Xcode project.
Ted Kremenek [Fri, 14 Nov 2008 01:16:15 +0000 (01:16 +0000)]
Update Xcode project.

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

16 years agoRename header file.
Ted Kremenek [Fri, 14 Nov 2008 01:14:18 +0000 (01:14 +0000)]
Rename header file.
Update include files.

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

16 years agoRename ExprDeclBitVector to BlkExprDeclBitVector, and store mappings from Stmt* to...
Ted Kremenek [Fri, 14 Nov 2008 01:13:07 +0000 (01:13 +0000)]
Rename ExprDeclBitVector to BlkExprDeclBitVector, and store mappings from Stmt* to bit indices instead using Expr*.

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

16 years agoFix some validation errors.
Daniel Dunbar [Thu, 13 Nov 2008 23:01:34 +0000 (23:01 +0000)]
Fix some validation errors.

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

16 years agoStart a "hacking" page with some simple notes on getting started
Daniel Dunbar [Thu, 13 Nov 2008 22:49:41 +0000 (22:49 +0000)]
Start a "hacking" page with some simple notes on getting started
developing clang.

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

16 years agoAdd file to VC++ project.
Steve Naroff [Thu, 13 Nov 2008 21:16:53 +0000 (21:16 +0000)]
Add file to VC++ project.

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

16 years agoSome cleanup for the implementation of built-in operator
Douglas Gregor [Thu, 13 Nov 2008 20:12:29 +0000 (20:12 +0000)]
Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!

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

16 years agoFix an obscure rewriter bug when rewriting implementations that don't have a correspo...
Steve Naroff [Thu, 13 Nov 2008 20:07:04 +0000 (20:07 +0000)]
Fix an obscure rewriter bug when rewriting implementations that don't have a corresponding interface (found while doing random testing on another bug).

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

16 years agoFix a couple of suboptimalities in error recovery.
Chris Lattner [Thu, 13 Nov 2008 18:52:53 +0000 (18:52 +0000)]
Fix a couple of suboptimalities in error recovery.

1. In the top level of ParseStatementOrDeclaration, don't eat a } if we
   just parsed a statement if it list there.  Also, don't even bother
   emitting an error about a missing semicolon if the statement had a
   bug (an rbrace is fine).
2. In do/while parsing, don't require a 'while' to be present if the do
   body didn't parse.

This allows us to generate a clean diagnostic for this code:

t.c:1:22: error: expected expression
void foo (void) { do . while (0); }
                     ^

Thanks to Neil for pointing this out.

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

16 years agodon't highlight field name, just put a caret on it.
Chris Lattner [Thu, 13 Nov 2008 18:49:38 +0000 (18:49 +0000)]
don't highlight field name, just put a caret on it.

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

16 years agodisable these two tests, they crash and take a long time to run crashreporter etc.
Chris Lattner [Thu, 13 Nov 2008 18:45:47 +0000 (18:45 +0000)]
disable these two tests, they crash and take a long time to run crashreporter etc.

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

16 years agoimplement a fixme :), switch to -verify mode.
Chris Lattner [Thu, 13 Nov 2008 18:42:17 +0000 (18:42 +0000)]
implement a fixme :), switch to -verify mode.

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

16 years agoFix <rdar://problem/6343942> clang ObjC rewriter: crash rewriting blocks
Steve Naroff [Thu, 13 Nov 2008 17:40:07 +0000 (17:40 +0000)]
Fix <rdar://problem/6343942> clang ObjC rewriter: crash rewriting blocks
and <rdar://problem/6344601> clang ObjC rewriter: crash passing Block parameter?

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

16 years agoUsing llvm::OwningPtr<> for CurLexer and CurTokenLexer. This makes both the ownershi...
Ted Kremenek [Thu, 13 Nov 2008 17:11:24 +0000 (17:11 +0000)]
Using llvm::OwningPtr<> for CurLexer and CurTokenLexer.  This makes both the ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed).

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

16 years agoUse PushIncludeMacroStack/PopMacroStack instead of manually pushing/popping from...
Ted Kremenek [Thu, 13 Nov 2008 16:51:03 +0000 (16:51 +0000)]
Use PushIncludeMacroStack/PopMacroStack instead of manually pushing/popping from IncludeMacroStack.  This is both cleaner and makes the include stack transparently extensible.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Thu, 13 Nov 2008 16:36:43 +0000 (16:36 +0000)]
Update Xcode project.

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

16 years ago- Revert r59229 and r59232: AllocRegion should be immutable.
Ted Kremenek [Thu, 13 Nov 2008 15:42:31 +0000 (15:42 +0000)]
- Revert r59229 and r59232: AllocRegion should be immutable.
- Temporarily disabled test Analysis/array-struct.c for region store.

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

16 years agoProcess array base expression of any type.
Zhongxing Xu [Thu, 13 Nov 2008 09:48:44 +0000 (09:48 +0000)]
Process array base expression of any type.

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

16 years agoAdd test for unsigned array index.
Zhongxing Xu [Thu, 13 Nov 2008 09:20:05 +0000 (09:20 +0000)]
Add test for unsigned array index.

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

16 years agoArray index might be unsigned. We have to generate a temporary signed value for
Zhongxing Xu [Thu, 13 Nov 2008 09:15:14 +0000 (09:15 +0000)]
Array index might be unsigned. We have to generate a temporary signed value for
it to be evaluated by APSInt::operators.

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

16 years agoAdd test for incomplete struct pointer.
Zhongxing Xu [Thu, 13 Nov 2008 08:44:52 +0000 (08:44 +0000)]
Add test for incomplete struct pointer.

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

16 years agoIncomplete struct pointer can be used as a function argument.
Zhongxing Xu [Thu, 13 Nov 2008 08:41:36 +0000 (08:41 +0000)]
Incomplete struct pointer can be used as a function argument.

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

16 years agoAdd a test case for alloca().
Zhongxing Xu [Thu, 13 Nov 2008 07:59:15 +0000 (07:59 +0000)]
Add a test case for alloca().

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