summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAge
...
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-19
| | | | | | | | thousand other things which were (generally inadvertantly) relying on that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck2011-01-19
| | | | | | | counterparts where char units are needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123805 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure an insertion point at the end of a statement-expression.John McCall2011-01-13
| | | | | | | | Fixes PR8967. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123360 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IR generation support for SizeOfPackExpr.Douglas Gregor2011-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123332 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-08
| | | | | | BinaryTypeTraitExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-07
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121074 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-06
| | | | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-05
| | | | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120931 91177308-0d34-0410-b5e6-96231b3b80d8
* Silly special case: never load when dereferencing void*.John McCall2010-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120905 91177308-0d34-0410-b5e6-96231b3b80d8
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-04
| | | | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-04
| | | | | | | | the l-value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120884 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-02
| | | | | | | | | | ObjCPropertyRefExpr into the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall2010-12-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120555 91177308-0d34-0410-b5e6-96231b3b80d8
* L-value to r-value conversion is not ready for prime-time.John McCall2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120433 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall2010-11-30
| | | | | | | | about the reliability of this yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120422 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch a lot of call-sites over to using the new value-kind calculations.John McCall2010-11-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120084 91177308-0d34-0410-b5e6-96231b3b80d8
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some complex emission and implement correct semantics forJohn McCall2010-11-16
| | | | | | | | | | | assignment to volatiles in C. This in effect reverts some of mjs's work in and around r72572. Basically, the C++ standard is quite clear, except that it lies about volatile behavior approximating C's, whereas the C standard is almost actively misleading. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119344 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that we have reliable cast kinds, simplify scalar cast IR gen.John McCall2010-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119332 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall2010-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119331 91177308-0d34-0410-b5e6-96231b3b80d8
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119138 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-14
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-13
| | | | | | | | between complex types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118994 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118966 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson2010-10-31
| | | | | | getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
* More class anonymization.Benjamin Kramer2010-10-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117106 91177308-0d34-0410-b5e6-96231b3b80d8
* Permit constant evaluation of const floating-point variables withJohn McCall2010-10-09
| | | | | | | | constant initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighter check in r116060 blcoked enums also. Emit enum const's debug info.Devang Patel2010-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116071 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not repeat debug info for file variable constants.Devang Patel2010-10-08
| | | | | | | This is tested by file-statics.exp in gdb testsuite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116060 91177308-0d34-0410-b5e6-96231b3b80d8
* dyn_cast is more appropriate here.Devang Patel2010-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115569 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing '}' :)Devang Patel2010-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115568 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit debug info for an aggregate while processing MemberExpr if the ↵Devang Patel2010-10-04
| | | | | | aggregate's debug info was delayed untill now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115564 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch implements passing arrays to functions expectingFariborz Jahanian2010-09-24
| | | | | | | vla. Implements pr7827. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes an IRgen ICE due to cast of null pointer toFariborz Jahanian2010-09-21
| | | | | | | a vla type (fixes pr7827). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114495 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in support for OpenCL conditional operator on vector types.Nate Begeman2010-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114371 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a -ftrapv-handler= option which allows a handler to invoke instead of ↵David Chisnall2010-09-17
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114192 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch to add IRgen support for Gnu's conditional operatorFariborz Jahanian2010-09-17
| | | | | | | | | extension when missing LHS. This patch covers scalar conditionals only. Others are wip. (pr7726, radar 8353567). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114182 91177308-0d34-0410-b5e6-96231b3b80d8
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-15
| | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
* Eagerly evaluate type traits in Sema instead of lazily in AST. They actually ↵Sebastian Redl2010-09-13
| | | | | | need Sema access to be correct, fixes coming up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113782 91177308-0d34-0410-b5e6-96231b3b80d8
* Augment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.Chris Lattner2010-09-11
| | | | | | | | Patch by John Regehr! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113705 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement CXXNoexceptExpr codegen.Sebastian Redl2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113629 91177308-0d34-0410-b5e6-96231b3b80d8
* Casting of a property reference to 'void' did notFariborz Jahanian2010-09-04
| | | | | | | | generate the necessary code. This patch fixes it. // rdar://8389655 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113079 91177308-0d34-0410-b5e6-96231b3b80d8
* Truncate block variable of bool type to i1 when itsFariborz Jahanian2010-09-03
| | | | | | | | value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113027 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Fix silly thinko in r112021, which was generating code for the same exprDaniel Dunbar2010-09-03
| | | | | | | twice. This showed up as an assert on the odd test case because we generated the decl map entry twice. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112943 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-31
| | | | | | | | under the ARM ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112588 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my user-defined literal commits - r1124{58,60,67} pendingSean Hunt2010-08-30
| | | | | | some issues being sorted out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
* Two minor fixes to user-defined literals:Sean Hunt2010-08-30
| | | | | | | - Zero-initialize UDLData so that crashes stop - Stop complaining that we can't emit them (we most certainly can) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112467 91177308-0d34-0410-b5e6-96231b3b80d8
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-25
| | | | | | | | to the new constants. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112044 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Fix a horrible bug in pointer to bool conversion, which we were treatingDaniel Dunbar2010-08-25
| | | | | | as a truncation not a comparison to null. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112021 91177308-0d34-0410-b5e6-96231b3b80d8