]> granicus.if.org Git - clang/log
clang
15 years agoDon't use DeclStmt::getDecl(); this will eventually disappear. Just fetch the first...
Ted Kremenek [Mon, 6 Oct 2008 18:43:53 +0000 (18:43 +0000)]
Don't use DeclStmt::getDecl(); this will eventually disappear.  Just fetch the first decl using the DeclStmt::decl_iterator.

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

15 years agoIn EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the scoped...
Ted Kremenek [Mon, 6 Oct 2008 18:42:27 +0000 (18:42 +0000)]
In EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the scoped decl chain.

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

15 years agoAdded PrintRawDeclStmt; use this method to print out DeclStmt instead of using PrintR...
Ted Kremenek [Mon, 6 Oct 2008 18:39:36 +0000 (18:39 +0000)]
Added PrintRawDeclStmt; use this method to print out DeclStmt instead of using PrintRawDecl (which falsely assumes DeclStmts have only one Decl).

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

15 years agoUse Decl::decl_iterator instead of walking the ScopedDecl chain (which will soon...
Ted Kremenek [Mon, 6 Oct 2008 18:38:35 +0000 (18:38 +0000)]
Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).

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

15 years agoUse DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will...
Ted Kremenek [Mon, 6 Oct 2008 18:37:46 +0000 (18:37 +0000)]
Use DeclStmt::decl_iterator instead of using Decl::getDecl().  Soon DeclStmts will wrap group of Decls.
Added FIXME.

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

15 years agoThe current semantic process for direct initializers won't work properly for class...
Argyrios Kyrtzidis [Mon, 6 Oct 2008 18:37:09 +0000 (18:37 +0000)]
The current semantic process for direct initializers won't work properly for class types.
Add a FIXME until class constructors are supported.

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

15 years agoUse DeclStmt::decl_iterator instead of walking the ScopedDecl chain (which will soon...
Ted Kremenek [Mon, 6 Oct 2008 18:36:52 +0000 (18:36 +0000)]
Use DeclStmt::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).

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

15 years agoAdd const_decl_iterator to DecStmt.
Ted Kremenek [Mon, 6 Oct 2008 18:35:55 +0000 (18:35 +0000)]
Add const_decl_iterator to DecStmt.

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

15 years agoUpdate Xcode project.
Ted Kremenek [Mon, 6 Oct 2008 17:42:44 +0000 (17:42 +0000)]
Update Xcode project.

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

15 years agoImplement support for C++ direct initializers in declarations, e.g. "int x(1);".
Argyrios Kyrtzidis [Mon, 6 Oct 2008 17:10:33 +0000 (17:10 +0000)]
Implement support for C++ direct initializers in declarations, e.g. "int x(1);".

This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.

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

15 years agoUpdated checker build.
Ted Kremenek [Mon, 6 Oct 2008 15:46:11 +0000 (15:46 +0000)]
Updated checker build.

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

15 years agofix incorrect rdar number.
Chris Lattner [Mon, 6 Oct 2008 07:43:28 +0000 (07:43 +0000)]
fix incorrect rdar number.

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

15 years ago__CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR
Chris Lattner [Mon, 6 Oct 2008 07:43:09 +0000 (07:43 +0000)]
__CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR
won't expand to the builtin.  This fixes rdar://6248329

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

15 years agoMake sema and codegen allow __builtin___CFStringMakeConstantString as a valid
Chris Lattner [Mon, 6 Oct 2008 07:26:43 +0000 (07:26 +0000)]
Make sema and codegen allow __builtin___CFStringMakeConstantString as a valid
constant lvalue.  Implement this in codegen by moving the code out of CGBuiltin
into EmitConstantExpr.

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

15 years agoExprConstant should not abort when it sees a pointer constant that isn't.
Chris Lattner [Mon, 6 Oct 2008 07:20:11 +0000 (07:20 +0000)]
ExprConstant should not abort when it sees a pointer constant that isn't.

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

