summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Downgrade incompatible block pointer error to a warning (to be consistent ↵Steve Naroff2008-09-241-1/+1
| | | | | | with incompatible pointer warnings in general). llvm-svn: 56595
* Remove unused slot/reference and update Sema::ActOnIdentifierExpr().Steve Naroff2008-09-221-4/+5
| | | | llvm-svn: 56438
* Remove BlockStmtExpr. Steve Naroff2008-09-171-2/+2
| | | | | | | | Block literals are now represented by the concrete BlockExpr class. This is cleanup (removes a FIXME). No functionality change. llvm-svn: 56288
* Remove support for BlockExprExpr. For example...Steve Naroff2008-09-161-34/+0
| | | | | | | | ^(expression) or ^(int arg1, float arg2)(expression) ...is no longer supported. All block literals now require a compound statement. llvm-svn: 56257
* Give string literals const element typesin C++, and cope with the deprecated ↵Douglas Gregor2008-09-121-0/+16
| | | | | | C++ conversion from a string literal to a pointer-to-non-const-character llvm-svn: 56137
* Iterate on sema for :? in Objective-C:Daniel Dunbar2008-09-111-34/+75
| | | | | | | | | | | | | | | | | | | | | | - Follow C99 behavior of using other operand type when one of operands is a null pointer constant. - Fix overenthusiastic devolving of any Objective-C types to id: o If either operand has an Objective-C object type then: - If both operands are interfaces and either operand can be assigned to the other, use that type as the composite type. - Otherwise, if either type is id, use id as the composite type. - Otherwise, warn about incompatible types and use id as the composite type. - Return handling of qualified idea to separate test following general pointer type checking. o Upgraded from old code to allow devolving to id (without warning, which matches GCC). - <rdar://problem/6212771> Add test case for issues fixed above, XFAIL though because it exposed a new issue in property handling. llvm-svn: 56135
* Allow array-to-pointer conversion for rvalues.Argyrios Kyrtzidis2008-09-111-1/+7
| | | | llvm-svn: 56094
* More semantic analysis for blocks...Steve Naroff2008-09-101-2/+9
| | | | llvm-svn: 56064
* Sema::ActOnIdentifierExpr(): Lookup block arguments.Steve Naroff2008-09-101-1/+6
| | | | llvm-svn: 56063
* More type checking for blocks. Still incomplete (will hopefully finish up ↵Steve Naroff2008-09-051-26/+71
| | | | | | this weekend). llvm-svn: 55862
* Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to ↵Steve Naroff2008-09-041-1/+19
| | | | | | | | check for block pointers. Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance). llvm-svn: 55778
* Add type checking for blocks.Steve Naroff2008-09-041-0/+80
| | | | llvm-svn: 55767
* Add semantic analysis for "blocks". Steve Naroff2008-09-031-0/+120
| | | | | | | | | | | | | | | Highlights... - 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr. - Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt(). Next steps... - hack Sema::ActOnIdentifierExpr() to deal with block decl refs. - add attribute handler for byref decls. - add test cases. llvm-svn: 55710
* Improve type-checking of ?: for Objective-C types.Daniel Dunbar2008-09-031-12/+17
| | | | | | | - Allow any Objective-C object types to devolve to type id in a ?: expression. This matches gcc behavior more closely. llvm-svn: 55705
* Restore Objective-C dot-syntax access of methods.Daniel Dunbar2008-09-031-33/+63
| | | | | | | | - Now also searches for correct setter method. - There are still some issues regarding validation of the setter method and access of read-only properties. llvm-svn: 55686
* Make sure to take the unqualified versions of the canonical types for Eli Friedman2008-09-021-3/+4
| | | | | | | type-checking pointer subtraction; if the canonical types aren't used, the qualifiers won't always get stripped off correctly. llvm-svn: 55620
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* In incompatible pointer-typed ?: expressions, add implicit conversionDaniel Dunbar2008-08-261-10/+23
| | | | | | | | | | | | | | | | | | | | of RHSs to id type instead of void* if either has Objective-C object type. - This ensures the result can still be used in normal places an object can be used, like a message send. Add implicit conversions for ?: applied to qualified id types to ensure that the RHSs are compatible. - This prevents a codegen crash (creating invalid PHI nodes). - Again, this relates to the fact that qualified id types have no canonical types. - Note that the implicit type casted to is incorrect, however this doesn't currently cause problems because of the flexibility of the id type. Test cases for above. llvm-svn: 55346
* Rewrite type compatibility testing to do type merging rather than just Eli Friedman2008-08-221-2/+31
| | | | | | | | | | | | testing compatibility. This is necessary for some constructs, like merging redeclarations. Also, there are some ObjC changes to make sure that typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any ObjC code beyond the testsuite, so please tell me if there are any cases where this doesn't behave as expected. llvm-svn: 55158
* add a simple check to warn people who type "=+" when they probably meantChris Lattner2008-08-211-2/+22
| | | | | | "+=". llvm-svn: 55131
* Fix a regression from my fix to PR2631. Fixes PR2692.Eli Friedman2008-08-201-0/+2
| | | | llvm-svn: 55083
* Fix subtle bug introduced in r54852.Daniel Dunbar2008-08-201-1/+1
| | | | | | | | | - UsualUnaryConversions takes an Expr *& and may modify its argument, this broke when it was refactored into Sema::CheckCastTypes. This meant that we were missing implicit casts in some places. - Seems pretty sad that this got through our tests. llvm-svn: 55039
* Add ExplicitCastExpr to replace the current CastExpr, and have ↵Argyrios Kyrtzidis2008-08-181-1/+1
| | | | | | | | | | | ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr): Expr -> CastExpr -> ExplicitCastExpr -> ImplicitCastExpr llvm-svn: 54955
* Move the type checking that Sema::ActOnCastExpr does into a new ↵Argyrios Kyrtzidis2008-08-161-33/+38
| | | | | | Sema::CheckCastTypes function so that it can be reused. llvm-svn: 54852
* Change Parser & Sema to use interned "super" for comparions.Daniel Dunbar2008-08-141-1/+1
| | | | | | | | | | | | | | - Added as private members for each because it is not clear where to put the common definition. Perhaps the IdentifierInfos all of these "pseudo-keywords" should be collected into one place (this would KnownFunctionIDs and Objective-C property IDs, for example). Remove Token::isNamedIdentifier. - There isn't a good reason to use strcmp when we have interned strings, and there isn't a good reason to encourage clients to do so. llvm-svn: 54794
* Make diagnostics relating to the callee hilight just the calleeChris Lattner2008-08-141-4/+4
| | | | | | | | | | | | | | | | and put the caret on the ()'s. e.g. produces: t.c:13:9: error: called object is not a function or function pointer ((B)a)(); ~~~~~~^ instead of: t.c:13:3: error: called object is not a function or function pointer ((B)a)(); ^~~~~~~~ llvm-svn: 54775
* More #include cleaningDaniel Dunbar2008-08-111-7/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | - Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into implementation .cpp llvm-svn: 54626
* Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).Steve Naroff2008-08-101-1/+2
| | | | llvm-svn: 54617
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-6/+6
| | | | llvm-svn: 54605
* Fix for PR2631; make va_arg work correctly on x86-64.Eli Friedman2008-08-091-3/+10
| | | | llvm-svn: 54600
* Change 'Wchar' to 'WChar' casing, for consistency.Argyrios Kyrtzidis2008-08-091-1/+1
| | | | | | No functionality change. llvm-svn: 54588
* Fix several issues in checking of address-of expressions.Daniel Dunbar2008-08-041-5/+47
| | | | | | | | | | | - clang was erroneously accepting address-of applied to lvalue expressions involving pointer arithmetic. - clang was erroneously rejecting address-of applied to deref expressions of pointer-typed variables. - Improved existing test case. - Fixes: <rdar://problem/6113867>, <rdar://problem/6080158> llvm-svn: 54326
* Add CodeGen support for indirect goto.Daniel Dunbar2008-08-041-1/+2
| | | | | | | | | | - Follows emission scheme used by llvm-gcc, i.e. invent an id for each label whose address is taken and replace each indirect goto by a switch to each possible target. - Currently we emit a switch for each indirect goto instead of merging them as llvm-gcc does. llvm-svn: 54318
* Finally fix PR2189. This makes a fairly invasive but important change toChris Lattner2008-08-041-2/+2
| | | | | | | | | | move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. llvm-svn: 54317
* make "call foo.dump()" and "call foo->dump()" work in GDB, Chris Lattner2008-07-271-0/+1
| | | | | | with QualTypes and Types. llvm-svn: 54116
* change more instances of QualType::getCanonicalType to callChris Lattner2008-07-261-19/+22
| | | | | | ASTContext::getCanonicalType instead (PR2189) llvm-svn: 54105
* convert more code to use ASTContext to get canonical types insteadChris Lattner2008-07-261-4/+4
| | | | | | of doing it directly. This is required for PR2189. llvm-svn: 54102
* fix some problems handling stmtexprs with labels (PR2374), and Chris Lattner2008-07-261-2/+8
| | | | | | improve 'expression unused' diagnostics for stmtexprs. llvm-svn: 54098
* GCC supports the complex conjugate operator (an extension) on complex int Chris Lattner2008-07-251-10/+8
| | | | | | as well as complex float. rdar://6097730 llvm-svn: 54080
* move a method.Chris Lattner2008-07-251-15/+15
| | | | llvm-svn: 54069
* Fix a couple bugs in aggregate cast processing: 1) fix precedecence Chris Lattner2008-07-251-26/+27
| | | | | | | | | problem with &&/||. 2) use canonical types for comparison instead of raw types. 3) emit an ext-warn for a gnu extension. Also simplify the code to make it less nested. llvm-svn: 54068
* make sizeof/alignof diagnostics highlight their operand with a sourcerange.Chris Lattner2008-07-251-7/+13
| | | | llvm-svn: 54066
* c89 does not perform array -> pointer promotion unless the array is an ↵Chris Lattner2008-07-251-2/+10
| | | | | | | | lvalue. This is different than C99. This fixes the rest of rdar://6095180. llvm-svn: 54064
* move some code, no other change.Chris Lattner2008-07-251-212/+222
| | | | llvm-svn: 54063
* In c99 mode, comma does do function/array promotion even though Chris Lattner2008-07-251-1/+3
| | | | | | it does not do unary promotions (like short->int). llvm-svn: 54058
* Comma does not perform unary promotions, rdar://6095180Chris Lattner2008-07-251-1/+1
| | | | llvm-svn: 54045
* when in the context of an @implementation, look for private methods in theChris Lattner2008-07-211-1/+13
| | | | | | @implementation to resolve nullary selector references. llvm-svn: 53845
* improve invalid member reference diagnostics to print the type and Chris Lattner2008-07-211-10/+10
| | | | | | | | | | | | | | | | have better source ranges. Before: t.m:11:53: error: member reference is not to a structure or union CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height; ^~~~~~~ after: t.m:11:54: error: member reference base type ('id') is not a structure or union CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ llvm-svn: 53834
OpenPOWER on IntegriCloud