summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Take 2 on AltiVec-style vector initializers. Nate Begeman2009-08-101-0/+28
| | | | | | | | | | | | 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-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | --- 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-0/+28
| | | | | | | | 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
* Get rid of Stmt::Clone now that we can reference count statements instead.Anders Carlsson2009-08-081-55/+0
| | | | llvm-svn: 78452
* Separate Stmt::Destroy into the entrypoint for destroying a statementDouglas Gregor2009-08-071-8/+7
| | | | | | | or expression (Destroy) from the virtual function used to actually destroy a given expression (DoDestroy). llvm-svn: 78375
* Change uses of:Ted Kremenek2009-07-291-6/+6
| | | | | | | | | | | | | | | | | | | | 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
* fix PR4633: cast to void should silence the 'unused expression' warning.Chris Lattner2009-07-281-4/+3
| | | | llvm-svn: 77344
* CallExpr's SubExprs sometimes were allocated in the wrong place.Daniel Dunbar2009-07-281-1/+1
| | | | llvm-svn: 77302
* Allow front-end 'isa' access on object's of type 'id'.Steve Naroff2009-07-241-0/+4
| | | | | | | | Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning). Still need back-end CodeGen for ObjCIsaExpr. llvm-svn: 76979
* Revert r75641.Anders Carlsson2009-07-181-0/+1
| | | | llvm-svn: 76327
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-6/+6
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* objc methods can't be an operand to callexpr.Chris Lattner2009-07-171-3/+1
| | | | llvm-svn: 76179
* Refactor code into a new CallExpr::getDirectCallee() method. Simplify someZhongxing Xu2009-07-171-0/+10
| | | | | | code with the new method. llvm-svn: 76164
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-171-1/+1
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* Remove ASTContext::isObjCObjectPointerType().Steve Naroff2009-07-161-1/+1
| | | | | | Convert all clients to use the new predicate on Type. llvm-svn: 76076
* Rename RecordLayout.h to ASTRecordLayout.hAnders Carlsson2009-07-141-1/+0
| | | | llvm-svn: 75641
* Read/write a CXXOperatorCallExpr from/to PCH files.Argyrios Kyrtzidis2009-07-141-2/+2
| | | | llvm-svn: 75598
* This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff2009-07-101-1/+1
| | | | | | | | | | | | The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
* Implement template argument deduction when taking the address of aDouglas Gregor2009-07-081-2/+3
| | | | | | | | function template. Most of the change here is in factoring out the common bits used for template argument deduction from a function call and when taking the address of a function template. llvm-svn: 75044
* Fix bitfield promotion in the presence of explicit casts, from Abrama Bagnara.Douglas Gregor2009-07-061-1/+1
| | | | llvm-svn: 74830
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-15/+15
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Fix the FloatingLiteral API to take the isexact flag by value instead ofChris Lattner2009-06-291-2/+1
| | | | | | by pointer. llvm-svn: 74432
* OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element ↵Nate Begeman2009-06-251-2/+2
| | | | | | index. llvm-svn: 74202
* Renamed Protocol as TheProtocol so people can use clang header forFariborz Jahanian2009-06-211-1/+1
| | | | | | building obj-c++ clients. "Protocol" is a class name in Cocoa.h llvm-svn: 73854
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-17/+18
| | | | llvm-svn: 73702
* Sink the BuiltinInfo object from ASTContext into theChris Lattner2009-06-141-0/+1
| | | | | | | | preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
* Instantiation support for more Obj-C expressions, string literals, @selector ↵Anders Carlsson2009-06-071-0/+16
| | | | | | and @protocol expressions. llvm-svn: 73036
* A corner case of objc2 gc's write-barrier generationFariborz Jahanian2009-06-011-9/+17
| | | | | | for the Next runtime. llvm-svn: 72703
* When evaluating a VarDecl as a constant or determining whether it isDouglas Gregor2009-05-261-2/+15
| | | | | | | | an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
* Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. ↵Anders Carlsson2009-05-261-9/+13
| | | | | | No intended functionality change. llvm-svn: 72410
* A block that returns a reference is an lvalue.Anders Carlsson2009-05-261-0/+3
| | | | llvm-svn: 72409
* Template instantiation for C99 designated initializers, because weDouglas Gregor2009-05-211-28/+49
| | | | | | | | can. Also, delay semantic analysis of initialization for value-dependent as well as type-dependent expressions, since we can't always properly type-check a value-dependent expression. llvm-svn: 72233
* Fix handling of the GNU "t ? : f" extension to the conditionalDouglas Gregor2009-05-191-4/+4
| | | | | | | operator in C++, and verify that template instantiation for the condition operator does the right thing. llvm-svn: 72127
* Template instantiation for imaginary literals, because they were next in Expr.hDouglas Gregor2009-05-181-0/+10
| | | | llvm-svn: 72058
* Make ActOnExprStmt take a FullExprArg.Anders Carlsson2009-05-171-0/+3
| | | | llvm-svn: 71989
* Implement instantiation of a few boring, simple expressions. I don't think ↵Sebastian Redl2009-05-161-0/+17
| | | | | | these are testable yet, though. llvm-svn: 71953
* Basic support for member exprs where the base expr type is dependent.Anders Carlsson2009-05-151-0/+5
| | | | llvm-svn: 71907
* Implement C++0x nullptr.Sebastian Redl2009-05-101-0/+4
| | | | llvm-svn: 71405
* Fixes a bug for objc2's gc in the presense of type-casts.Fariborz Jahanian2009-05-051-1/+3
| | | | llvm-svn: 71041
* PR2524: downgrade taking address of expression of type 'void' to an Eli Friedman2009-05-031-5/+11
| | | | | | extension warning. llvm-svn: 70805
* When determining whether an expression refers to a bit-field, lookDouglas Gregor2009-05-021-4/+10
| | | | | | | | | into the left-hand side of an assignment expression. This completes most of PR3500; the only remaining part is to deal with the GCC-specific implementation-defined behavior for "unsigned long" (and other) bit-fields. llvm-svn: 70623
* PR4103: Silence bogus unused expression warning.Eli Friedman2009-04-291-1/+2
| | | | llvm-svn: 70384
* Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman2009-04-261-1/+1
| | | | llvm-svn: 70145
* implement PCH support for the rest of ExprObjC.h, includingChris Lattner2009-04-261-0/+10
| | | | | | the missing bits of ObjCMessageExpr. llvm-svn: 70100
* Change isNullPointerConstant to be strict; hopefully this won't cause Eli Friedman2009-04-251-6/+2
| | | | | | any issues now that we have our own tgmath.h. llvm-svn: 70090
* Fix PR4027 + rdar://6808859, we were rejecting implicit casts ofChris Lattner2009-04-211-0/+1
| | | | | | aggregates even though we already accept explicit ones. Easy fix. llvm-svn: 69661
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-181-2/+6
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Fix two embarrassing PCH bugs:Douglas Gregor2009-04-171-1/+1
| | | | | | | | | 1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator 2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s. 403.gcc builds and links properly. llvm-svn: 69390
* Implement lvalue test for conditional expressions.Sebastian Redl2009-04-171-0/+26
| | | | | | Add a few commented lines to the test case that point out things that don't work yet. llvm-svn: 69354
OpenPOWER on IntegriCloud