15 years agoalways try to fold a builtin before emitting it. In the future
Chris Lattner [Mon, 6 Oct 2008 06:56:41 +0000 (06:56 +0000)]
always try to fold a builtin before emitting it.  In the future
it is possible that a builtin could sometimes be folded (e.g. __builtin_clz)
if it's operand is a constant.

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

15 years agoRemove the 'C' / isConstantExpr flag on builtins. Code should never
Chris Lattner [Mon, 6 Oct 2008 06:51:12 +0000 (06:51 +0000)]
Remove the 'C' / isConstantExpr flag on builtins.  Code should never
depend on the value of this flag, it should depend on whether
tryEvaluate is able to *actually* fold a builtin.

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

15 years agoAdd a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
Chris Lattner [Mon, 6 Oct 2008 06:49:02 +0000 (06:49 +0000)]
Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
which is checking for something that can be inconsistent with
what we can constant fold.

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

15 years agoMove folding of __builtin_classify_type out of the CallExpr
Chris Lattner [Mon, 6 Oct 2008 06:40:35 +0000 (06:40 +0000)]
Move folding of __builtin_classify_type out of the CallExpr
interface into the constant folding interface.

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

15 years agoMove handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp
Chris Lattner [Mon, 6 Oct 2008 06:31:58 +0000 (06:31 +0000)]
Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp

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

15 years agoremove some code where CGBuiltin folds constants, and use tryEvaluate to
Chris Lattner [Mon, 6 Oct 2008 06:09:18 +0000 (06:09 +0000)]
remove some code where CGBuiltin folds constants, and use tryEvaluate to
do it instead.  We should still handle __builtin_nan etc, but don't yet.
This fixes incorrect evaluation of __builtin_constant_p, a FIXME.

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

15 years agoinstead of making codegen try to know about all of the builtins to generate
Chris Lattner [Mon, 6 Oct 2008 05:59:01 +0000 (05:59 +0000)]
instead of making codegen try to know about all of the builtins to generate
constants for them, just use the constant evaluator to do the job.  This
also fixes crashes on 'unknown constant builtins'.

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

15 years agoTeach FloatExprEvaluator to evaluate __builtin_huge_val and inf.
Chris Lattner [Mon, 6 Oct 2008 05:53:16 +0000 (05:53 +0000)]
Teach FloatExprEvaluator to evaluate __builtin_huge_val and inf.

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

15 years ago"Enhance" CheckArithmeticConstantExpression to accept ?: with a constant
Chris Lattner [Mon, 6 Oct 2008 05:42:39 +0000 (05:42 +0000)]
"Enhance" CheckArithmeticConstantExpression to accept ?: with a constant
condition as a constant even if the unevaluated side is a not a constant.
We don't do this when extensions are off, and we emit a warning when this
happens:

t.c:22:11: warning: expression is not a constant, but is accepted as one by GNU extensions
short t = __builtin_constant_p(5353) ? 42 : somefunc();
          ^                                 ~~~~~~~~~~

suggestions for improvement are welcome.  This is obviously horrible, but
is required for real-world code.

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

15 years agoAdd a comment that describes tryEvaluate. Make tryEvaluate fold
Chris Lattner [Mon, 6 Oct 2008 05:28:25 +0000 (05:28 +0000)]
Add a comment that describes tryEvaluate.  Make tryEvaluate fold
__builtin_constant_p properly, and add some scaffolding for
FloatExprEvaluator to eventually handle huge_val and inf.

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

15 years agoadd a new CallExpr::isBuiltinCall() method, and use it to simplify some existing
Chris Lattner [Mon, 6 Oct 2008 05:00:53 +0000 (05:00 +0000)]
add a new CallExpr::isBuiltinCall() method, and use it to simplify some existing
code.

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

