summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate temporary argument vectors.Benjamin Kramer2011-05-281-3/+1
| | | | llvm-svn: 132260
* Introduce Type::isSignedIntegerOrEnumerationType() andDouglas Gregor2011-05-201-12/+12
| | | | | | | | | | | | | Type::isUnsignedIntegerOrEnumerationType(), which are like Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also consider the underlying type of a C++0x scoped enumeration type. Audited all callers to the existing functions, switching those that need to also handle scoped enumeration types (e.g., those that deal with constant values) over to the new functions. Fixes PR9923 / <rdar://problem/9447851>. llvm-svn: 131735
* Make __builtin_shufflevector and -ftrapv work correctly together. PR9945.Eli Friedman2011-05-191-11/+5
| | | | llvm-svn: 131611
* Don't emit nsw flags for vector operations; there's basically no benefit, ↵Eli Friedman2011-05-061-7/+4
| | | | | | and a lot of downside (like PR9850, which is about clang's xmmintrin.h making an unexpected transformation on an expression involving _mm_add_epi32). llvm-svn: 131000
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-281-0/+4
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* t/clang/expr-traitsJohn Wiegley2011-04-251-0/+4
| | | | | | | | | Patch authored by David Abrahams. These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for parsing code that employs certain features of the Embarcadero C++ compiler. llvm-svn: 130122
* some cleanups to use IRBuilder methods instead of llvm:: foo methods.Chris Lattner2011-04-191-42/+34
| | | | llvm-svn: 129829
* fix rdar://9289603 - clang should fold trivial ?: for enums as well as ↵Chris Lattner2011-04-161-3/+2
| | | | | | | | integer constants into select at -O0 by making the isCheapEnoughToEvaluateUnconditionally predicate handle anything that folds to a constant. In particular, we now fold enums. llvm-svn: 129649
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-2/+4
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* After some discussion with Doug, we decided that it made a lot more senseJohn McCall2011-04-121-16/+0
| | | | | | | | | for __unknown_anytype resolution to destructively modify the AST. So that's what it does now, which significantly simplifies some of the implementation. Normal member calls work pretty cleanly now, and I added support for propagating unknown-ness through &. llvm-svn: 129331
* More __unknown_anytype work.John McCall2011-04-111-0/+13
| | | | llvm-svn: 129269
* Remove CK_DynamicToNull.Anders Carlsson2011-04-111-2/+1
| | | | llvm-svn: 129265
* As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind whichAnders Carlsson2011-04-101-1/+2
| | | | | | | | | | | | | | | | | | 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
* PR9580: Handle vectors correctly in ScalarExprEmitter::EmitRem.Eli Friedman2011-04-101-1/+1
| | | | | | | While I'm here, FileCheck-ize the ext-vector test, so we actually check what it is generating. llvm-svn: 129241
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+3
| | | | | | | | | | | | 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
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-8/+4
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
* Fix in r128471 is very broad. Some of the unconditional branches need line ↵Devang Patel2011-03-301-0/+3
| | | | | | | | number information for better user experience. Restrict the fix. This fixes break.exp failures from gdb testsuite. llvm-svn: 128513
* refactoringAnton Yartsev2011-03-281-3/+1
| | | | llvm-svn: 128427
* AltiVec vector comparison logic now affect only vectors of fundamental ↵Anton Yartsev2011-03-271-1/+3
| | | | | | AltiVec vector types. It fixes bug 9347. llvm-svn: 128381
* Don't emit read barriers for reading __weak __block variablesJohn McCall2011-03-161-4/+2
| | | | | | in non-GC mode. llvm-svn: 127725
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-4/+5
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-2/+2
| | | | | | 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
* Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user ↵Devang Patel2011-03-071-1/+6
| | | | | | | | | | | | | 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
* IRGen. Fix IR when message returns reference type.Fariborz Jahanian2011-03-021-0/+3
| | | | | | // rdar://8604515. llvm-svn: 126869
* PR9350: increment/decrement of char (and anything else narrower than int)Eli Friedman2011-03-021-3/+5
| | | | | | can't overflow due to promotion rules; emit a wrapping add for those cases. llvm-svn: 126816
* -fwrapv should turn off the inbounds markers from geps used for pointerChris Lattner2011-03-011-33/+48
| | | | | | | 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
* Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner2011-02-271-6/+9
| | | | | | a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
* Remove the "conditional save" hashtables from IR generation.John McCall2011-02-171-5/+0
| | | | llvm-svn: 125761
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-54/+31
| | | | | | | | | | | | | | | | | | | | | | 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
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-0/+7
| | | | llvm-svn: 125661
* Assorted cleanup:John McCall2011-02-151-78/+97
| | | | | | | | | - 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
* update for ConstantVector API change.Chris Lattner2011-02-151-9/+9
| | | | llvm-svn: 125538
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-9/+9
| | | | | | builders unhappy. llvm-svn: 125505
* update for ConstantVector::get API change.Chris Lattner2011-02-141-9/+9
| | | | llvm-svn: 125488
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-2/+2
| | | | | | | | | | | | | | | | | - 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
* pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)Anton Yartsev2011-02-071-23/+48
| | | | llvm-svn: 125000
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-3/+3
| | | | | | | | | | | 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
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-18/+19
| | | | | | | | 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
* Revert r124146 for now. It appears to be failing on a few platforms.Eric Christopher2011-01-241-48/+23
| | | | llvm-svn: 124153
* pre/post increase/decrease for AltiVec vectorsAnton Yartsev2011-01-241-23/+48
| | | | llvm-svn: 124146
* Send code generation for xvalues down the same path as lvaluesDouglas Gregor2011-01-221-1/+1
| | | | llvm-svn: 124023
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-2/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck2011-01-191-2/+2
| | | | | | counterparts where char units are needed. llvm-svn: 123805
* Ensure an insertion point at the end of a statement-expression.John McCall2011-01-131-2/+4
| | | | | | Fixes PR8967. llvm-svn: 123360
* Add IR generation support for SizeOfPackExpr.Douglas Gregor2011-01-121-0/+5
| | | | llvm-svn: 123332
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-6/+1
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+4
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-2/+2
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-051-7/+4
| | | | | | | | | 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
* Silly special case: never load when dereferencing void*.John McCall2010-12-041-1/+5
| | | | llvm-svn: 120905
OpenPOWER on IntegriCloud