summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-4/+4
| | | | llvm-svn: 111795
* Detabify.Eli Friedman2010-08-221-3/+3
| | | | llvm-svn: 111768
* DeclPtrTy -> Decl *John McCall2010-08-211-6/+5
| | | | llvm-svn: 111733
* Add a workaround for PR7947, a crash trying to recover from invalid C++ code.Nick Lewycky2010-08-201-16/+21
| | | | llvm-svn: 111675
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-4/+4
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* Diagnose assiging to an interface object inFariborz Jahanian2010-08-161-0/+5
| | | | | | | non-fragile abi mode as sizes are not statically known. Fixes radar 8315734. llvm-svn: 111191
* When issuing warning for future conflict resolution,Fariborz Jahanian2010-08-131-0/+3
| | | | | | | | (nonfragile-abi2), do not consider 'ivar' access in class methods. Also, improve on diagnostics. Radar 8304561. llvm-svn: 111023
* Zap unused UnaryOperator::OffsetOf.Eli Friedman2010-08-131-4/+0
| | | | llvm-svn: 110996
* Implement -Wcast-align. The initial design of this diagnostic diverges John McCall2010-08-121-0/+4
| | | | | | | | from GCC's in that we warn on *any* increase in alignment requirements, not just those that are enforced by hardware. Please let us know if this causes major problems for you (which it shouldn't, since it's an optional warning). llvm-svn: 110959
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-4/+4
| | | | llvm-svn: 110945
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-59/+69
| | | | llvm-svn: 110860
* Random temporary string cleanup.Benjamin Kramer2010-08-111-1/+1
| | | | llvm-svn: 110807
* Added TypeLocs to VAArgExpr node.Abramo Bagnara2010-08-101-4/+10
| | | | llvm-svn: 110666
* Added TypeLocs to TypesCompatibleExpr node.Abramo Bagnara2010-08-101-4/+14
| | | | llvm-svn: 110663
* When attempting to recover from a failed unqualified name lookup, makeDouglas Gregor2010-08-091-0/+2
| | | | | | sure to clear out the LookupResult structure after looking into each class. llvm-svn: 110615
* Integral-to-pointer conversions are not always null -> member pointerDouglas Gregor2010-08-071-2/+8
| | | | | | conversions. Fixes PR7443. llvm-svn: 110519
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-11/+11
| | | | | | | | | | | | | | | 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
* PR7837: For qualified id's, make sure the decl context is complete if notEli Friedman2010-08-061-20/+18
| | | | | | | dependent in ActOnIdExpression. (This issue only shows up with member operators because an operator is never a type.) llvm-svn: 110486
* Introduce implicit conversions between AltiVec vectors and GCCDouglas Gregor2010-08-061-6/+18
| | | | | | vectors, from Anton Yartsev! llvm-svn: 110437
* Flip the switch to use OffsetOfExpr unconditionally; feel free to revert ifEli Friedman2010-08-051-129/+5
| | | | | | | | this breaks something. I'll wait a few days before cleaning out UnaryOperator::OffsetOf. llvm-svn: 110328
* PR7769: Fix references to anonymous structs/unions in base classes inEli Friedman2010-08-051-7/+12
| | | | | | offsetof expressions. llvm-svn: 110327
* Remove the warning for variables declared in the if-expression being used inNick Lewycky2010-08-051-21/+1
| | | | | | | | the else clause. The problem is that it's overly zealous and will respond to uses in assignments, or after assignments. We should bring this back once we can do it right. Fixes PR7100. llvm-svn: 110314
* Tighten the rules when deciding if an ivar must beFariborz Jahanian2010-07-301-3/+15
| | | | | | | auto-synthesized (nonfragile-abi2 specific). Fixes radar 8251648. llvm-svn: 109866
* Tigthen the condition for issung ivar shadowingFariborz Jahanian2010-07-291-1/+2
| | | | | | | variables to those in file scope (nonfragile-abi2). Fixes radar 8248681. llvm-svn: 109758
* When taking the address of a value of Objective-C object type (e.g.,Douglas Gregor2010-07-291-0/+2
| | | | | | | one because we're referencing a variable of type NSString &), the resulting type is an ObjCObjectPointerType. llvm-svn: 109753
* Don't die when a member access refers to a non-class member via aDouglas Gregor2010-07-281-0/+3
| | | | | | qualified name. Fixes <rdar://problem/8231724>. llvm-svn: 109682
* Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.Eli Friedman2010-07-271-4/+4
| | | | llvm-svn: 109537
* PR7724: Don't try to evaluate value-dependent expressions.Eli Friedman2010-07-271-1/+1
| | | | llvm-svn: 109532
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-13/+3
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* turn down the logical bitwise confusion warning to not warn Chris Lattner2010-07-241-11/+14
| | | | | | | | | when the RHS of the ||/&& is ever 0 or 1. This handles a variety of creative idioms for "true" used in C programs and fixes many false positives at the expense of a few false negatives. This fixes rdar://8230351. llvm-svn: 109314
* Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.Fariborz Jahanian2010-07-231-0/+2
| | | | | | Radar 8218839. llvm-svn: 109272
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-231-10/+16
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* Warn when property ivar lookup finds a global variableFariborz Jahanian2010-07-221-2/+31
| | | | | | | of same name. In nonfragile-abi2, lookup accesses a synthesized ivar. This is a transition warning. Radar 8225011. llvm-svn: 109197
* Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's ↵Ted Kremenek2010-07-211-1/+1
| | | | | | | | | | | | behavior. Note that GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now Clang's behavior is more strict in this case, but more consistent. We will need to see how much this fires on real code and determine whether this case should be downgraded to a warning. Fixes <rdar://problem/8213093>. llvm-svn: 109033
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-6/+5
| | | | llvm-svn: 108807
* Categories cannot synthesize property ivars,Fariborz Jahanian2010-07-191-5/+5
| | | | | | and a minor cleanup. llvm-svn: 108707
* Check for casts to an incomplete type in C. Improves diagnostics for cast toEli Friedman2010-07-171-0/+4
| | | | | | | incomplete union (PR5692) and incomplete enum, and fixes obscure accepts-invalid on cast to incomplete struct. llvm-svn: 108630
* Patch to synthesize property ivars on demand asFariborz Jahanian2010-07-171-0/+38
| | | | | | | part of the new property synthesis by default. wip. llvm-svn: 108599
* restrict the && -> & warning to cover a case daniel noted.Chris Lattner2010-07-151-0/+4
| | | | | | | Don't warn about "logically bool" expressions on the RHS, even if they fold to a constant. llvm-svn: 108388
* Consider obective-c pointer arguments as valid sentinel argsFariborz Jahanian2010-07-141-1/+1
| | | | | | as well. Fixes radar 7975788. llvm-svn: 108333
* Add a warning to catch a bug recently caught by code review, like this:Chris Lattner2010-07-131-2/+16
| | | | | | | | | | | t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise & or remove constant [-Wlogical-bitwise-confusion] return x && 4; ^ ~ wording improvement suggestions are welcome. llvm-svn: 108260
* Whenever we're creating an expression that is typically an rvalueDouglas Gregor2010-07-131-3/+6
| | | | | | | | | | | | | | | | (e.g., a call, cast, etc.), immediately adjust the expression's type to strip cv-qualifiers off of all non-class types (in C++) or all types (in C). This effectively extends my previous fix for PR7463, which was restricted to calls, to other kinds of expressions within similar characteristics. I've audited every use of getNonReferenceType() in the code base, switching to the newly-renamed getNonLValueExprType() where necessary. Big thanks to Eli for pointing out just how incomplete my original fix for PR7463 actually was. We've been handling cv-qualifiers on rvalues wrong for a very, very long time. Fixes PR7463. llvm-svn: 108253
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-131-4/+4
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* Compute Type dependent-ness of BlockDeclRefExprFariborz Jahanian2010-07-121-2/+1
| | | | | | on the fly when constructing it. llvm-svn: 108166
* Move setting of Dependent Type to BlockDeclRefExpr'sFariborz Jahanian2010-07-121-4/+3
| | | | | | constructor. llvm-svn: 108157
* Fix another aspect of PR7047, macro expansions. Previously, this was hackedChandler Carruth2010-07-121-7/+8
| | | | | | | | | | | | around by exempting enums from the check, but this doesn't handle a lot of cases. A better approach is to directly check if the operator comes from a macro expansion. I've removed a reference to the rdar that originally led to the enum suppression when removing it's overly contrived test case. Let me know if that number or a more reasilistic test case involving enums is still needed. llvm-svn: 108128
* Lay the ground work for resoving PR7047. This doesn't actually fix it becauseChandler Carruth2010-07-101-3/+18
| | | | | | | | | | default arguments to template parameters don't have a DeclContext when instantiated, and so we can't detect that we're in an instantiation context as opposed to the definition context. However, it fixes the more commonly-occuring cases in TMP code that use devolve to this type of tautology after substitution. llvm-svn: 108044
* BlockDeclRefExpr of a dependent type mustFariborz Jahanian2010-07-091-13/+16
| | | | | | be a dependent expression when its is built. llvm-svn: 108026
* Instantiation of block literal expressions. wip.Fariborz Jahanian2010-07-091-2/+5
| | | | llvm-svn: 108000
* When performing substitution of template arguments within the body ofDouglas Gregor2010-07-081-3/+4
| | | | | | | a template, be sure to include the template arguments from the injected-class-name. Fixes PR7587. llvm-svn: 107895
OpenPOWER on IntegriCloud