15 years agoActually use the mmintrin.h header, it's good enough now.
Anders Carlsson [Mon, 6 Oct 2008 04:49:00 +0000 (04:49 +0000)]
Actually use the mmintrin.h header, it's good enough now.

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

15 years agoa more efficient test for __builtin_classify_type
Chris Lattner [Mon, 6 Oct 2008 04:48:17 +0000 (04:48 +0000)]
a more efficient test for __builtin_classify_type

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

15 years agoFix typos.
Zhongxing Xu [Mon, 6 Oct 2008 03:03:33 +0000 (03:03 +0000)]
Fix typos.

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

15 years agoApparently gcc uses pi64 for the shift intrinsics.
Anders Carlsson [Mon, 6 Oct 2008 02:07:50 +0000 (02:07 +0000)]
Apparently gcc uses pi64 for the shift intrinsics.

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

15 years agoAdd the 'y' assembler constraint.
Anders Carlsson [Mon, 6 Oct 2008 00:41:45 +0000 (00:41 +0000)]
Add the 'y' assembler constraint.

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

15 years agoAllow variadic arguments without named ones for C++, e.g. "void(...);"
Argyrios Kyrtzidis [Mon, 6 Oct 2008 00:07:55 +0000 (00:07 +0000)]
Allow variadic arguments without named ones for C++, e.g. "void(...);"

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

15 years agoImplement support for the const and pure attributes.
Anders Carlsson [Sun, 5 Oct 2008 23:32:53 +0000 (23:32 +0000)]
Implement support for the const and pure attributes.

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

15 years agoA tiny optimization; use isCXXFunctionDeclarator only when it's appropriate.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 23:15:41 +0000 (23:15 +0000)]
A tiny optimization; use isCXXFunctionDeclarator only when it's appropriate.

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

15 years agomiscellaneous cleanups
Chris Lattner [Sun, 5 Oct 2008 21:50:58 +0000 (21:50 +0000)]
miscellaneous cleanups

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

15 years agomove __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into
Chris Lattner [Sun, 5 Oct 2008 21:49:27 +0000 (21:49 +0000)]
move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into
target indep code.

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

15 years agoit helps when I save the file before testing and committing.
Chris Lattner [Sun, 5 Oct 2008 21:42:17 +0000 (21:42 +0000)]
it helps when I save the file before testing and committing.

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

15 years agosuck the rest of the FP macros out of the targets into the PP
Chris Lattner [Sun, 5 Oct 2008 21:40:58 +0000 (21:40 +0000)]
suck the rest of the FP macros out of the targets into the PP

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

15 years agoAdd some text from the C++ standard and additional ambiguity resolution tests.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 21:10:08 +0000 (21:10 +0000)]
Add some text from the C++ standard and additional ambiguity resolution tests.
No funcitonality change.

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

15 years agoSet svn:ignore on test/Parser/Output
Daniel Dunbar [Sun, 5 Oct 2008 20:41:42 +0000 (20:41 +0000)]
Set svn:ignore on test/Parser/Output

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

15 years agostart moving fp macros over
Chris Lattner [Sun, 5 Oct 2008 20:40:30 +0000 (20:40 +0000)]
start moving fp macros over

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

