Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Use getCustomDiagID() instead of specifying the diagnostic in the ↵ | Argyrios Kyrtzidis | 2008-10-06 | 1 | -2/+4 | |
| | | | | | | 'DiagnosticKinds.def' file. llvm-svn: 57220 | |||||
* | Simplify handling of direct initializers by letting ↵ | Argyrios Kyrtzidis | 2008-10-06 | 1 | -17/+12 | |
| | | | | | | | | | | | | Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr. Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization. In the case of "int x( expression );": -The Init expression of VarDecl 'x' will be the expression inside the parentheses. -VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;". llvm-svn: 57219 | |||||
* | Modified DeclGroupRef to always load/store the internal pointer value as ↵ | Ted Kremenek | 2008-10-06 | 1 | -6/+7 | |
| | | | | | | Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues. llvm-svn: 57213 | |||||
* | Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵ | Ted Kremenek | 2008-10-06 | 1 | -3/+3 | |
| | | | | | | processing the Decl of an Objective-C foreach statement. llvm-svn: 57209 | |||||
* | Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵ | Ted Kremenek | 2008-10-06 | 1 | -1/+1 | |
| | | | | | | processing the Decl of a @catch statement. llvm-svn: 57208 | |||||
* | When processing Objective-C foreach statements, first check to see if the ↵ | Ted Kremenek | 2008-10-06 | 1 | -4/+6 | |
| | | | | | | 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 | |||||
* | Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ↵ | Ted Kremenek | 2008-10-06 | 1 | -8/+12 | |
| | | | | | | ScopedDecl chain. llvm-svn: 57206 | |||||
* | Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly. | Ted Kremenek | 2008-10-06 | 1 | -1/+1 | |
| | | | | | | This patch precedes removing getDecl() DeclStmt::entirely. llvm-svn: 57205 | |||||
* | Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl() | Ted Kremenek | 2008-10-06 | 1 | -1/+5 | |
| | | | | llvm-svn: 57204 | |||||
* | Use "unsigned" instead of "int" for i to remove a "comparison between ↵ | Ted Kremenek | 2008-10-06 | 1 | -1/+1 | |
| | | | | | | unsigned and signed" warning (potential integer overflow). llvm-svn: 57201 | |||||
* | Add 'x' constraint character. | Anders Carlsson | 2008-10-06 | 1 | -0/+1 | |
| | | | | llvm-svn: 57198 | |||||
* | Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead ↵ | Ted Kremenek | 2008-10-06 | 1 | -1/+1 | |
| | | | | | | of using DeclStmt::getDecl(). llvm-svn: 57196 | |||||
* | Don't use DeclStmt::getDecl(); this will eventually disappear. Just fetch ↵ | Ted Kremenek | 2008-10-06 | 1 | -4/+2 | |
| | | | | | | the first decl using the DeclStmt::decl_iterator. llvm-svn: 57194 | |||||
* | In EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the ↵ | Ted Kremenek | 2008-10-06 | 1 | -3/+3 | |
| | | | | | | scoped decl chain. llvm-svn: 57192 | |||||
* | Added PrintRawDeclStmt; use this method to print out DeclStmt instead of ↵ | Ted Kremenek | 2008-10-06 | 1 | -5/+19 | |
| | | | | | | using PrintRawDecl (which falsely assumes DeclStmts have only one Decl). llvm-svn: 57191 | |||||
* | Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will ↵ | Ted Kremenek | 2008-10-06 | 1 | -1/+3 | |
| | | | | | | soon be removed). llvm-svn: 57190 | |||||
* | Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon ↵ | Ted Kremenek | 2008-10-06 | 1 | -2/+6 | |
| | | | | | | | | DeclStmts will wrap group of Decls. Added FIXME. llvm-svn: 57189 | |||||
* | The current semantic process for direct initializers won't work properly for ↵ | Argyrios Kyrtzidis | 2008-10-06 | 1 | -21/+13 | |
| | | | | | | | | class types. Add a FIXME until class constructors are supported. llvm-svn: 57188 | |||||
* | Implement support for C++ direct initializers in declarations, e.g. "int x(1);". | Argyrios Kyrtzidis | 2008-10-06 | 4 | -1/+126 | |
| | | | | | | | | | | | | | | | 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 | |||||
* | __CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR | Chris Lattner | 2008-10-06 | 1 | -4/+4 | |
| | | | | | | won't expand to the builtin. This fixes rdar://6248329 llvm-svn: 57164 | |||||
* | Make sema and codegen allow __builtin___CFStringMakeConstantString as a valid | Chris Lattner | 2008-10-06 | 3 | -21/+32 | |
| | | | | | | | constant lvalue. Implement this in codegen by moving the code out of CGBuiltin into EmitConstantExpr. llvm-svn: 57163 | |||||
* | ExprConstant should not abort when it sees a pointer constant that isn't. | Chris Lattner | 2008-10-06 | 1 | -3/+0 | |
| | | | | llvm-svn: 57162 | |||||
* | always try to fold a builtin before emitting it. In the future | Chris Lattner | 2008-10-06 | 1 | -18/+5 | |
| | | | | | | | it is possible that a builtin could sometimes be folded (e.g. __builtin_clz) if it's operand is a constant. llvm-svn: 57161 | |||||
* | Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr | Chris Lattner | 2008-10-06 | 3 | -17/+16 | |
| | | | | | | | which is checking for something that can be inconsistent with what we can constant fold. llvm-svn: 57159 | |||||
* | Move folding of __builtin_classify_type out of the CallExpr | Chris Lattner | 2008-10-06 | 2 | -63/+70 | |
| | | | | | | interface into the constant folding interface. llvm-svn: 57158 | |||||
* | Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp | Chris Lattner | 2008-10-06 | 2 | -18/+19 | |
| | | | | llvm-svn: 57157 | |||||
* | remove some code where CGBuiltin folds constants, and use tryEvaluate to | Chris Lattner | 2008-10-06 | 1 | -22/+19 | |
| | | | | | | | 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 | |||||
* | instead of making codegen try to know about all of the builtins to generate | Chris Lattner | 2008-10-06 | 1 | -23/+8 | |
| | | | | | | | constants for them, just use the constant evaluator to do the job. This also fixes crashes on 'unknown constant builtins'. llvm-svn: 57155 | |||||
* | Teach FloatExprEvaluator to evaluate __builtin_huge_val and inf. | Chris Lattner | 2008-10-06 | 1 | -3/+5 | |
| | | | | llvm-svn: 57154 | |||||
* | "Enhance" CheckArithmeticConstantExpression to accept ?: with a constant | Chris Lattner | 2008-10-06 | 1 | -18/+41 | |
| | | | | | | | | | | | | | | | 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. llvm-svn: 57153 | |||||
* | Add a comment that describes tryEvaluate. Make tryEvaluate fold | Chris Lattner | 2008-10-06 | 2 | -6/+38 | |
| | | | | | | | __builtin_constant_p properly, and add some scaffolding for FloatExprEvaluator to eventually handle huge_val and inf. llvm-svn: 57152 | |||||
* | add a new CallExpr::isBuiltinCall() method, and use it to simplify some existing | Chris Lattner | 2008-10-06 | 1 | -63/+56 | |
| | | | | | | code. llvm-svn: 57151 | |||||
* | Actually use the mmintrin.h header, it's good enough now. | Anders Carlsson | 2008-10-06 | 1 | -0/+0 | |
| | | | | llvm-svn: 57150 | |||||
* | a more efficient test for __builtin_classify_type | Chris Lattner | 2008-10-06 | 1 | -1/+2 | |
| | | | | llvm-svn: 57149 | |||||
* | Fix typos. | Zhongxing Xu | 2008-10-06 | 1 | -2/+2 | |
| | | | | llvm-svn: 57146 | |||||
* | Apparently gcc uses pi64 for the shift intrinsics. | Anders Carlsson | 2008-10-06 | 1 | -4/+4 | |
| | | | | llvm-svn: 57145 | |||||
* | Add the 'y' assembler constraint. | Anders Carlsson | 2008-10-06 | 1 | -0/+1 | |
| | | | | llvm-svn: 57144 | |||||
* | Allow variadic arguments without named ones for C++, e.g. "void(...);" | Argyrios Kyrtzidis | 2008-10-06 | 1 | -1/+2 | |
| | | | | llvm-svn: 57143 | |||||
* | Implement support for the const and pure attributes. | Anders Carlsson | 2008-10-05 | 2 | -0/+28 | |
| | | | | llvm-svn: 57142 | |||||
* | A tiny optimization; use isCXXFunctionDeclarator only when it's appropriate. | Argyrios Kyrtzidis | 2008-10-05 | 1 | -9/+28 | |
| | | | | llvm-svn: 57141 | |||||
* | miscellaneous cleanups | Chris Lattner | 2008-10-05 | 1 | -22/+30 | |
| | | | | llvm-svn: 57140 | |||||
* | move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into | Chris Lattner | 2008-10-05 | 2 | -18/+11 | |
| | | | | | | target indep code. llvm-svn: 57139 | |||||
* | it helps when I save the file before testing and committing. | Chris Lattner | 2008-10-05 | 1 | -27/+1 | |
| | | | | llvm-svn: 57138 | |||||
* | suck the rest of the FP macros out of the targets into the PP | Chris Lattner | 2008-10-05 | 2 | -103/+51 | |
| | | | | llvm-svn: 57137 | |||||
* | Add some text from the C++ standard and additional ambiguity resolution tests. | Argyrios Kyrtzidis | 2008-10-05 | 1 | -7/+25 | |
| | | | | | | No funcitonality change. llvm-svn: 57136 | |||||
* | start moving fp macros over | Chris Lattner | 2008-10-05 | 2 | -22/+38 | |
| | | | | llvm-svn: 57134 | |||||
* | move a bunch more integer sizing out of target-specific code into | Chris Lattner | 2008-10-05 | 2 | -41/+50 | |
| | | | | | | | | | | 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). llvm-svn: 57132 | |||||
* | Handle ambiguities between expressions and type-ids that occur inside ↵ | Argyrios Kyrtzidis | 2008-10-05 | 3 | -5/+58 | |
| | | | | | | | | | parentheses, e.g.: sizeof(int()) -> "int()" is type-id sizeof(int()+1) -> "int()+1" is expression. llvm-svn: 57131 | |||||
* | eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start moving | Chris Lattner | 2008-10-05 | 2 | -22/+25 | |
| | | | | | | integer size #defines over to the Preprocessor. llvm-svn: 57130 | |||||
* | gcc no longer defines __block to nothing when blocks aren't enabled. | Chris Lattner | 2008-10-05 | 1 | -4/+1 | |
| | | | | llvm-svn: 57129 |