summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2010-11-16Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall
llvm-svn: 119331
2010-11-15Assorted work leading towards the elimination of CK_Unknown.John McCall
llvm-svn: 119138
2010-11-14Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall
implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
2010-11-13Introduce five new cast kinds for various conversions into andJohn McCall
between complex types. llvm-svn: 118994
2010-11-13Introduce a null-to-pointer implicit cast kind.John McCall
llvm-svn: 118966
2010-10-31Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson
getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
2010-10-22More class anonymization.Benjamin Kramer
llvm-svn: 117106
2010-10-09Permit constant evaluation of const floating-point variables withJohn McCall
constant initializers. llvm-svn: 116138
2010-10-08Tighter check in r116060 blcoked enums also. Emit enum const's debug info.Devang Patel
llvm-svn: 116071
2010-10-08Do not repeat debug info for file variable constants.Devang Patel
This is tested by file-statics.exp in gdb testsuite. llvm-svn: 116060
2010-10-04dyn_cast is more appropriate here.Devang Patel
llvm-svn: 115569
2010-10-04Add missing '}' :)Devang Patel
llvm-svn: 115568
2010-10-04Emit debug info for an aggregate while processing MemberExpr if the ↵Devang Patel
aggregate's debug info was delayed untill now. llvm-svn: 115564
2010-09-24Patch implements passing arrays to functions expectingFariborz Jahanian
vla. Implements pr7827. llvm-svn: 114737
2010-09-21Fixes an IRgen ICE due to cast of null pointer toFariborz Jahanian
a vla type (fixes pr7827). llvm-svn: 114495
2010-09-20Check in support for OpenCL conditional operator on vector types.Nate Begeman
llvm-svn: 114371
2010-09-17Add a -ftrapv-handler= option which allows a handler to invoke instead of ↵David Chisnall
simply aborting when a signed operation overflows. This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit. llvm-svn: 114192
2010-09-17Patch to add IRgen support for Gnu's conditional operatorFariborz Jahanian
extension when missing LHS. This patch covers scalar conditionals only. Others are wip. (pr7726, radar 8353567). llvm-svn: 114182
2010-09-15one piece of code is responsible for the lifetime of every aggregateJohn McCall
slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
2010-09-13Eagerly evaluate type traits in Sema instead of lazily in AST. They actually ↵Sebastian Redl
need Sema access to be correct, fixes coming up. llvm-svn: 113782
2010-09-11Augment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.Chris Lattner
Patch by John Regehr! llvm-svn: 113705
2010-09-10Implement CXXNoexceptExpr codegen.Sebastian Redl
llvm-svn: 113629
2010-09-04Casting of a property reference to 'void' did notFariborz Jahanian
generate the necessary code. This patch fixes it. // rdar://8389655 llvm-svn: 113079
2010-09-03Truncate block variable of bool type to i1 when itsFariborz Jahanian
value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). llvm-svn: 113027
2010-09-03IRgen: Fix silly thinko in r112021, which was generating code for the same exprDaniel Dunbar
twice. This showed up as an assert on the odd test case because we generated the decl map entry twice. llvm-svn: 112943
2010-08-31Teach IR generation to return 'this' from constructors and destructorsJohn McCall
under the ARM ABI. llvm-svn: 112588
2010-08-30Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt
some issues being sorted out. llvm-svn: 112493
2010-08-30Two minor fixes to user-defined literals:Alexis Hunt
- Zero-initialize UDLData so that crashes stop - Stop complaining that we can't emit them (we most certainly can) llvm-svn: 112467
2010-08-25GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall
to the new constants. llvm-svn: 112047
2010-08-25More incremental progress towards not including Expr.h in Sema.h.John McCall
llvm-svn: 112044
2010-08-25IRgen: Fix a horrible bug in pointer to bool conversion, which we were treatingDaniel Dunbar
as a truncation not a comparison to null. llvm-svn: 112021
2010-08-23Emit an error noting that Clang does not support code generation forDouglas Gregor
the ternary operator without a left-hand side in C++ (PR7726), from Jean-Daniel Dupas! llvm-svn: 111809
2010-08-23Abstract out everything having to do with member pointers into the ABIJohn McCall
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
2010-08-22Eliminate a stale assertion. Fixes Clang self-host.Douglas Gregor
llvm-svn: 111782
2010-08-22Experiment with using first-class aggregates to represent member functionJohn McCall
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
2010-08-22Extract member function pointer comparison and null comparison intoJohn McCall
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
2010-08-21IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.Daniel Dunbar
llvm-svn: 111716
2010-08-13Zap unused UnaryOperator::OffsetOf.Eli Friedman
llvm-svn: 110996
2010-08-10Simplify code and add comments, in code that generate debug info for ↵Devang Patel
constant integer globals, based on Chris's feedback. llvm-svn: 110694
2010-08-10Even if a constant's evaluated value is used, emit debug info for the ↵Devang Patel
constant variable. llvm-svn: 110660
2010-08-07Allow reference binding of a reference of Objective-C object type toDouglas Gregor
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
2010-08-07Store inheritance paths after CastExprs instead of inside them.John McCall
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
2010-08-07Correct -ftrapv to trap on errors, instead of calling theChris Lattner
__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
2010-08-06Initialize variable to work around warning; unfortunately, there isn't anyEli Friedman
way to tell gcc "really, values outside the enum aren't valid". llvm-svn: 110450
2010-08-06Attempt to fix uninitialized value warning reported on cfe-commits.Eli Friedman
llvm-svn: 110418
2010-08-05Argument evaluation order is not guaranteed. Split these out to force an order.John McCall
llvm-svn: 110354
2010-08-05Fix a major bug with -ftrapv and ++/--. Patch by David Keaton!John McCall
llvm-svn: 110347
2010-08-05Add IRGen support for non-constant OffsetOfExpr.Eli Friedman
llvm-svn: 110326
2010-07-23Vectors are not integer types, so the type system should not classifyDouglas Gregor
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
2010-07-20Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl
llvm-svn: 108807