15 years agoAdd script for checking builtin macros verse another compiler ($CC or
Daniel Dunbar [Sun, 5 Oct 2008 20:39:30 +0000 (20:39 +0000)]
Add script for checking builtin macros verse another compiler ($CC or
gcc).

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

15 years agomove a bunch more integer sizing out of target-specific code into
Chris Lattner [Sun, 5 Oct 2008 20:06:37 +0000 (20:06 +0000)]
move a bunch more integer sizing out of target-specific code into
target indep code.

Note that this changes functionality on PIC16: it defines __INT_MAX__
correctly for it, and it changes sizeof(long) to 16-bits (to match
the size of pointer).

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

15 years agoHandle ambiguities between expressions and type-ids that occur inside parentheses...
Argyrios Kyrtzidis [Sun, 5 Oct 2008 19:56:22 +0000 (19:56 +0000)]
Handle ambiguities between expressions and type-ids that occur inside parentheses, e.g.:

sizeof(int()) -> "int()" is type-id
sizeof(int()+1) -> "int()+1" is expression.

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

15 years agoeliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start moving
Chris Lattner [Sun, 5 Oct 2008 19:44:25 +0000 (19:44 +0000)]
eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start moving
integer size #defines over to the Preprocessor.

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

15 years agogcc no longer defines __block to nothing when blocks aren't enabled.
Chris Lattner [Sun, 5 Oct 2008 19:32:52 +0000 (19:32 +0000)]
gcc no longer defines __block to nothing when blocks aren't enabled.

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

15 years agorearrange preprocessor macro definitions into language-specific
Chris Lattner [Sun, 5 Oct 2008 19:32:22 +0000 (19:32 +0000)]
rearrange preprocessor macro definitions into language-specific
then target specific.

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

15 years agoImplement PR2773, support for __USER_LABEL_PREFIX__
Chris Lattner [Sun, 5 Oct 2008 19:22:37 +0000 (19:22 +0000)]
Implement PR2773, support for __USER_LABEL_PREFIX__

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

15 years agoFix a problem reported in PR2766 that makes clang reject old versions
Chris Lattner [Sun, 5 Oct 2008 19:05:44 +0000 (19:05 +0000)]
Fix a problem reported in PR2766 that makes clang reject old versions
of GCC's headers.  This impacts people that run clang in Tiger systems.

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

15 years agoFound a subtle bug caused by an implicit enum-to-bool conversion (of the TentativePar...
Argyrios Kyrtzidis [Sun, 5 Oct 2008 18:52:21 +0000 (18:52 +0000)]
Found a subtle bug caused by an implicit enum-to-bool conversion (of the TentativeParsingResult enum).
This was the motivation of the following changes:

-'TentativeParsingResult' enum is replaced by a 'TPResult' class that basically encapsulates the enum.
-TPR_true, TPR_false, TPR_ambiguous, and TPR_error enum constants are replaced by TPResult::True(), TPResult::False(), etc. calls that return a TPResult object.
-Also fixed the subtle bug in Parser::isCXXFunctionDeclarator (caught by the above changes as a compilation error).

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

15 years agoAdd parsing of the sentinel attribute. Still need to create the attribute.
Anders Carlsson [Sun, 5 Oct 2008 18:05:59 +0000 (18:05 +0000)]
Add parsing of the sentinel attribute. Still need to create the attribute.

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

15 years agoChange indentation for a couple of files in the Xcode project.
Anders Carlsson [Sun, 5 Oct 2008 18:04:30 +0000 (18:04 +0000)]
Change indentation for a couple of files in the Xcode project.

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

15 years agoWrap long lines and other minor cleanups, no functionality change.
Chris Lattner [Sun, 5 Oct 2008 17:34:18 +0000 (17:34 +0000)]
Wrap long lines and other minor cleanups, no functionality change.

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

15 years agoRemove copyright notice, we decided not to have them.
Anders Carlsson [Sun, 5 Oct 2008 17:21:08 +0000 (17:21 +0000)]
Remove copyright notice, we decided not to have them.

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

15 years agoMove the TentativeParsingResult enum closer to where it gets used.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 17:02:44 +0000 (17:02 +0000)]
Move the TentativeParsingResult enum closer to where it gets used.
No functionality change.

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

15 years agoDisambiguate between a declaration or an expression, in the 'for-init-statement'...
Argyrios Kyrtzidis [Sun, 5 Oct 2008 15:50:46 +0000 (15:50 +0000)]
Disambiguate between a declaration or an expression, in the 'for-init-statement' part of a 'for' statement.

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

15 years agoFix Parser::isCXXConditionDeclaration to properly resolve declarations.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 15:19:49 +0000 (15:19 +0000)]
Fix Parser::isCXXConditionDeclaration to properly resolve declarations.

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

