summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow reference binding of a reference of Objective-C object type toDouglas Gregor2010-08-071-2/+6
| | | | | | | | an lvalue of another, compatible Objective-C object type (e.g., a subclass). Introduce a new initialization sequence step kind to describe this binding, along with a new cast kind. Fixes PR7741. llvm-svn: 110513
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-3/+5
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Correct -ftrapv to trap on errors, instead of calling theChris Lattner2010-08-071-43/+10
| | | | | | | | | | | | | | | | __overflow_handler entrypoint that David Chisnall made up. Calling __overflow_handler is not part of the contract of -ftrapv provided by GCC, and should never have been checked in in the first place. According to: http://permalink.gmane.org/gmane.comp.compilers.clang.devel/8699 David is using this for some of arbitrary precision integer stuff or something, which is not an appropriate thing to implement on this. llvm-svn: 110490
* Initialize variable to work around warning; unfortunately, there isn't anyEli Friedman2010-08-061-3/+3
| | | | | | way to tell gcc "really, values outside the enum aren't valid". llvm-svn: 110450
* Attempt to fix uninitialized value warning reported on cfe-commits.Eli Friedman2010-08-061-2/+1
| | | | llvm-svn: 110418
* Argument evaluation order is not guaranteed. Split these out to force an order.John McCall2010-08-051-6/+7
| | | | llvm-svn: 110354
* Fix a major bug with -ftrapv and ++/--. Patch by David Keaton!John McCall2010-08-051-1/+2
| | | | llvm-svn: 110347
* Add IRGen support for non-constant OffsetOfExpr.Eli Friedman2010-08-051-14/+90
| | | | llvm-svn: 110326
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-231-6/+6
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-2/+2
| | | | llvm-svn: 108807
* Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor2010-07-131-0/+9
| | | | | | | | | | | | | | | | reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g., int i; reinterpret_cast<short&>(i); The IR generated for this is essentially the same as for *reinterpret_cast<short*>(&i). Fixes PR6437, PR7593, and PR7344. llvm-svn: 108294
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-1/+1
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-071-1/+1
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-1/+1
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* IRgen: Assignment to Objective-C properties shouldn't reload the value (whichDaniel Dunbar2010-06-291-30/+42
| | | | | | | | would trigger an extra method call). - While in the area, I also changed Clang to not emit an unnecessary load from 'x' in cases like 'y = (x = 1)'. llvm-svn: 107210
* Fix UnitTests/2004-02-02-NegativeZero.c, which regressed whenChris Lattner2010-06-281-2/+6
| | | | | | I broke negate of FP values. llvm-svn: 107019
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-56/+41
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* fix inc/dec to honor -fwrapv and -ftrapv, implementing PR7426.Chris Lattner2010-06-261-4/+20
| | | | llvm-svn: 106962
* move scalar inc/dec codegen into ScalarExprEmitter instead Chris Lattner2010-06-261-8/+111
| | | | | | of being in CGF. No functionality change. llvm-svn: 106961
* use more efficient type comparison predicates.Chris Lattner2010-06-261-1/+1
| | | | llvm-svn: 106958
* Fix unary minus to trap on overflow with -ftrapv, refactoring binopChris Lattner2010-06-261-31/+34
| | | | | | code so we can use it from VisitUnaryMinus. llvm-svn: 106957
* Implement support for -fwrapv, rdar://7221421Chris Lattner2010-06-261-22/+44
| | | | | | | | | | | | As part of this, pull together trapv handling into the same enum. This also add support for NSW multiplies. This also makes PCH disagreement on overflow behavior silent, since it really doesn't matter except for warnings and codegen (no macros get defined etc). llvm-svn: 106956
* implement rdar://7432000 - signed negate should codegen as NSW.Chris Lattner2010-06-261-4/+9
| | | | | | While I'm in there, adjust pointer to member adjustments as well. llvm-svn: 106955
* Fix a gcc warning.Rafael Espindola2010-06-091-1/+1
| | | | llvm-svn: 105670
* Extend __builtin_shufflevector to expose the full power of the llvm ↵Nate Begeman2010-06-081-3/+95
| | | | | | shufflevector instruction. This means it can now be used for vector truncation and concatenation. This will be used for the ARM NEON implementation. llvm-svn: 105589
* Really fix PR7139. There was one boost test that we still failed, and my ↵Anders Carlsson2010-05-221-3/+19
| | | | | | first fix broke self-host. llvm-svn: 104447
* Unbreak self-host.Anders Carlsson2010-05-211-2/+2
| | | | llvm-svn: 104390
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-211-2/+2
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-3/+2
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Make sure that value-initialized pointers to data members are initialized ↵Anders Carlsson2010-05-141-1/+1
| | | | | | correctly. llvm-svn: 103771
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-281-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
* Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to ↵Anders Carlsson2010-04-241-1/+2
| | | | | | use the new version. llvm-svn: 102274
* Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.Anders Carlsson2010-04-241-7/+3
| | | | llvm-svn: 102273
* Add a new GetAddressOfBaseClass overload that takes a base path and. Use it ↵Anders Carlsson2010-04-241-9/+3
| | | | | | for derived-to-base casts. llvm-svn: 102270
* Handle compound assignment expressions (i += j) as lvalues, which isDouglas Gregor2010-04-231-11/+79
| | | | | | | permitted in C++ but not in C. Fixes PR6900. Clang can now handle all of Boost.Lambda's regression tests. llvm-svn: 102170
* IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.Daniel Dunbar2010-04-051-2/+2
| | | | | | | | | - Unfortunately, this requires some horrible code in CGObjCMac which always allocats a CGBitFieldInfo because we don't currently build a proper layout for Objective-C classes. It needs to be cleaned up, but I don't want the bit-field cleanups to be blocked on that. llvm-svn: 100474
* Introduce a new kind of derived-to-base cast which bypasses the need forJohn McCall2010-03-301-0/+4
| | | | | | | null checks, and make sure we elide null checks when accessing base class members. llvm-svn: 99963
* emit signed integer subtractions as 'sub nsw', patch byChris Lattner2010-03-291-0/+5
| | | | | | Anton Yartsev! llvm-svn: 99817
* Fix code gen bug generating code forFariborz Jahanian2010-03-031-0/+2
| | | | | | ((id)cat)->isa. Fixes radar 7709015. llvm-svn: 97672
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-8/+8
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96224
* Fix a code gen bug accessing 'isa' field via a message callFariborz Jahanian2010-02-051-5/+14
| | | | | | (Fixes radar 7609722). llvm-svn: 95406
* Rename StartConditionalBranch/FinishConditionalBranch to ↵Anders Carlsson2010-02-041-8/+8
| | | | | | BeginConditionalBranch/EndConditionalBranch. llvm-svn: 95308
* Move pointer to data member emission to CodeGenModule and use it in ↵Anders Carlsson2010-02-021-2/+0
| | | | | | CGExprConstant. Fixes PR5674. llvm-svn: 95063
* Some class related cleanup.Anders Carlsson2010-01-311-2/+2
| | | | llvm-svn: 94938
* Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck2010-01-111-7/+9
| | | | | | | | | | "ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. llvm-svn: 93153
* refactor pre/postinc logic into CGF and require the caller to pass in theChris Lattner2010-01-091-93/+4
| | | | | | lvalue to poke, no functionality change. llvm-svn: 93075
* Get rid of more dead code.Eli Friedman2010-01-031-47/+0
| | | | llvm-svn: 92439
* Remove some dead variables clang-analyzer found.Benjamin Kramer2009-12-251-1/+1
| | | | llvm-svn: 92162
* Remove ';' after method definition. Noticed by clang++, which one would thinkDaniel Dunbar2009-12-191-16/+16
| | | | | | | would have a higher respect for its own code. This is getting old, is this warning really adding value? llvm-svn: 91779
* It's perfectly fine to see UserDefinedConversion casts when emitting scalar ↵Anders Carlsson2009-12-181-1/+1
| | | | | | expressions. llvm-svn: 91686
OpenPOWER on IntegriCloud