summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Use getCustomDiagID() instead of specifying the diagnostic in the ↵Argyrios Kyrtzidis2008-10-061-2/+4
| | | | | | 'DiagnosticKinds.def' file. llvm-svn: 57220
* Simplify handling of direct initializers by letting ↵Argyrios Kyrtzidis2008-10-061-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 Kremenek2008-10-061-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 Kremenek2008-10-061-3/+3
| | | | | | processing the Decl of an Objective-C foreach statement. llvm-svn: 57209
* Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵Ted Kremenek2008-10-061-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 Kremenek2008-10-061-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 Kremenek2008-10-061-8/+12
| | | | | | ScopedDecl chain. llvm-svn: 57206
* Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.Ted Kremenek2008-10-061-1/+1
| | | | | | This patch precedes removing getDecl() DeclStmt::entirely. llvm-svn: 57205
* Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()Ted Kremenek2008-10-061-1/+5
| | | | llvm-svn: 57204
* Use "unsigned" instead of "int" for i to remove a "comparison between ↵Ted Kremenek2008-10-061-1/+1
| | | | | | unsigned and signed" warning (potential integer overflow). llvm-svn: 57201
* Add 'x' constraint character.Anders Carlsson2008-10-061-0/+1
| | | | llvm-svn: 57198
* Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead ↵Ted Kremenek2008-10-061-1/+1
| | | | | | of using DeclStmt::getDecl(). llvm-svn: 57196
* Don't use DeclStmt::getDecl(); this will eventually disappear. Just fetch ↵Ted Kremenek2008-10-061-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 Kremenek2008-10-061-3/+3
| | | | | | scoped decl chain. llvm-svn: 57192
* Added PrintRawDeclStmt; use this method to print out DeclStmt instead of ↵Ted Kremenek2008-10-061-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 Kremenek2008-10-061-1/+3
| | | | | | soon be removed). llvm-svn: 57190
* Use DeclStmt::decl_iterator instead of using Decl::getDecl(). Soon ↵Ted Kremenek2008-10-061-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 Kyrtzidis2008-10-061-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 Kyrtzidis2008-10-064-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 CFSTRChris Lattner2008-10-061-4/+4
| | | | | | won't expand to the builtin. This fixes rdar://6248329 llvm-svn: 57164
* Make sema and codegen allow __builtin___CFStringMakeConstantString as a validChris Lattner2008-10-063-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 Lattner2008-10-061-3/+0
| | | | llvm-svn: 57162
* always try to fold a builtin before emitting it. In the futureChris Lattner2008-10-061-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 isBuiltinConstantExprChris Lattner2008-10-063-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 CallExprChris Lattner2008-10-062-63/+70
| | | | | | interface into the constant folding interface. llvm-svn: 57158
* Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cppChris Lattner2008-10-062-18/+19
| | | | llvm-svn: 57157
* remove some code where CGBuiltin folds constants, and use tryEvaluate toChris Lattner2008-10-061-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 generateChris Lattner2008-10-061-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 Lattner2008-10-061-3/+5
| | | | llvm-svn: 57154
* "Enhance" CheckArithmeticConstantExpression to accept ?: with a constant Chris Lattner2008-10-061-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 foldChris Lattner2008-10-062-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 existingChris Lattner2008-10-061-63/+56
| | | | | | code. llvm-svn: 57151
* Actually use the mmintrin.h header, it's good enough now.Anders Carlsson2008-10-061-0/+0
| | | | llvm-svn: 57150
* a more efficient test for __builtin_classify_typeChris Lattner2008-10-061-1/+2
| | | | llvm-svn: 57149
* Fix typos.Zhongxing Xu2008-10-061-2/+2
| | | | llvm-svn: 57146
* Apparently gcc uses pi64 for the shift intrinsics.Anders Carlsson2008-10-061-4/+4
| | | | llvm-svn: 57145
* Add the 'y' assembler constraint.Anders Carlsson2008-10-061-0/+1
| | | | llvm-svn: 57144
* Allow variadic arguments without named ones for C++, e.g. "void(...);"Argyrios Kyrtzidis2008-10-061-1/+2
| | | | llvm-svn: 57143
* Implement support for the const and pure attributes.Anders Carlsson2008-10-052-0/+28
| | | | llvm-svn: 57142
* A tiny optimization; use isCXXFunctionDeclarator only when it's appropriate.Argyrios Kyrtzidis2008-10-051-9/+28
| | | | llvm-svn: 57141
* miscellaneous cleanupsChris Lattner2008-10-051-22/+30
| | | | llvm-svn: 57140
* move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ intoChris Lattner2008-10-052-18/+11
| | | | | | target indep code. llvm-svn: 57139
* it helps when I save the file before testing and committing.Chris Lattner2008-10-051-27/+1
| | | | llvm-svn: 57138
* suck the rest of the FP macros out of the targets into the PPChris Lattner2008-10-052-103/+51
| | | | llvm-svn: 57137
* Add some text from the C++ standard and additional ambiguity resolution tests.Argyrios Kyrtzidis2008-10-051-7/+25
| | | | | | No funcitonality change. llvm-svn: 57136
* start moving fp macros overChris Lattner2008-10-052-22/+38
| | | | llvm-svn: 57134
* move a bunch more integer sizing out of target-specific code intoChris Lattner2008-10-052-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 Kyrtzidis2008-10-053-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 movingChris Lattner2008-10-052-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 Lattner2008-10-051-4/+1
| | | | llvm-svn: 57129
OpenPOWER on IntegriCloud