summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/exprs.c
Commit message (Collapse)AuthorAgeFilesLines
* [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperatorCameron McInally2019-10-141-1/+1
| | | | | | | | Reapply r374240 with fix for Ocaml test, namely Bindings/OCaml/core.ml. Differential Revision: https://reviews.llvm.org/D61675 llvm-svn: 374782
* Revert "[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator"Dmitri Gribenko2019-10-101-1/+1
| | | | | | | This reverts commit r374240. It broke OCaml tests: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19014 llvm-svn: 374354
* [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperatorCameron McInally2019-10-091-1/+1
| | | | | | | | Also update Clang to call Builder.CreateFNeg(...) for UnaryMinus. Differential Revision: https://reviews.llvm.org/D61675 llvm-svn: 374240
* Ignore trailing NullStmts in StmtExprs for GCC compatibility.Aaron Ballman2019-07-091-0/+10
| | | | | | | | Ignore trailing NullStmts in compound expressions when determining the result type and value. This is to match the GCC behavior which ignores semicolons at the end of compound expressions. Patch by Dominic Ferreira. llvm-svn: 365498
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* Evaluate union cast subexpressions when the cast value is unusedReid Kleckner2015-05-201-0/+11
| | | | | | Fixes PR23597. llvm-svn: 237839
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-1/+1
| | | | llvm-svn: 230783
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-6/+6
| | | | | | tests fail. llvm-svn: 188447
* Make test pass in Release builds, which use a different naming scheme for ↵Benjamin Kramer2012-08-281-1/+1
| | | | | | llvm values. llvm-svn: 162771
* Merge test case for PR13704 into exprs.c to reduce test casesMichael Liao2012-08-281-0/+10
| | | | llvm-svn: 162769
* Ensure an insertion point at the end of a statement-expression.John McCall2011-01-131-0/+8
| | | | | | Fixes PR8967. llvm-svn: 123360
* Silly special case: never load when dereferencing void*.John McCall2010-12-041-12/+12
| | | | llvm-svn: 120905
* First pass at implementing the intent of ANSI C DR106.John McCall2010-12-041-2/+16
| | | | llvm-svn: 120904
* Improve test coverage.Daniel Dunbar2010-08-211-0/+7
| | | | llvm-svn: 111712
* tests: Fix test to not depend on instruction names.Daniel Dunbar2010-06-291-2/+3
| | | | llvm-svn: 107186
* tweak test to pass on windowsChris Lattner2010-06-281-1/+1
| | | | llvm-svn: 107040
* Fix UnitTests/2004-02-02-NegativeZero.c, which regressed whenChris Lattner2010-06-281-0/+7
| | | | | | I broke negate of FP values. llvm-svn: 107019
* merge two tests.Chris Lattner2010-06-271-0/+6
| | | | llvm-svn: 106971
* Implement rdar://7530813 - collapse multiple GEP instructions in IRgenChris Lattner2010-06-261-1/+13
| | | | | | | | | | | | | | | | | | | | This avoids generating two gep's for common array operations. Before we would generate something like: %tmp = load i32* %X.addr ; <i32> [#uses=1] %arraydecay = getelementptr inbounds [100 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1] %arrayidx = getelementptr inbounds i32* %arraydecay, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1] Now we generate: %tmp = load i32* %X.addr ; <i32> [#uses=1] %arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1] Less IR is better at -O0. llvm-svn: 106966
* Implement support for -fwrapv, rdar://7221421Chris Lattner2010-06-261-14/+1
| | | | | | | | | | | | As part of this, pull together trapv handling into the same enum. This also add support for NSW multiplies. This also makes PCH disagreement on overflow behavior silent, since it really doesn't matter except for warnings and codegen (no macros get defined etc). llvm-svn: 106956
* implement rdar://7432000 - signed negate should codegen as NSW.Chris Lattner2010-06-261-1/+14
| | | | | | While I'm in there, adjust pointer to member adjustments as well. llvm-svn: 106955
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* add 'F' to a bunch of libm builtins so that codegen doesn't die on them,Chris Lattner2009-12-071-0/+3
| | | | | | pointed out by Charles Davis. llvm-svn: 90736
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-3/+3
| | | | llvm-svn: 81346
* Prep for new warning.Mike Stump2009-07-211-1/+1
| | | | llvm-svn: 76638
* implement l-value codegen of comma exprChris Lattner2009-05-121-0/+12
| | | | llvm-svn: 71595
* fix PR4067: [Linux kernel] cannot aggregate codegen stmtexpr as lvalue Chris Lattner2009-04-251-0/+5
| | | | llvm-svn: 70067
* fix PR4026: Clang can't codegen __func__ without implicit castChris Lattner2009-04-211-0/+5
| | | | llvm-svn: 69747
* Support member reference on ?: of struct type.Daniel Dunbar2009-03-241-0/+6
| | | | llvm-svn: 67603
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* fix the more complex cases by actually codegen'ing the right expr :)Chris Lattner2009-03-181-0/+6
| | | | llvm-svn: 67219
* add codegen support for casting an element to a union.Chris Lattner2009-03-181-0/+3
| | | | | | | There are some more complex cases (_Complex and structs) that I'm still working on. llvm-svn: 67218
* fix PR3809, codegen for inc/dec of function pointers.Chris Lattner2009-03-181-0/+12
| | | | llvm-svn: 67165
* teach codegen to handle noop casts as lvalues.Chris Lattner2009-03-181-0/+8
| | | | llvm-svn: 67164
* finish off codegen support for sub of pointer to functions, Chris Lattner2009-02-111-0/+7
| | | | | | finishing off rdar://6520707 llvm-svn: 64295
* fix folding of '*doubleArray'Nuno Lopes2008-11-191-0/+7
| | | | llvm-svn: 59647
* fix folding of comma if given a non-constant operand.Nuno Lopes2008-11-161-0/+6
| | | | | | Eli please take a look, as I'm not sure if this gets the extension warning in the right place llvm-svn: 59422
* Fix a bug where we didn't promote 'const float' (or typedefs) toChris Lattner2008-06-271-1/+6
| | | | | | double in some places. llvm-svn: 52846
* implement codegen support for sizeof(void), fixing PR2080.Chris Lattner2008-02-211-0/+11
| | | | llvm-svn: 47429
* Fix PR1921 by promoting negative indices to intptrty.Chris Lattner2008-01-311-0/+6
| | | | llvm-svn: 46599
* fix a problem reported by Eli, caused by not keeping bool as i1 Chris Lattner2008-01-301-0/+3
| | | | | | when in a register. llvm-svn: 46552
* Fix a crash reported by Seo Sanghyeon.Chris Lattner2008-01-031-0/+8
| | | | llvm-svn: 45530
* Fix PR1895: a crash on an ugly gcc extension.Chris Lattner2008-01-021-0/+8
llvm-svn: 45505
OpenPOWER on IntegriCloud