Commit Graph

48626 Commits

Author SHA1 Message Date
Ted Kremenek db7f2a74db Explicitly access the first Decl* referenced by a DeclStmt instead of using "getDecl()." Added a FIXME indicating that the call to RewriteObjCQualifiedInterfaceTypes() is meant to modifying the type-specifier; hopefully this will be a little more clean once DeclGroups contain type specifiers.
llvm-svn: 57216
2008-10-06 22:45:07 +00:00
Ted Kremenek 5b6f8ee7b9 Use "DeclStmt::getSolitaryDecl()" when accessing the DeclStmt of an @catch.
llvm-svn: 57215
2008-10-06 22:39:38 +00:00
Ted Kremenek 6d60a4ec19 Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.
llvm-svn: 57213
2008-10-06 22:17:16 +00:00
Ted Kremenek 292b3842a0 Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when rewriting Objective-c foreach statements.
llvm-svn: 57212
2008-10-06 22:16:13 +00:00
Devang Patel 3cda64abd4 Set UNIVERSAL_ARCH value.
Fixes build failure when target is i386.

llvm-svn: 57211
2008-10-06 21:24:48 +00:00
Evan Cheng 94d14f2d45 Fix PR2850 and PR2863. Only generate movddup for 128-bit SSE vector shuffles.
llvm-svn: 57210
2008-10-06 21:13:08 +00:00
Ted Kremenek 3fef35736e Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of an Objective-C foreach statement.
llvm-svn: 57209
2008-10-06 20:59:48 +00:00
Ted Kremenek a7297be859 Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of a @catch statement.
llvm-svn: 57208
2008-10-06 20:58:56 +00:00
Ted Kremenek 11b004216c When processing Objective-C foreach statements, first check to see if the statement has a DeclStmt with a single Decl. Afterwards, use DeclStmt::getSolitaryDecl() to access that Decl (thus avoiding an assertion being triggered). These changes remove an unneeded use of ScopedDecl::getNextDeclarator() and DeclStmt::getDecl().
llvm-svn: 57207
2008-10-06 20:58:11 +00:00
Ted Kremenek ef52c641e7 Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ScopedDecl chain.
llvm-svn: 57206
2008-10-06 20:56:19 +00:00
Ted Kremenek a86db10563 Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.
This patch precedes removing getDecl() DeclStmt::entirely.

llvm-svn: 57205
2008-10-06 20:55:44 +00:00
Ted Kremenek acf920dd39 Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()
llvm-svn: 57204
2008-10-06 20:54:44 +00:00
Dale Johannesen 6271b0a83c Temporarily revert functionality change from my previous patch;
it is too aggressive.

llvm-svn: 57203
2008-10-06 20:43:48 +00:00
Devang Patel c3e3ca9a45 Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.

llvm-svn: 57202
2008-10-06 20:36:36 +00:00
Ted Kremenek 7c2d69f007 Use "unsigned" instead of "int" for i to remove a "comparison between unsigned and signed" warning (potential integer overflow).
llvm-svn: 57201
2008-10-06 20:35:04 +00:00
Evan Cheng ca2271af10 Cosmetic.
llvm-svn: 57200
2008-10-06 20:33:02 +00:00
Anders Carlsson 5f7ee680f8 Add 'x' constraint character.
llvm-svn: 57198
2008-10-06 19:17:39 +00:00
Devang Patel 7e9b05ede5 Update function attributes docs.
llvm-svn: 57197
2008-10-06 18:50:38 +00:00
Ted Kremenek dcd6632463 Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead of using DeclStmt::getDecl().
llvm-svn: 57196
2008-10-06 18:48:35 +00:00
Ted Kremenek 53532c1fda In RewriteFunctionBody, using DeclStmt::decl_iterator to rewrite the Decls in a DeclStmt instead of using getDecl() to fetch the first Decl.
Steve: Please review this patch.  'make test' passes, and my cursory scan of the rewriter leads me to believe this doesn't break anything, but I'm not sure.
llvm-svn: 57195
2008-10-06 18:47:09 +00:00
Ted Kremenek 4db44b62ad Don't use DeclStmt::getDecl(); this will eventually disappear. Just fetch the first decl using the DeclStmt::decl_iterator.
llvm-svn: 57194
2008-10-06 18:43:53 +00:00
Evan Cheng dd082cf676 This is an objective-c test, not an objective-c++ one.
llvm-svn: 57193
2008-10-06 18:42:48 +00:00
Ted Kremenek 704a2505db In EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the scoped decl chain.
llvm-svn: 57192
2008-10-06 18:42:27 +00:00
Ted Kremenek 15e6b40832 Added PrintRawDeclStmt; use this method to print out DeclStmt instead of using PrintRawDecl (which falsely assumes DeclStmts have only one Decl).
llvm-svn: 57191
2008-10-06 18:39:36 +00:00
Ted Kremenek 62408480d9 Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).
llvm-svn: 57190
2008-10-06 18:38:35 +00:00
Ted Kremenek fae8cb0736 Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon DeclStmts will wrap group of Decls.
Added FIXME.

