summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Augment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.Chris Lattner2010-09-111-4/+65
| | | | | | Patch by John Regehr! llvm-svn: 113705
* Implement CXXNoexceptExpr codegen.Sebastian Redl2010-09-101-0/+4
| | | | llvm-svn: 113629
* Casting of a property reference to 'void' did notFariborz Jahanian2010-09-041-2/+7
| | | | | | | generate the necessary code. This patch fixes it. // rdar://8389655 llvm-svn: 113079
* Truncate block variable of bool type to i1 when itsFariborz Jahanian2010-09-031-1/+1
| | | | | | | value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). llvm-svn: 113027
* IRgen: Fix silly thinko in r112021, which was generating code for the same exprDaniel Dunbar2010-09-031-1/+1
| | | | | | | twice. This showed up as an assert on the odd test case because we generated the decl map entry twice. llvm-svn: 112943
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-0/+1
| | | | | | under the ARM ABI. llvm-svn: 112588
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-3/+0
| | | | | | some issues being sorted out. llvm-svn: 112493
* Two minor fixes to user-defined literals:Alexis Hunt2010-08-301-0/+3
| | | | | | | - Zero-initialize UDLData so that crashes stop - Stop complaining that we can't emit them (we most certainly can) llvm-svn: 112467
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-66/+66
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-251-1/+1
| | | | llvm-svn: 112044
* IRgen: Fix a horrible bug in pointer to bool conversion, which we were treatingDaniel Dunbar2010-08-251-2/+7
| | | | | | as a truncation not a comparison to null. llvm-svn: 112021
* Emit an error noting that Clang does not support code generation forDouglas Gregor2010-08-231-1/+6
| | | | | | | the ternary operator without a left-hand side in C++ (PR7726), from Jean-Daniel Dupas! llvm-svn: 111809
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-52/+21
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Eliminate a stale assertion. Fixes Clang self-host.Douglas Gregor2010-08-221-4/+1
| | | | llvm-svn: 111782
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-221-3/+26
| | | | | | | | | | pointers. I find the resulting code to be substantially cleaner, and it makes it very easy to use the same APIs for data member pointers (which I have conscientiously avoided here), and it avoids a plethora of potential inefficiencies due to excessive memory copying, but we'll have to see if it actually works. llvm-svn: 111776
* Extract member function pointer comparison and null comparison intoJohn McCall2010-08-221-24/+5
| | | | | | | | | | | | the ABI code. Implement correct semantics for these on ARM. I believe this completes the implementation of member function pointers on ARM. I think I'm going to switch member function pointers over to be non-aggregates while I have all this in mind. llvm-svn: 111774
* IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.Daniel Dunbar2010-08-211-14/+10
| | | | llvm-svn: 111716
* Zap unused UnaryOperator::OffsetOf.Eli Friedman2010-08-131-7/+0
| | | | llvm-svn: 110996
* Simplify code and add comments, in code that generate debug info for ↵Devang Patel2010-08-101-2/+4
| | | | | | constant integer globals, based on Chris's feedback. llvm-svn: 110694
* Even if a constant's evaluated value is used, emit debug info for the ↵Devang Patel2010-08-101-0/+1
| | | | | | constant variable. llvm-svn: 110660
* 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
OpenPOWER on IntegriCloud