summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* In RewriteFunctionBody, using DeclStmt::decl_iterator to rewrite the Decls ↵Ted Kremenek2008-10-061-8/+12
| | | | | | | 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
* 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
* Use DeclStmt::decl_iterator instead of walking the ScopedDecl chain (which ↵Ted Kremenek2008-10-061-1/+3
| | | | | | will soon be removed). llvm-svn: 57187
* Add const_decl_iterator to DecStmt.Ted Kremenek2008-10-061-0/+23
| | | | llvm-svn: 57186
* Update Xcode project.Ted Kremenek2008-10-061-0/+18
| | | | llvm-svn: 57180
* Implement support for C++ direct initializers in declarations, e.g. "int x(1);".Argyrios Kyrtzidis2008-10-068-5/+184
| | | | | | | | | | | | | | | 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
* Updated checker build.Ted Kremenek2008-10-061-1/+1
| | | | llvm-svn: 57176
* fix incorrect rdar number.Chris Lattner2008-10-061-1/+1
| | | | llvm-svn: 57165
* __CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTRChris Lattner2008-10-062-4/+17
| | | | | | 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-064-21/+37
| | | | | | | 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
* Remove the 'C' / isConstantExpr flag on builtins. Code should neverChris Lattner2008-10-062-16/+9
| | | | | | | depend on the value of this flag, it should depend on whether tryEvaluate is able to *actually* fold a builtin. llvm-svn: 57160
* Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExprChris Lattner2008-10-064-21/+20
| | | | | | | 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-063-65/+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-063-20/+50
| | | | | | | | | | | | | | | 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-063-6/+42
| | | | | | | __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-062-63/+61
| | | | | | 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-062-1/+7
| | | | llvm-svn: 57143
* Implement support for the const and pure attributes.Anders Carlsson2008-10-054-2/+53
| | | | 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-052-8/+41
| | | | | | No funcitonality change. llvm-svn: 57136
* start moving fp macros overChris Lattner2008-10-052-22/+38
| | | | llvm-svn: 57134
* Add script for checking builtin macros verse another compiler ($CC orDaniel Dunbar2008-10-051-0/+23
| | | | | | gcc). llvm-svn: 57133
* move a bunch more integer sizing out of target-specific code intoChris Lattner2008-10-053-47/+57
| | | | | | | | | | 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-055-6/+77
| | | | | | | | | 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
* rearrange preprocessor macro definitions into language-specificChris Lattner2008-10-051-44/+51
| | | | | | then target specific. llvm-svn: 57128
OpenPOWER on IntegriCloud