summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2011-04-11More __unknown_anytype work.John McCall
llvm-svn: 129269
2011-04-11Remove CK_DynamicToNull.Anders Carlsson
llvm-svn: 129265
2011-04-10As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind whichAnders Carlsson
represents a dynamic cast where we know that the result is always null. For example: struct A { virtual ~A(); }; struct B final : A { }; struct C { }; bool f(B* b) { return dynamic_cast<C*>(b); } llvm-svn: 129256
2011-04-10PR9580: Handle vectors correctly in ScalarExprEmitter::EmitRem.Eli Friedman
While I'm here, FileCheck-ize the ext-vector test, so we actually check what it is generating. llvm-svn: 129241
2011-04-07Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall
The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
2011-03-30Fix in r128471 is very broad. Some of the unconditional branches need line ↵Devang Patel
number information for better user experience. Restrict the fix. This fixes break.exp failures from gdb testsuite. llvm-svn: 128513
2011-03-28refactoringAnton Yartsev
llvm-svn: 128427
2011-03-27AltiVec vector comparison logic now affect only vectors of fundamental ↵Anton Yartsev
AltiVec vector types. It fixes bug 9347. llvm-svn: 128381
2011-03-16Don't emit read barriers for reading __weak __block variablesJohn McCall
in non-GC mode. llvm-svn: 127725
2011-03-11Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne
extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
2011-03-07DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel
attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
2011-03-07Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user ↵Devang Patel
experience. 21 int main() { 22 A a; For example, here user would expect to stop at line 22, even if A's constructor leads to a call through CXXDefaultArgExpr. This fixes ostream-defined.exp regression from gdb testsuite. llvm-svn: 127164
2011-03-02IRGen. Fix IR when message returns reference type.Fariborz Jahanian
// rdar://8604515. llvm-svn: 126869
2011-03-02PR9350: increment/decrement of char (and anything else narrower than int)Eli Friedman
can't overflow due to promotion rules; emit a wrapping add for those cases. llvm-svn: 126816
2011-03-01-fwrapv should turn off the inbounds markers from geps used for pointerChris Lattner
arithmetic. This is part of PR9256, it would be great if someone else wired up -fno-strict-overflow in the driver to -fwrapv. llvm-svn: 126718
2011-02-27Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner
a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
2011-02-17Remove the "conditional save" hashtables from IR generation.John McCall
llvm-svn: 125761
2011-02-17Change the representation of GNU ?: expressions to use a different expressionJohn McCall
class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
2011-02-16Save a copy expression for non-trivial copy constructions of catch variables.John McCall
llvm-svn: 125661
2011-02-15Assorted cleanup:John McCall
- Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
2011-02-15update for ConstantVector API change.Chris Lattner
llvm-svn: 125538
2011-02-14revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner
builders unhappy. llvm-svn: 125505
2011-02-14update for ConstantVector::get API change.Chris Lattner
llvm-svn: 125488
2011-02-07A few more tweaks to the blocks AST representation: John McCall
- BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
2011-02-07pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)Anton Yartsev
llvm-svn: 125000
2011-02-03More capturing of 'this': implicit member expressions. Getting thatJohn McCall
right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
2011-01-26Better framework for conditional cleanups; untested as yet.John McCall
I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
2011-01-24Revert r124146 for now. It appears to be failing on a few platforms.Eric Christopher
llvm-svn: 124153
2011-01-24pre/post increase/decrease for AltiVec vectorsAnton Yartsev
llvm-svn: 124146
2011-01-22Send code generation for xvalues down the same path as lvaluesDouglas Gregor
llvm-svn: 124023
2011-01-19Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall
thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
2011-01-19Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck
counterparts where char units are needed. llvm-svn: 123805
2011-01-13Ensure an insertion point at the end of a statement-expression.John McCall
Fixes PR8967. llvm-svn: 123360
2011-01-12Add IR generation support for SizeOfPackExpr.Douglas Gregor
llvm-svn: 123332
2010-12-08Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet
BinaryTypeTraitExpr. llvm-svn: 121298
2010-12-07Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet
New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
2010-12-06Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall
reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
2010-12-05Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall
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++. llvm-svn: 120931
2010-12-04Silly special case: never load when dereferencing void*.John McCall
llvm-svn: 120905
2010-12-04Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall
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. llvm-svn: 120890
2010-12-04Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall
the l-value. llvm-svn: 120884
2010-12-02Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall
ObjCPropertyRefExpr into the latter. llvm-svn: 120643
2010-12-01Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall
llvm-svn: 120555
2010-11-30L-value to r-value conversion is not ready for prime-time.John McCall
llvm-svn: 120433
2010-11-30Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall
about the reliability of this yet. llvm-svn: 120422
2010-11-24Switch a lot of call-sites over to using the new value-kind calculations.John McCall
llvm-svn: 120084
2010-11-18comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev
llvm-svn: 119678
2010-11-16Simplify some complex emission and implement correct semantics forJohn McCall
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. llvm-svn: 119344
2010-11-16Now that we have reliable cast kinds, simplify scalar cast IR gen.John McCall
llvm-svn: 119332