summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx0x-initializer-array.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change memcpy/memove/memset to have dest and source alignment attributes ↵Daniel Neilson2018-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Step 1). Summary: Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset intrinsics. This change updates the Clang tests for this change. The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument which is required to be a constant integer. It represents the alignment of the dest (and source), and so must be the minimum of the actual alignment of the two. This change removes the alignment argument in favour of placing the alignment attribute on the source and destination pointers of the memory intrinsic call. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false) will now read call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false) At this time the source and destination alignments must be the same (Step 1). Step 2 of the change, to be landed shortly, will relax that contraint and allow the source and destination to have different alignments. llvm-svn: 322964
* Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper2015-11-191-1/+1
| | | | | | | | | | This reverts commit r253512. This likely broke the bots in: http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253542
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. llvm-svn: 253512
* Reapply r231508 "CodeGen: Emit constant temporaries into read-only globals."Benjamin Kramer2015-03-071-3/+4
| | | | | | | | | | | | I disabled putting the new global into the same COMDAT as the function for now. There's a fundamental problem when we inline references to the global but still have the global in a COMDAT linked to the inlined function. Since this is only an optimization there may be other versions of the COMDAT around that are missing the new global and hell breaks loose at link time. I hope the chromium build doesn't break this time :) llvm-svn: 231564
* Revert r231508 "CodeGen: Emit constant temporaries into read-only globals."Hans Wennborg2015-03-071-4/+3
| | | | | | | | | This broke the Chromium build. Links were failing with messages like: obj/dbus/libdbus_test_support.a(obj/dbus/dbus_test_support.mock_object_proxy.o):../../dbus/mock_object_proxy.cc:function dbus::MockObjectProxy::Detach(): warning: relocation refers to discarded section /usr/local/google/work/chromium/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: error: treating warnings as errors llvm-svn: 231541
* CodeGen: Emit constant temporaries into read-only globals.Benjamin Kramer2015-03-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Instead of creating a copy on the stack just stash them in a private constant global. This saves both the copying overhead and the stack space, and gives the optimizer more room to constant fold. This tries to make array temporaries more similar to regular arrays, they can't use the same logic because a temporary has no VarDecl to be bound to so we roll our own version here. The original use case for this optimization was code like for (int i : {1, 2, 3, 4, 5, 6, 7, 8, 10}) foo(i); where without this patch (assuming that the loop is not unrolled) we would alloca an array on the stack, copy the 10 values over and iterate on that. With this patch we put the array in .text use it directly. Apart from that case this helps on virtually any passing of a constant std::initializer_list as a function argument. Differential Revision: http://reviews.llvm.org/D8034 llvm-svn: 231508
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-6/+6
| | | | | | tests fail. llvm-svn: 188447
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-021-2/+19
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* Don't forget to run destructors when we create an array temporary of class type.Richard Smith2013-02-021-1/+45
| | | | llvm-svn: 174257
* Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for ↵Richard Smith2012-12-211-0/+40
| | | | | | a value-initialized bool! llvm-svn: 170837
* Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when ↵NAKAMURA Takumi2012-12-211-40/+0
| | | | | | | | emitting a null constant of type pointer-to-data-member." It broke stage2. llvm-svn: 170835
* Fix some bugs where we would sometimes use 0, not -1, when emitting a null ↵Richard Smith2012-12-201-0/+40
| | | | | | constant of type pointer-to-data-member. llvm-svn: 170806
* A number of test cases assume that an "int" parameter or return valueUlrich Weigand2012-10-241-1/+1
| | | | | | | | | | | | will be represented in the IR as a plain "i32" type. This causes the tests to spuriously fail on platforms where int is not a 32-bit type, or where the ABI requires attributes like "signext" or "zeroext" to be used. This patch adds -triple or -target parameters to force those tests to use the i386-unknown-unknown target. llvm-svn: 166551
* Make sure list-initialization of arrays works correctly in explicit type ↵Eli Friedman2012-02-291-0/+10
conversions. PR12121. llvm-svn: 151674
OpenPOWER on IntegriCloud