summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ObjCMessageExpr objects that represent messages to class methods now can ↵Ted Kremenek2008-06-241-1/+35
| | | | | | contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class. llvm-svn: 52676
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-2/+4
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-109/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* Fix ast dumping to work with long double literals, e.g. we dump:Chris Lattner2008-06-071-0/+10
| | | | | | | | | | | | | long double X() { return 1.0L; } as: long double X() (CompoundStmt 0xb06a00 <t.c:2:17, col:32> (ReturnStmt 0xb068d0 <col:19, col:26> (FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000))) llvm-svn: 52080
* Put back my temporary hack until Eli addresses this in a more complete fashion.Steve Naroff2008-06-031-0/+5
| | | | llvm-svn: 51920
* Re-fix r51907 in a way which doesn't affect valid code. This essentially Eli Friedman2008-06-031-5/+0
| | | | | | | | | | | | | moves the check for the invalid construct to a point where it doesn't affect other uses of isIntegerConstantExpr, and we can warn properly when the extension is used. This makes it a bit more complicated, but it's a lot cleaner. Steve, please tell me if this check is sufficient to handle the relevant system header. I know it's enough to handle the testcase, but I don't know what exactly the original looks like. llvm-svn: 51918
* Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC ↵Steve Naroff2008-06-031-0/+5
| | | | | | | | compatibility). Note FIXME. Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length llvm-svn: 51907
* Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared ↵Steve Naroff2008-06-021-1/+5
| | | | | | identifier 'super' llvm-svn: 51888
* Teach Expr::isLvalue() about ObjC properties. For now, all properties are ↵Steve Naroff2008-05-301-0/+2
| | | | | | writable. Added a FIXME for another day. llvm-svn: 51800
* Add basic support for properties references (a missing feature).Steve Naroff2008-05-301-0/+9
| | | | | | While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51719
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-291-1/+1
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Assume statement expressions have side effects; this gets rid of a lot Eli Friedman2008-05-271-2/+5
| | | | | | of extra warnings in the Python source. llvm-svn: 51594
* Move getAccessedFieldNo out of lib/AST/Expr.cpp intoDan Gohman2008-05-221-10/+0
| | | | | | | | | lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to use its own enum for visibility types instead of using llvm::GlobalValue::VisibilityTypes. These changes eliminate dependencies in the AST library on LLVM's VMCore library. llvm-svn: 51398
* Remove the unneeded #include of VMCore header "llvm/DerivedTypes.h".Dan Gohman2008-05-211-1/+0
| | | | llvm-svn: 51392
* Make the unused expression warning a bit less aggressive (found in PHP Eli Friedman2008-05-191-0/+4
| | | | | | code). llvm-svn: 51276
* Minor cleanup to isBuiltinConstantExpr.Eli Friedman2008-05-161-7/+2
| | | | llvm-svn: 51188
* Removed bogus "return true" in Expr::isConstantExpr that returned true for allTed Kremenek2008-05-151-1/+0
| | | | | | | | | | expressions. This appears to be a regression introduced in r51113 that caused many test cases to fail (there is still a test case in the Analysis directory that is failing): http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html llvm-svn: 51164
* Implementation of __builtin_shufflevector, a portable builtin capable of Eli Friedman2008-05-141-0/+9
| | | | | | | | | expressing the full flexibility of the LLVM shufflevector instruction. The expected immediate usage is in *mmintrin.h, so that they don't depend on the mess of gcc-inherited (and not completely implemented) shuffle builtins. llvm-svn: 51113
* Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.Nate Begeman2008-05-131-4/+3
| | | | llvm-svn: 51068
* Extend vector member references to include {.hi, .lo, .e, .o} which return aNate Begeman2008-05-091-30/+39
| | | | | | | | | | | | | vector of the same element type and half the width, with the high, low, even, and odd elements respectively. Allow member references to member references, so that .hi.hi gives you the high quarter of a vector. This is fairly convenient syntax for some insert/extract operations. Remove some unnecessary methods/types in the ExtVectorElementExpr class. llvm-svn: 50892
* Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.Steve Naroff2008-05-071-2/+4
| | | | llvm-svn: 50816
* Fix off-by-one error.Steve Naroff2008-05-071-1/+1
| | | | llvm-svn: 50815
* Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base ↵Ted Kremenek2008-05-021-2/+7
| | | | | | expression. llvm-svn: 50585
* Use pointer swizziling to unify in ObjCMessageExpr the receiver and ↵Ted Kremenek2008-05-011-6/+5
| | | | | | | | classname "fields". This saves us a pointer. Implemented serialization for ObjCMessageExpr. llvm-svn: 50528
* Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of ↵Steve Naroff2008-05-011-7/+4
| | | | | | the initializer rewrite I am doing). llvm-svn: 50511
* OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman2008-04-181-14/+14
| | | | llvm-svn: 49942
* Several improvements from Doug Gregor related to defaultChris Lattner2008-04-101-1/+2
| | | | | | argument handling. I'll fix up the c89 (void) thing next. llvm-svn: 49459
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-0/+15
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* PR1963: Address of function is a constant expressionSeo Sanghyeon2008-04-041-0/+2
| | | | llvm-svn: 49212
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+1391
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud