summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* If block literal return type is not specified, return type of the block is Fariborz Jahanian2011-12-031-1/+3
| | | | | | | inferred from return types. All the return statements have to agree about the type. // rdar://10466373 llvm-svn: 145774
* When sending a message to a receiver that has "unknown any" type,Douglas Gregor2011-12-011-0/+9
| | | | | | | force the unknown any type to "id" so that the message send can be completed without requiring a case. Fixes <rdar://problem/10506646>. llvm-svn: 145552
* Test isa<FunctionDecl> to exclude objective-C methods. This ensures the ↵Lang Hames2011-11-291-1/+1
| | | | | | following cast will never fail. llvm-svn: 145441
* Remove code made redundant by my previous patch.Fariborz Jahanian2011-11-281-12/+1
| | | | llvm-svn: 145266
* pinpoint name/location of deprecated/unavailable enumeratorFariborz Jahanian2011-11-281-1/+8
| | | | | | | whose enum has been made deprecated/unavailable in the warning. // rdar://10201690 llvm-svn: 145264
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-251-2/+13
| | | | | | | | | | templates" works inside a friend function definition at class scope. Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext. This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang. llvm-svn: 145127
* Add feature to diagnostics that will provide more information on functionRichard Trieu2011-11-231-0/+9
| | | | | | | | | | pointer mismatch. Cases covered are: initialization, assignment, and function arguments. Additional text will give the extra information about the nature of the mismatch: different classes for member functions, wrong number of parameters, different parameter type, different return type, and function qualifier mismatch. llvm-svn: 145114
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-171-1/+17
| | | | | | | | | | templates" works inside default argument instantiation. This is a little bit tricky because during default argument instantiation the CurContext points to a CXXMethodDecl but we can't use the keyword this or have an implicit member call generated. This fixes 2 errors when parsing MFC code with clang. llvm-svn: 144881
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-151-1/+3
| | | | | | templates" works inside static functions. llvm-svn: 144729
* Resolve placeholder expressions before trying to deduceJohn McCall2011-11-151-4/+1
| | | | | | | 'auto'. Introduce a convenience method to make this a bit easier, and use it elsewhere. llvm-svn: 144605
* ARC: make assignment to 'self' within class methods illegal. Fixes ↵Ted Kremenek2011-11-141-1/+3
| | | | | | <rdar://problem/10416568>. llvm-svn: 144572
* Add missing casts to AST.Eli Friedman2011-11-121-1/+8
| | | | llvm-svn: 144455
* Be sure to insulate block literals from any cleanups in theirJohn McCall2011-11-111-0/+12
| | | | | | | enclosing full-expressions. It is somewhat amazing that this hasn't come up as a problem before. llvm-svn: 144362
* There's no good reason to track temporaries in ExprWithCleanups,John McCall2011-11-101-11/+30
| | | | | | | but it is sometimes useful to track blocks. Do so. Also optimize the storage of these expressions. llvm-svn: 144263
* objc: Don't crash on missing @interface decl.Fariborz Jahanian2011-11-081-6/+7
| | | | | | // rdar://10415026 llvm-svn: 144143
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* back out changes in r143399 and r143475.Fariborz Jahanian2011-11-021-3/+0
| | | | | | | rvale-references are captured by reference in blocks. // rdar://9971124. llvm-svn: 143583
* Find copy constructor needed to copy an rvalue referenceFariborz Jahanian2011-11-011-1/+4
| | | | | | c++ object into block descriptor. // rdar://9971124 llvm-svn: 143475
* Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman2011-11-011-1/+1
| | | | | | | | | | native representation of integers for the elements. This fixes a bunch of nastiness involving treating wide strings as a series of bytes. Patch by Seth Cantrell. llvm-svn: 143417
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-1/+1
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertionRichard Smith2011-10-281-2/+13
| | | | | | to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds. llvm-svn: 143182
* Be sure to build a dependent expression when we seeJohn McCall2011-10-281-12/+24
| | | | | | a binary operator involving a dependently-typed overload set. llvm-svn: 143172
* Add missing lvalue-to-rvalue conversion to vector splat casts.Richard Smith2011-10-271-2/+6
| | | | llvm-svn: 143166
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-232/+178
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-178/+232
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Pull the pseudo-object stuff into its own file.John McCall2011-10-251-334/+23
| | | | | | | Tidy up some marginally related code just to annoy single-purpose-commit lovers. No functionality change. llvm-svn: 142915
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-155/+412
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Don't forget to complete the objc interface before asking for information,Argyrios Kyrtzidis2011-10-191-1/+2
| | | | | | otherwise lldb will suffer. llvm-svn: 142471
* Move static array parameter checks to SemaExpr, per Doug's requestPeter Collingbourne2011-10-191-2/+60
| | | | llvm-svn: 142465
* Macro metaprogramming for builtin types.John McCall2011-10-181-30/+5
| | | | llvm-svn: 142420
* -Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.Richard Smith2011-10-181-4/+9
| | | | llvm-svn: 142419
* Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument indexRichard Smith2011-10-171-6/+6
| | | | | | before typechecking, as suggested by John. llvm-svn: 142308
* The comparison of two vectors should return a signed result. ↵Tanya Lattner2011-10-171-9/+9
| | | | | | | | | hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type. I added a new test case and updated exisiting test cases that assumed an unsigned result. llvm-svn: 142250
* Add missing case to switch.Eli Friedman2011-10-171-0/+1
| | | | llvm-svn: 142246
* Teach the ARC compiler to not require __bridge casts whenJohn McCall2011-10-171-12/+70
| | | | | | | passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. llvm-svn: 142219
* Perform an lvalue-to-rvalue conversion on an array index in a ↵Richard Smith2011-10-171-1/+5
| | | | | | __builtin_offsetof expression. llvm-svn: 142179
* Slightly simplify a constant expression check. No functional change.Richard Smith2011-10-161-3/+3
| | | | llvm-svn: 142167
* Check for unavailable declarations in Sema::CanUseDecl.Sebastian Redl2011-10-161-0/+6
| | | | llvm-svn: 142145
* Drop the Diagnose parameter from Sema::PerformImplicitConversion again and ↵Sebastian Redl2011-10-161-3/+17
| | | | | | instead use TryImplicitConversion in CheckSingleAssignmentConstraints when that function is in no-diagnostics mode. llvm-svn: 142143
* obj-c++: allow the getter/setter to return/take parametersFariborz Jahanian2011-10-151-2/+4
| | | | | | by reference. // rdar://10188258 llvm-svn: 142075
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-7/+21
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Don't try to diagnose anything when we're passing incomplete typesDouglas Gregor2011-10-141-1/+4
| | | | | | | | through varargs. This only happens when we're in an unevaluated context, where we don't want to trigger an error anyway. Fixes PR11131 / <rdar://problem/10288375>. llvm-svn: 141986
* Fix misplaced comment.Fariborz Jahanian2011-10-141-3/+3
| | | | llvm-svn: 141967
* Make value kind based on the return type of the getter, notFariborz Jahanian2011-10-141-4/+4
| | | | | | | property type, for when getter may be a reference type. // rdar://10188258 revised. llvm-svn: 141966
* HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. SimplifyDouglas Gregor2011-10-131-1/+1
| | | | llvm-svn: 141878
* Allow calling an overloaded function set by taking the address of theDouglas Gregor2011-10-131-2/+2
| | | | | | functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>. llvm-svn: 141877
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-111-8/+32
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* Constant expression evaluation refactoring:Richard Smith2011-10-101-2/+3
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Only allow taking the address of an expression of type 'overloadedDouglas Gregor2011-10-091-1/+8
| | | | | | | | function type' when that expression is actually an overloaded function reference (and not the address of an overloaded function reference). Fixes PR11066. llvm-svn: 141514
* Move type-checking for C-style casts in C into the now-misnamed John McCall2011-10-061-242/+33
| | | | | | SemaCXXCast.cpp. Should have no functionality change. llvm-svn: 141336
OpenPOWER on IntegriCloud