summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement template instantiation for member class templates.Douglas Gregor2009-08-281-3/+3
| | | | | | | | | | When performing template instantiation of the definitions of member templates (or members thereof), we build a data structure containing the template arguments from each "level" of template instantiation. During template instantiation, we substitute all levels of template arguments simultaneously. llvm-svn: 80389
* Bye-bye old RequireCompleteType.Anders Carlsson2009-08-261-16/+18
| | | | llvm-svn: 80182
* Remove the PrintType argument from RequireCompleteType.Anders Carlsson2009-08-261-17/+16
| | | | llvm-svn: 80174
* When a member reference expression includes a qualifier on the memberDouglas Gregor2009-08-261-18/+33
| | | | | | | | | | | | | | | | | name, e.g., x->Base::f() retain the qualifier (and its source range information) in a new subclass of MemberExpr called CXXQualifiedMemberExpr. Provide construction, transformation, profiling, printing, etc., for this new expression type. When a virtual function is called via a qualified name, don't emit a virtual call. Instead, call that function directly. Mike, could you add a CodeGen test for this, too? llvm-svn: 80167
* update to CXXFunctionalCastExpr to support ir-gen forFariborz Jahanian2009-08-261-4/+7
| | | | | | type convesions of class objects [class.conv]. WIP. llvm-svn: 80127
* Add Sema::BuildMemberReferenceExpr and have Sema::ActOnMemberReferenceExpr ↵Anders Carlsson2009-08-261-36/+51
| | | | | | call it. llvm-svn: 80122
* Source location information for ? and : in a ConditionalOperator, from Enea ↵Douglas Gregor2009-08-261-2/+2
| | | | | | Zaffanella llvm-svn: 80097
* Parsing of pseudo-destructors.Anders Carlsson2009-08-251-1/+0
| | | | llvm-svn: 80055
* Clarify the difference between substitution and instantiation by renamingJohn McCall2009-08-251-1/+1
| | | | | | functions that don't instantiate definitions. llvm-svn: 80037
* Factor building of CXXDefaultArgExpr expressions out into a separate function.Anders Carlsson2009-08-251-52/+59
| | | | llvm-svn: 79974
* Basic support for default argument expressions for function templates.Anders Carlsson2009-08-251-0/+27
| | | | llvm-svn: 79972
* Factor setting default arguments out into SetParamDefaultArgument.Anders Carlsson2009-08-251-4/+5
| | | | llvm-svn: 79970
* Use the right cast kind when comparing null to member pointers.Anders Carlsson2009-08-241-2/+2
| | | | llvm-svn: 79927
* Implement support for equality comparisons (!=, ==) of memberDouglas Gregor2009-08-241-5/+38
| | | | | | | | | | pointers, by extending the "composite pointer type" logic to include member pointer types. Introduce test cases for member pointer comparisons, including those that involve the builtin operator candidates implemented earlier. llvm-svn: 79925
* Catch a few more cases of illegal comparisons.Eli Friedman2009-08-231-27/+23
| | | | llvm-svn: 79793
* Eli points out that we really must diagnose "void* > 0" as an extension. Chris Lattner2009-08-231-8/+19
| | | | | | | Explicitly add it as an EXTENSION instead of an EXTWARN so that it only comes out with -pedantic. Thanks Eli! llvm-svn: 79791
* Type of a ?: expression whose either expression is a built-in 'id'Fariborz Jahanian2009-08-221-2/+2
| | | | | | type is 'id' type. llvm-svn: 79781
* tweak some pointer sema checking stuff (which was added to implement PR4175) to Chris Lattner2009-08-221-12/+14
| | | | | | | | | | | avoid emitting a warning on "someptr > 0". This is obviously questionable (they could use != instead) but is reasonable, and the warning "ordered comparison between pointer and integer" didn't make a ton of sense because 0 is a valid null pointer constant. Just silence the warning in this case, it is unlikely to indicate a bug. llvm-svn: 79743
* Implement support for calling member function templates, which involves:Douglas Gregor2009-08-211-6/+30
| | | | | | | | | | - Allowing one to name a member function template within a class template and on the right-hand side of a member access expression. - Template argument deduction for calls to member function templates. - Registering specializations of member function templates (and finding them later). llvm-svn: 79581
* Using "ObjCImplicitSetterGetterRefExpr" instead of ↵Fariborz Jahanian2009-08-201-2/+2
| | | | | | | | "ObjCImplctSetterGetterRefExpr". A field rename and more comments. llvm-svn: 79537
* Fix bit-field promotion to be a bit closer to the behavior of gcc. Eli Friedman2009-08-201-60/+19
| | | | | | | Patch by Enea Zaffanella, with some simplifications/corrections to isPromotableBitField by me. llvm-svn: 79510
* Make integer promotions work correctly on PIC16 and other platforms Eli Friedman2009-08-191-148/+10
| | | | | | | | where sizeof(short) == sizeof(int). Move UsualArithmeticConversionsType out of Sema, since it was only there as a historical artifact. Patch by Enea Zaffanella. llvm-svn: 79412
* Use Sema's LocInfoType to pass and preserve type source info through the Parser.Argyrios Kyrtzidis2009-08-191-7/+12
| | | | llvm-svn: 79395
* Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.Fariborz Jahanian2009-08-181-12/+8
| | | | | | | | Removed an unnecessary loop to get to setters incoming argument. Added DoxyGen comments. Still more work to do in this area (WIP). llvm-svn: 79365
* Initial patch to support definitions of id and Class from headers in ↵David Chisnall2009-08-171-5/+53
| | | | | | | | | | Objective-C code. This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa. Approved by snaroff. llvm-svn: 79248
* Make sure to call MaybeBindToTemporary when creating CallExprs.Anders Carlsson2009-08-161-1/+1
| | | | llvm-svn: 79168
* Move builtin call checking out into a separate function, make ↵Anders Carlsson2009-08-161-4/+11
| | | | | | CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change. llvm-svn: 79157
* Don't perform integer promotions on the operand to a cast; this Eli Friedman2009-08-151-1/+1
| | | | | | | simplifies the AST, and can matter in some rare cases involving casts to vector types. Patch by Enea Zaffanella. llvm-svn: 79126
* Make the CXXDefaultArgExpr constructor protected and add a static Create ↵Anders Carlsson2009-08-141-1/+1
| | | | | | function. llvm-svn: 79013
* Take 2 on AltiVec-style vector initializers. Nate Begeman2009-08-101-6/+89
| | | | | | | | | | | | Fixes PR4704 problems Addresses Eli's patch feedback re: ugly cast code Updates all postfix operators to remove ParenListExprs. While this is awful, no better solution (say, in the parser) is obvious to me. Better solutions welcome. llvm-svn: 78621
* Revert r78535, it is causing a number of failures to build projects.Daniel Dunbar2009-08-101-81/+2
| | | | | | | | | | | | | | | | | | | | | | | | --- Reverse-merging r78535 into '.': D test/Sema/altivec-init.c U include/clang/Basic/DiagnosticSemaKinds.td U include/clang/AST/Expr.h U include/clang/AST/StmtNodes.def U include/clang/Parse/Parser.h U include/clang/Parse/Action.h U tools/clang-cc/clang-cc.cpp U lib/Frontend/PrintParserCallbacks.cpp U lib/CodeGen/CGExprScalar.cpp U lib/Sema/SemaInit.cpp U lib/Sema/Sema.h U lib/Sema/SemaExpr.cpp U lib/Sema/SemaTemplateInstantiateExpr.cpp U lib/AST/StmtProfile.cpp U lib/AST/Expr.cpp U lib/AST/StmtPrinter.cpp U lib/Parse/ParseExpr.cpp U lib/Parse/ParseExprCXX.cpp llvm-svn: 78551
* AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);Nate Begeman2009-08-091-2/+81
| | | | | | | | In addition to being defined by the AltiVec PIM, this is also the vector initializer syntax used by OpenCL, so that vector literals are compatible with macro arguments. llvm-svn: 78535
* PR4700 - remove shift by 0 warningRyan Flynn2009-08-081-10/+1
| | | | llvm-svn: 78488
* Make sure to diagnose use of declarations in the case where we create an ↵Anders Carlsson2009-08-081-0/+2
| | | | | | implicit CXXThisExpr. llvm-svn: 78474
* Add a CK_ArrayToPointerDecay cast kind.Anders Carlsson2009-08-071-1/+2
| | | | llvm-svn: 78434
* Add CK_ToUnion and use it for aggregate expression codegen.Anders Carlsson2009-08-071-0/+2
| | | | llvm-svn: 78429
* More CastKind work.Anders Carlsson2009-08-071-5/+8
| | | | llvm-svn: 78415
* PR3333: warn when shifting by invalid amountRyan Flynn2009-08-071-0/+23
| | | | llvm-svn: 78385
* Implement transformation of nested-name-specifiers within the generalDouglas Gregor2009-08-061-2/+1
| | | | | | | tree transformation. Template instantiation uses this general transformation rather than implementing its own transformation. llvm-svn: 78286
* Support nested-name-specifiers for C++ member access expressions, e.g.,Douglas Gregor2009-08-061-6/+33
| | | | | | | | this->Base::foo from James Porter! llvm-svn: 78278
* Canonicalize else.Mike Stump2009-08-041-20/+12
| | | | llvm-svn: 78102
* Add CK_DerivedToBase and use it PerformObjectMemberConversion.Anders Carlsson2009-07-311-1/+2
| | | | llvm-svn: 77652
* Add a CastKind enum to CastExpr. Right now it's not used for much but it ↵Anders Carlsson2009-07-311-2/+2
| | | | | | will be :) llvm-svn: 77650
* Change uses of:Ted Kremenek2009-07-291-48/+48
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Some refactoring of member access forFariborz Jahanian2009-07-291-16/+14
| | | | | | performace sake. Also added a test case. llvm-svn: 77502
* Check accessibility when converting object to the baseFariborz Jahanian2009-07-291-4/+18
| | | | | | class. llvm-svn: 77497
* Patch to provide cast of objects in member accessFariborz Jahanian2009-07-291-0/+18
| | | | | | | excpression, if needed, and remove some ir-gen code now unnencessary. llvm-svn: 77490
* [llvm up]Douglas Gregor2009-07-291-0/+2
| | | | | | | | | A template name can refer to a set of overloaded function templates. Model this in TemplateName, which can now refer to an OverloadedFunctionDecl that contains function templates. This removes an unspeakable hack in Sema::isTemplateName. llvm-svn: 77488
* Fix <rdar://problem/7100524> regression: "error: incompatible operand types ↵Steve Naroff2009-07-291-0/+19
| | | | | | | | | ('void *' and 'NSString *')". Remove XFAIL from 'conditional-expr-4.m' test case (which would have caught this). Also tweaked several aspects of the test to jive with the current type checking. llvm-svn: 77453
* Incorporate feedback from Chris (on r76979).Steve Naroff2009-07-291-2/+2
| | | | llvm-svn: 77452
OpenPOWER on IntegriCloud