summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix vector splat casts to cast element to the appropriate vector element ↵Craig Topper2012-02-061-0/+2
| | | | | | before inserting into the vector. Fixes PR11930. llvm-svn: 149855
* reapply r148902:Chris Lattner2012-01-251-20/+6
| | | | | | | | | | "use the new ConstantVector::getSplat method where it makes sense." Also simplify a bunch of code to use the Builder->getInt32 instead of doing it the hard and ugly way. Much more progress could be made here, but I don't plan to do it. llvm-svn: 148926
* Revert 148902 which was part of 148901 which was reverted in r148906.Argyrios Kyrtzidis2012-01-251-6/+18
| | | | | | | Original log: use the new ConstantVector::getSplat method where it makes sense. llvm-svn: 148907
* use the new ConstantVector::getSplat method where it makes sense.Chris Lattner2012-01-251-18/+6
| | | | llvm-svn: 148902
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-13/+0
| | | | llvm-svn: 148577
* Add support for OpenCL 1.1 logical operations.Tanya Lattner2012-01-161-0/+33
| | | | llvm-svn: 148254
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-0/+52
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* Revert r147664; it's breaking clang regression tests.Eli Friedman2012-01-061-1/+1
| | | | llvm-svn: 147681
* Silence GCC warnings.Jakub Staszak2012-01-061-1/+1
| | | | llvm-svn: 147664
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-281-9/+7
| | | | | | clients. No functionality change. llvm-svn: 147318
* Switch a few callers of MakeAddrLValue places over to ↵Eli Friedman2011-12-191-4/+4
| | | | | | MakeNaturalAlignAddrLValue. llvm-svn: 146920
* Fix an edge case in IRGen for conditionals. PR11509.Eli Friedman2011-12-081-0/+5
| | | | llvm-svn: 146189
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-1/+3
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Rip out CK_GetObjCProperty.John McCall2011-11-071-1/+0
| | | | llvm-svn: 143910
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-071-21/+1
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-4/+4
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Annotate imprecise FP division with fpaccuracy metadataPeter Collingbourne2011-10-271-2/+12
| | | | | | | | | The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-2/+2
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-2/+2
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-2/+2
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Handle an edge case involving the conditional operator and throw ↵Eli Friedman2011-10-151-5/+12
| | | | | | expressions. PR10582. llvm-svn: 142047
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-22/+57
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+5
| | | | llvm-svn: 141632
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-041-4/+2
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* de-tmpify clang.Benjamin Kramer2011-09-271-2/+2
| | | | llvm-svn: 140637
* Treat list-initialization of scalars as a first-class citizen in C++11.Sebastian Redl2011-09-241-2/+7
| | | | | | | | | Allow empty initializer lists for scalars, which mean value-initialization. Constant evaluation for single-element and empty initializer lists for scalars. Codegen for empty initializer lists for scalars. Test case comes in next commit. llvm-svn: 140459
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-4/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+6
| | | | llvm-svn: 140367
* Rename the ARC cast kinds to start with "ARC".John McCall2011-09-101-4/+4
| | | | llvm-svn: 139466
* When converting a block pointer to an Objective-C pointer type, extendJohn McCall2011-09-101-1/+5
| | | | | | | | | | | the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-1/+2
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* Fix r137086 to actually work properly in general. PR10650.Eli Friedman2011-08-141-2/+1
| | | | llvm-svn: 137574
* Hand materialization of temporary expressions when emitting a scalarDouglas Gregor2011-08-091-0/+5
| | | | | | expression. Fxies PR10592. llvm-svn: 137086
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-7/+7
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* as eli points out, we're not doing memory stuff here. While ConvertType Chris Lattner2011-07-201-2/+1
| | | | | | | and ConvertTypeForMem are the same for pointers, it is best to just use ConvertType. Thanks Eli! llvm-svn: 135567
* fix PR10395 - array decay can produce an interesting type whenChris Lattner2011-07-201-1/+4
| | | | | | | decaying an array of incomplete type (which has type [0 x i8]*) to a normal pointer (which has incompletetype*). llvm-svn: 135565
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-28/+28
| | | | llvm-svn: 135370
* Fix the definition of AsTypeExpr. I'm still not sure thisJohn McCall2011-07-151-1/+1
| | | | | | | | | | is right --- shouldn't there be a TypeLoc in here somewhere? --- but at least it doesn't have a redundant QualType and a broken children() method. Noticed this while doing things in serialization. llvm-svn: 135257
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-151-0/+3
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-141-1/+1
| | | | | | function in LLVM does. llvm-svn: 135155
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-3/+3
| | | | llvm-svn: 134831
* Layout the code for trapping arithmetic so that the overflow case comes afterBill Wendling2011-07-071-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the normal case. Before, for this: $ cat t.c int test(int x) { return x * 2; } We would get this: addl %edi, %edi jno LBB0_2 ## BB#1: ## %overflow ud2 LBB0_2: ## %nooverflow movl %edi, %eax popq %rbp ret Now we get this: addl %edi, %edi jo LBB0_2 ## BB#1: ## %nooverflow movl %edi, %eax popq %rbp ret LBB0_2: ## %overflow ud2 <rdar://problem/8283919> llvm-svn: 134642
* In ARC, reclaim all return values of retainable type, not just thoseJohn McCall2011-07-071-0/+5
| | | | | | | | | | | | where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
* Cleanup cast IRGen a bit; no intended functionality change.Eli Friedman2011-06-251-8/+3
| | | | llvm-svn: 133864
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-25/+21
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Mark the multiply which occurs as part of performing pointerJohn McCall2011-06-251-163/+155
| | | | | | | | arithmetic on a VLA as 'nsw', per discussion with djg, and implement pointer arithmetic (other than array accesses) and pointer subtraction for VLA types. llvm-svn: 133855
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-16/+22
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Automatic Reference Counting.John McCall2011-06-151-15/+42
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Add support for builtin astype:Tanya Lattner2011-06-041-0/+51
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
OpenPOWER on IntegriCloud