15 years agoDisambiguate between a declaration or expression for the 'condition' part of a if...
Argyrios Kyrtzidis [Sun, 5 Oct 2008 15:03:47 +0000 (15:03 +0000)]
Disambiguate between a declaration or expression for the 'condition' part of a if/switch/while/for statement.

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

15 years agoConsider GNU attributes when doing ambiguity resolution.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 14:27:18 +0000 (14:27 +0000)]
Consider GNU attributes when doing ambiguity resolution.

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

15 years agoRemove redundant parameter and rename StMgr to StateMgr.
Zhongxing Xu [Sun, 5 Oct 2008 12:12:48 +0000 (12:12 +0000)]
Remove redundant parameter and rename StMgr to StateMgr.

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

15 years agoAdd X86 builtin code generation test case.
Daniel Dunbar [Sun, 5 Oct 2008 06:38:36 +0000 (06:38 +0000)]
Add X86 builtin code generation test case.

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

15 years agoImprove C language testing coverage.
Daniel Dunbar [Sun, 5 Oct 2008 06:36:33 +0000 (06:36 +0000)]
Improve C language testing coverage.

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

15 years agoFix X86 palignr[128] builtins to match LLVM.
Daniel Dunbar [Sun, 5 Oct 2008 06:35:41 +0000 (06:35 +0000)]
Fix X86 palignr[128] builtins to match LLVM.

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

15 years agoAdd some builtins to codegen test case.
Daniel Dunbar [Sun, 5 Oct 2008 06:34:45 +0000 (06:34 +0000)]
Add some builtins to codegen test case.

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

15 years agoMake VectorType printing less broken.
Daniel Dunbar [Sun, 5 Oct 2008 05:43:11 +0000 (05:43 +0000)]
Make VectorType printing less broken.
 - Print size as number of elements times "sizeof(elt type)", not
   perfect but better than just printing the completely wrong type.

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

15 years agoFix another X86 builtin definitions.
Daniel Dunbar [Sun, 5 Oct 2008 05:21:00 +0000 (05:21 +0000)]
Fix another X86 builtin definitions.
 - vec_set_v4hi had "v4s" in place of "V4s"

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

15 years agoFix some X86 builtin definitions.
Daniel Dunbar [Sun, 5 Oct 2008 05:14:37 +0000 (05:14 +0000)]
Fix some X86 builtin definitions.
 - cmp instructions return int
 - storedqu had bad const qualifier
 - pmuldq128 used invalid type code

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

15 years agoAdd -rewrite-macros test case.
Daniel Dunbar [Sun, 5 Oct 2008 01:39:04 +0000 (01:39 +0000)]
Add -rewrite-macros test case.

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

15 years agoAllow -verify to be used with -rewrite-macros.
Daniel Dunbar [Sun, 5 Oct 2008 01:38:39 +0000 (01:38 +0000)]
Allow -verify to be used with -rewrite-macros.

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

15 years agoCoverage test for targets.
Daniel Dunbar [Sun, 5 Oct 2008 01:04:25 +0000 (01:04 +0000)]
Coverage test for targets.
 - This pushes us over 80% coverage of executable LOC.

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

15 years agoUpdate VC++ project file
Steve Naroff [Sun, 5 Oct 2008 00:52:59 +0000 (00:52 +0000)]
Update VC++ project file

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

15 years agoImprove codegen coverage tests.
Daniel Dunbar [Sun, 5 Oct 2008 00:31:54 +0000 (00:31 +0000)]
Improve codegen coverage tests.
 - Hit debug info generation.
 - Hit both ObjC runtimes.

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

15 years agoAdd dummy -ast-dump support for ObjC category implementations.
Daniel Dunbar [Sun, 5 Oct 2008 00:31:15 +0000 (00:31 +0000)]
Add dummy -ast-dump support for ObjC category implementations.

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

