summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor the tree transform's many loops over sets of expressionsDouglas Gregor2011-01-031-4/+4
| | | | | | | | | | | (transforming each in turn) into calls into one central routine (TransformExprs) that transforms a list of expressions. This refactoring is preparatory work for pack expansions whose in an expression-list. No functionality change. llvm-svn: 122761
* Add an AST representation for non-type template parameterDouglas Gregor2010-12-231-2/+8
| | | | | | | | | | | | | | packs, e.g., template<typename T, unsigned ...Dims> struct multi_array; along with semantic analysis support for finding unexpanded non-type template parameter packs in types, expressions, and so on. Template instantiation involving non-type template parameter packs probably doesn't work yet. That'll come soon. llvm-svn: 122527
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-32/+136
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Introduce ObjCMessageExpr::getReceiverRange() to get the source range of the ↵Argyrios Kyrtzidis2010-12-101-1/+17
| | | | | | receiver. llvm-svn: 121517
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-101-10/+16
| | | | llvm-svn: 121516
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-8/+0
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-3/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().John McCall2010-12-041-3/+11
| | | | | | Abramo noticed this. llvm-svn: 120898
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-041-2/+44
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-33/+7
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall2010-12-011-0/+2
| | | | llvm-svn: 120555
* L-value to r-value conversion is not ready for prime-time.John McCall2010-11-301-2/+0
| | | | llvm-svn: 120433
* Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall2010-11-301-0/+2
| | | | | | about the reliability of this yet. llvm-svn: 120422
* Look through parentheses when deciding whether an expr is a temporary ↵Anders Carlsson2010-11-281-4/+4
| | | | | | object. Fixes PR8683. llvm-svn: 120247
* Switch a lot of call-sites over to using the new value-kind calculations.John McCall2010-11-241-1/+1
| | | | llvm-svn: 120084
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-24/+38
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* a metric ton of refactoring later, Sema::getLocationOfStringLiteralByte Chris Lattner2010-11-171-0/+69
| | | | | | | | no longer depends on Preprocessor, so we can move it out of Sema into a nice new StringLiteral::getLocationOfByte method that can be used by any AST client. llvm-svn: 119481
* Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall2010-11-161-2/+0
| | | | llvm-svn: 119331
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+6
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-151-0/+8
| | | | llvm-svn: 119138
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-141-2/+12
| | | | | | | | | | implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-131-3/+13
| | | | | | between complex types. llvm-svn: 118994
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-131-0/+2
| | | | llvm-svn: 118966
* Fix InitListExpr::getSourceRange() to work in the case of no locations for ↵Ted Kremenek2010-11-091-0/+29
| | | | | | | | '(' and ')'. This can happen in the case of transparent unions. llvm-svn: 118472
* Emit error when using a bound member function for something other than ↵Argyrios Kyrtzidis2010-11-011-0/+6
| | | | | | | | calling it. Also avoids IRGen crashes due to accepting invalid code. llvm-svn: 117943
* Emit an error when trying to form a pointer-to-member to a bitfield.Argyrios Kyrtzidis2010-10-301-0/+5
| | | | | | As a bonus, avoids a crash on the IRGen side due to accepting invalid code. llvm-svn: 117842
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-5/+5
| | | | | | PR8423 llvm-svn: 117775
* Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.John McCall2010-10-261-16/+16
| | | | | | | | | There's probably still significant padding waste on x86-64 UNIXen, but the difference in 32-bit compiles should be significant. There are a lot of Expr nodes left that could lose a word this way. llvm-svn: 117359
* Treat __extension__ like ParenExpr.Abramo Bagnara2010-10-151-14/+48
| | | | llvm-svn: 116569
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-9/+21
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Patch to support transparent_union argumentsFariborz Jahanian2010-09-271-0/+7
| | | | | | | passed to nonnull attributed functions. Implements radar 6857843. llvm-svn: 114917
* Copying result of object property reference expressionFariborz Jahanian2010-09-271-1/+6
| | | | | | | into a temporary is elidable as well. (Finishes up radar 8291337). llvm-svn: 114845
* Fixed isConstantInitializer for __builtin_choose_expr.Abramo Bagnara2010-09-271-0/+3
| | | | llvm-svn: 114820
* Warn when an expression result in a LabelStmt is unused.Argyrios Kyrtzidis2010-09-191-1/+5
| | | | llvm-svn: 114314
* Right, there are *two* cases of pr-value class-type expressions that don'tJohn McCall2010-09-161-3/+8
| | | | | | | derive from temporaries of the same type. Black-list member expressions as well. llvm-svn: 114071
* Tweak comment as suggested by Sebastian.John McCall2010-09-151-1/+1
| | | | llvm-svn: 114019
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-35/+20
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Test destructors in delete expressions and of temporaries for throwing.Sebastian Redl2010-09-101-3/+23
| | | | llvm-svn: 113664
* Address Doug's comments.Sebastian Redl2010-09-101-1/+6
| | | | llvm-svn: 113650
* First version of a testcase, plus fixes.Sebastian Redl2010-09-101-2/+5
| | | | llvm-svn: 113624
* Implement Expr::CanThrow, a function that applies the noexcept operator ↵Sebastian Redl2010-09-101-0/+201
| | | | | | rules to expressions. llvm-svn: 113621
* Make CallExpr::getCalleeDecl look through pointer derefs.Sebastian Redl2010-09-101-0/+8
| | | | llvm-svn: 113620
* Fix the memory leak of FloatingLiteral/IntegerLiteral.Argyrios Kyrtzidis2010-08-281-0/+38
| | | | | | | | | | | For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers. Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with the APFloat/APInt values will never get freed. I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral. Fixes rdar://7637185 llvm-svn: 112361
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-162/+162
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-251-4/+4
| | | | llvm-svn: 112044
* Regularize the API for accessing explicit template arguments.John McCall2010-08-191-5/+5
| | | | llvm-svn: 111584
* Zap unused UnaryOperator::OffsetOf.Eli Friedman2010-08-131-1/+0
| | | | llvm-svn: 110996
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-6/+38
| | | | llvm-svn: 110860
* Allow reference binding of a reference of Objective-C object type toDouglas Gregor2010-08-071-0/+2
| | | | | | | | an lvalue of another, compatible Objective-C object type (e.g., a subclass). Introduce a new initialization sequence step kind to describe this binding, along with a new cast kind. Fixes PR7741. llvm-svn: 110513
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-0/+60
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
OpenPOWER on IntegriCloud