llvm-svn: 57189
2008-10-06 18:37:46 +00:00
Argyrios Kyrtzidis 153d967d14 The current semantic process for direct initializers won't work properly for class types.
Add a FIXME until class constructors are supported.

llvm-svn: 57188
2008-10-06 18:37:09 +00:00
Ted Kremenek f8a2765fb7 Use DeclStmt::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).
llvm-svn: 57187
2008-10-06 18:36:52 +00:00
Ted Kremenek 151534a197 Add const_decl_iterator to DecStmt.
llvm-svn: 57186
2008-10-06 18:35:55 +00:00
Dale Johannesen fff2995532 Mark shortening NaN conversions as Inexact. PR 2856.
Improve description of unsupported formats.

llvm-svn: 57185
2008-10-06 18:22:29 +00:00
Devang Patel c0f3b52e65 It is possible that all functions in one module are not being
optimized for size. Set OptForSize for each function separately.

llvm-svn: 57182
2008-10-06 18:03:39 +00:00
Dan Gohman dfe979bcb0 Don't dereference the end() iterator. Thanks to
ENABLE_EXPENSIVE_CHECKS for finding this.

llvm-svn: 57181
2008-10-06 18:00:07 +00:00
Ted Kremenek c7d5d976bf Update Xcode project.
llvm-svn: 57180
2008-10-06 17:42:44 +00:00
Devang Patel ab379c905b Remove unncessary isDeclaration() checks.
llvm-svn: 57179
2008-10-06 17:30:07 +00:00
Argyrios Kyrtzidis 9a1191c047 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.

llvm-svn: 57178
2008-10-06 17:10:33 +00:00
Matthijs Kooijman cbe5e16eb5 Allow scalarrepl to treat an all-zero GEP just as bitcast.
This includes not marking a GEP involving a vector as unsafe, but only when it
has all zero indices. This allows scalarrepl to work in a few more cases.

llvm-svn: 57177
2008-10-06 16:23:31 +00:00
Ted Kremenek 3b670d1a0c Updated checker build.
llvm-svn: 57176
2008-10-06 15:46:11 +00:00
Duncan Sands bae7a517cc Actually run Obj-C++ tests if llvm-gcc supports.
Before there were two problems: (1) configure
turned "obj-c++" into "obj" in the langs line;
(2) the dejagnu library called it objc++ not
obj-c++.
Now the problem is that some of these tests don't
pass!

llvm-svn: 57167
2008-10-06 10:31:21 +00:00
Duncan Sands 2a1d8bace1 Clarify the relationship between byval and readonly/
readnone.  Make clearer that readnone functions do not
dereference pointer arguments.  Do not use the highly
ambiguous "side-effects" in the readonly description
(since such functions can have control flow side-effects,
such as throwing an exception, or looping for ever).

llvm-svn: 57166
2008-10-06 08:14:18 +00:00
Chris Lattner 25728d931a fix incorrect rdar number.
llvm-svn: 57165
2008-10-06 07:43:28 +00:00
Chris Lattner 1b0a00a4c9 __CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR
won't expand to the builtin.  This fixes rdar://6248329

llvm-svn: 57164
2008-10-06 07:43:09 +00:00
Chris Lattner a97132a9c4 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.

llvm-svn: 57163
2008-10-06 07:26:43 +00:00
Chris Lattner 2c091b1ead ExprConstant should not abort when it sees a pointer constant that isn't.
llvm-svn: 57162
2008-10-06 07:20:11 +00:00
Chris Lattner 24355b5240 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.

llvm-svn: 57161
2008-10-06 06:56:41 +00:00
Chris Lattner b7c86a211c 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.

llvm-svn: 57160
2008-10-06 06:51:12 +00:00
Chris Lattner cb13691a62 Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
which is checking for something that can be inconsistent with
what we can constant fold.

llvm-svn: 57159
2008-10-06 06:49:02 +00:00
Chris Lattner 86ee286b09 Move folding of __builtin_classify_type out of the CallExpr
interface into the constant folding interface.

llvm-svn: 57158
2008-10-06 06:40:35 +00:00
Chris Lattner 0b7282eafc Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp
llvm-svn: 57157
2008-10-06 06:31:58 +00:00
Chris Lattner a1518b1dfe 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.

llvm-svn: 57156
2008-10-06 06:09:18 +00:00
Chris Lattner e50e90142e 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'.

llvm-svn: 57155
2008-10-06 05:59:01 +00:00