15 years agoRemove old diag that alerted the user to a limitation we no longer have:-)
Steve Naroff [Sun, 5 Oct 2008 00:12:46 +0000 (00:12 +0000)]
Remove old diag that alerted the user to a limitation we no longer have:-)

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

15 years agoAppend the test runs with '&&'.
Argyrios Kyrtzidis [Sun, 5 Oct 2008 00:08:56 +0000 (00:08 +0000)]
Append the test runs with '&&'.

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

15 years agoResolve ambiguous C++ statements (C++ 6.8p1).
Argyrios Kyrtzidis [Sun, 5 Oct 2008 00:06:24 +0000 (00:06 +0000)]
Resolve ambiguous C++ statements (C++ 6.8p1).
'ParseTentative.cpp' implements the functionality needed to resolve ambiguous C++ statements, to either a declaration or an expression, by "tentatively parsing" them.

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

15 years agoCreate a function, eliminating some redundancy between SynthesizeBlockInitExpr()...
Steve Naroff [Sun, 5 Oct 2008 00:06:12 +0000 (00:06 +0000)]
Create a function, eliminating some redundancy between SynthesizeBlockInitExpr() and SynthesizeBlockLiterals().

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

15 years agoFinish implementing copy/dispose helpers for imported block decls.
Steve Naroff [Sat, 4 Oct 2008 23:47:37 +0000 (23:47 +0000)]
Finish implementing copy/dispose helpers for imported block decls.

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

15 years agoAdd coverage tests of C and Obj-C language features.
Daniel Dunbar [Sat, 4 Oct 2008 23:47:28 +0000 (23:47 +0000)]
Add coverage tests of C and Obj-C language features.
 - AST printing, dumping, serialization, codegen.
 - HTML printing.
 - Parser callbacks.

Several of these are XFAIL because they trigger unimplemented code.

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

15 years agoSet exit code properly on "Unexpected program action".
Daniel Dunbar [Sat, 4 Oct 2008 23:42:49 +0000 (23:42 +0000)]
Set exit code properly on "Unexpected program action".

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

15 years agoDesensitize env-include-paths.c to the directory it is running in.
Daniel Dunbar [Sat, 4 Oct 2008 21:05:04 +0000 (21:05 +0000)]
Desensitize env-include-paths.c to the directory it is running in.
 - It would probably be better if TestRunner.sh canonicalized this.

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

15 years agoSet svn:ignore on test/{Driver,Coverage}
Daniel Dunbar [Sat, 4 Oct 2008 21:00:40 +0000 (21:00 +0000)]
Set svn:ignore on test/{Driver,Coverage}

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

15 years agoBug fix, CPATH="" does not add '.' to search path.
Daniel Dunbar [Sat, 4 Oct 2008 20:58:18 +0000 (20:58 +0000)]
Bug fix, CPATH="" does not add '.' to search path.

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

15 years agoAdd test/Driver.
Daniel Dunbar [Sat, 4 Oct 2008 20:46:41 +0000 (20:46 +0000)]
Add test/Driver.
 - env-include-paths.c is XFAIL as it exposed a bug.

Add test/Coverage.
 - For tests which achieve code coverage but don't validate anything.

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

15 years agoDe-XFAIL test/Parser/pragma-pack.c
Daniel Dunbar [Sat, 4 Oct 2008 19:45:56 +0000 (19:45 +0000)]
De-XFAIL test/Parser/pragma-pack.c

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

15 years agoswitch to using -verify
Chris Lattner [Sat, 4 Oct 2008 19:43:25 +0000 (19:43 +0000)]
switch to using -verify

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

15 years agoMove the expected-warning lines to a place that clang -verify will pick them
Chris Lattner [Sat, 4 Oct 2008 19:38:15 +0000 (19:38 +0000)]
Move the expected-warning lines to a place that clang -verify will pick them
up.  Speculatularly hacktastic, but strangely beautiful?
Daniel, lines 20/21 are rejected, please investigate.

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

