aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/cxx0x-initializer-array.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-11-19Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper1-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
2015-11-18Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper1-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
2015-03-07Reapply r231508 "CodeGen: Emit constant temporaries into read-only globals."Benjamin Kramer1-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
2015-03-07Revert r231508 "CodeGen: Emit constant temporaries into read-only globals."Hans Wennborg1-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
2015-03-06CodeGen: Emit constant temporaries into read-only globals.Benjamin Kramer1-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
2013-08-15CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin1-6/+6
tests fail. llvm-svn: 188447
2013-02-02PR15132: Replace "address expression must be an lvalue or a functionRichard Smith1-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
2013-02-02Don't forget to run destructors when we create an array temporary of class type.Richard Smith1-1/+45
llvm-svn: 174257
2012-12-21Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for ↵Richard Smith1-0/+40
a value-initialized bool! llvm-svn: 170837
2012-12-21Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when ↵NAKAMURA Takumi1-40/+0
emitting a null constant of type pointer-to-data-member." It broke stage2. llvm-svn: 170835
2012-12-20Fix some bugs where we would sometimes use 0, not -1, when emitting a null ↵Richard Smith1-0/+40
constant of type pointer-to-data-member. llvm-svn: 170806
2012-10-24A number of test cases assume that an "int" parameter or return valueUlrich Weigand1-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
2012-02-29Make sure list-initialization of arrays works correctly in explicit type ↵Eli Friedman1-0/+10
conversions. PR12121. llvm-svn: 151674