summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2009-08-13Update for LLVM API change.Owen Anderson
llvm-svn: 78946
2009-08-12Use the new nsw form of add for signed integer addition.Dan Gohman
llvm-svn: 78765
2009-08-12Use the inbounds variant of getelementptr for common pointer arithmetic.Dan Gohman
llvm-svn: 78756
2009-08-11Remove the hack that turns sdiv by a power of 2 to ashr, andDan Gohman
use the new "exact" sdiv to allow LLVM optimization to perform this transformation. llvm-svn: 78739
2009-08-10Take 2 on AltiVec-style vector initializers. Nate Begeman
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
2009-08-10Revert r78535, it is causing a number of failures to build projects.Daniel Dunbar
--- 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
2009-08-09Improve handling of member pointers.Anders Carlsson
llvm-svn: 78536
2009-08-09AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);Nate Begeman
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
2009-08-07Add a CK_ArrayToPointerDecay cast kind.Anders Carlsson
llvm-svn: 78434
2009-07-31Update for LLVM API change.Owen Anderson
llvm-svn: 77722
2009-07-31Update for LLVM API change.Owen Anderson
llvm-svn: 77686
2009-07-30Update for LLVM API changes.Owen Anderson
llvm-svn: 77638
2009-07-30Canonicalize else spacing.Mike Stump
llvm-svn: 77629
2009-07-29Update for LLVM API change.Owen Anderson
llvm-svn: 77514
2009-07-29Change uses of:Ted Kremenek
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
2009-07-29Code refactoring to define getCXXRecordDeclForPointerTypeFariborz Jahanian
and use it in several places. llvm-svn: 77411
2009-07-28ir-gen derived-to-base conversion in implicit casts.Fariborz Jahanian
llvm-svn: 77374
2009-07-28Update for LLVM API change.Owen Anderson
llvm-svn: 77368
2009-07-27Update for LLVM API change.Owen Anderson
llvm-svn: 77249
2009-07-24Update for LLVM API change.Owen Anderson
llvm-svn: 77012
2009-07-22Make vectorized floating-point comparisons work without crashing.Eli Friedman
llvm-svn: 76726
2009-07-21Update for LLVM API change.Owen Anderson
llvm-svn: 76599
2009-07-18Revert r75641.Anders Carlsson
llvm-svn: 76327
2009-07-17Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek
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
2009-07-16ir-gen for --/++ operators of objc object pointersFariborz Jahanian
in 32bit abi. llvm-svn: 76109
2009-07-16Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek
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
2009-07-14Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson
llvm-svn: 75705
2009-07-14Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).Steve Naroff
I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace. llvm-svn: 75650
2009-07-14Rename RecordLayout.h to ASTRecordLayout.hAnders Carlsson
llvm-svn: 75641
2009-07-13Update for LLVM API change.Owen Anderson
llvm-svn: 75446
2009-07-10This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff
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
2009-07-08reimplement vector comparisons as [fi]cmp+sext instead of using v[if]cmp.Chris Lattner
Also, enable them in sema so that they are tested, and now that the x86 backend has stablized. llvm-svn: 74983
2009-06-17Update clang for the add ->add/fadd split. Likewise for sub and mul.Chris Lattner
llvm-svn: 73604
2009-06-04Use PushConditionalTempDestruction/PopConditionalTempDestruction for the ↵Anders Carlsson
ternary operator. llvm-svn: 72842
2009-06-04Use conditional temp destruction for || and &&.Anders Carlsson
llvm-svn: 72838
2009-05-31Add a new function for emitting new functions.Anders Carlsson
llvm-svn: 72656
2009-05-31Call EmitCXXExprWithTemporaries.Anders Carlsson
llvm-svn: 72652
2009-05-29Fixup the rest of the trivial cases of the codegen of volatile. IfMike Stump
any body can spot codegen bugs with volatile, or knows of any in the bug database, let me know. llvm-svn: 72572
2009-05-27Functions that return references can be rvalues as well.Anders Carlsson
llvm-svn: 72457
2009-05-22Fixup codegen for __block int i; i += rhs();. Should also slightlyMike Stump
improve codegen in some cases. llvm-svn: 72273
2009-05-21Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhsMike Stump
evaluated first. This can also improve codegen just a bit as we might have another register to play with for the evaluation of the rhs. llvm-svn: 72226
2009-05-19Don't always zext the result of the not unary operator to an int.Anders Carlsson
llvm-svn: 72117
2009-05-19Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. ↵Anders Carlsson
Stub out VisitCXXExprWithTemporaries. llvm-svn: 72103
2009-04-25Fix pointer addressing and array subscripting of Objective-C interfaceDaniel Dunbar
types. - I broke this in the switch to representing interfaces with opaque types. - <rdar://problem/6822660> clang crashes on subscript of interface in 32-bit mode llvm-svn: 70009
2009-04-24Clang part of r69947. Reverting back 69574 as it is no longer needed.Sanjiv Gupta
llvm-svn: 69949
2009-04-20PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and Eli Friedman
subsequently crashed). llvm-svn: 69567
2009-04-20PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.Eli Friedman
Adapted from patch by Tim Northover. llvm-svn: 69566
2009-04-14Support code generation of 'this' exprsAnders Carlsson
llvm-svn: 69050
2009-04-08Make sure value is initialized when built w/o asserts.Daniel Dunbar
llvm-svn: 68615
2009-04-08Pointer width on targets like PIC16 is 16-bit, while the valid index size to ↵Sanjiv Gupta
GEP is only 32 or 64. So promote index to 32 in such cases. llvm-svn: 68590