15 years agoAdd Parser support for #pragma pack
Daniel Dunbar [Sat, 4 Oct 2008 19:21:03 +0000 (19:21 +0000)]
Add Parser support for #pragma pack
 - Uses Action::ActOnPragmaPack
 - Test case is XFAIL pending verifier fixes.

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

15 years agoAdd Preprocessor::RemovePragmaHandler.
Daniel Dunbar [Sat, 4 Oct 2008 19:17:46 +0000 (19:17 +0000)]
Add Preprocessor::RemovePragmaHandler.
 - No functionality change.

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

15 years agoAdd indirection required for byref BlockDeclRefExpr's.
Steve Naroff [Sat, 4 Oct 2008 18:52:47 +0000 (18:52 +0000)]
Add indirection required for byref BlockDeclRefExpr's.

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

15 years agoHandle bookkeeping for imported blocks (in SynthesizeBlockImpl).
Steve Naroff [Sat, 4 Oct 2008 18:00:11 +0000 (18:00 +0000)]
Handle bookkeeping for imported blocks (in SynthesizeBlockImpl).
This code was "lost" with my recent changes to SynthesizeBlockFunc.

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

15 years agoAdd MemRegion.cpp to VS project.
Ted Kremenek [Sat, 4 Oct 2008 17:55:52 +0000 (17:55 +0000)]
Add MemRegion.cpp to VS project.

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

15 years agoCut/paste error...need to use the expression "name" for member references (or other...
Steve Naroff [Sat, 4 Oct 2008 17:45:51 +0000 (17:45 +0000)]
Cut/paste error...need to use the expression "name" for member references (or other complex expressions that can embed a block pointer type)

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

15 years agoClear the map that associated the rewritten block with it's corresponding BlockExpr.
Steve Naroff [Sat, 4 Oct 2008 17:10:02 +0000 (17:10 +0000)]
Clear the map that associated the rewritten block with it's corresponding BlockExpr.

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

15 years agoMoved main control flow functions to bottom of file.
Steve Naroff [Sat, 4 Oct 2008 17:06:23 +0000 (17:06 +0000)]
Moved main control flow functions to bottom of file.
Reworked control flow to:
- rewrite the block expr body "in place".
- used Chris's new rewriter hook "getRewritenText" to "lift" the text for later use.
- finally, we do the block expr text replacement.

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

15 years agoUpdated checker build.
Ted Kremenek [Sat, 4 Oct 2008 06:53:56 +0000 (06:53 +0000)]
Updated checker build.

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

15 years agoThis is a big patch, but the functionality change is small and the rest of the patch...
Ted Kremenek [Sat, 4 Oct 2008 05:50:14 +0000 (05:50 +0000)]
This is a big patch, but the functionality change is small and the rest of the patch consists of deltas due to API changes.

This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h.  This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses.  This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on.

The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls.  In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal.  Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables.

There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized.

The memory region abstraction also allows type-information to literally be affixed to a memory region.  This will allow the some now redundant logic to be removed from the retain/release checker.

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

15 years agoReverse the RHSBlock of LogicalOp && and ||
Zhongxing Xu [Sat, 4 Oct 2008 05:48:38 +0000 (05:48 +0000)]
Reverse the RHSBlock of LogicalOp && and ||

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

15 years agoadd a disclaimer
Chris Lattner [Fri, 3 Oct 2008 23:31:37 +0000 (23:31 +0000)]
add a disclaimer

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

15 years agoadd a new Rewriter::getRewritenText method that returns the text for a range
Chris Lattner [Fri, 3 Oct 2008 23:31:16 +0000 (23:31 +0000)]
add a new Rewriter::getRewritenText method that returns the text for a range
that includes any edits in the range.

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