summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx0x-initializer-references.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Disable -fmerge-all-constants as default.Manoj Gupta2018-04-051-1/+1
| | | | | | | | | | | | | | | | | | | Summary: "-fmerge-all-constants" is a non-conforming optimization and should not be the default. It is also causing miscompiles when building Linux Kernel (https://lkml.org/lkml/2018/3/20/872). Fixes PR18538. Reviewers: rjmccall, rsmith, chandlerc Reviewed By: rsmith, chandlerc Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D45289 llvm-svn: 329300
* [CodeGen] Do a more principled fix for PR231653, always use the inner type.Benjamin Kramer2015-04-091-3/+12
| | | | | | | We were still using the MaterializeTemporaryExpr's type to check if the transform is legal. Always use the inner Expr type. llvm-svn: 234543
* [CodeGen] When promoting a reference temporary to a global use the inner ↵Benjamin Kramer2015-04-091-0/+21
| | | | | | | | | type to fold it. The MaterializeTemporaryExpr can have a different type than the inner expression, miscompiling the constant. PR23165. llvm-svn: 234499
* Reapply r231508 "CodeGen: Emit constant temporaries into read-only globals."Benjamin Kramer2015-03-071-5/+13
| | | | | | | | | | | | 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-13/+5
| | | | | | | | | 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-5/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-3/+3
| | | | llvm-svn: 230783
* Provide fixed target triples to make test results consistent across ARM hosts.David Blaikie2012-09-101-3/+3
| | | | | | Patch by David Tweed, review by myself and John McCall. llvm-svn: 163564
* Implement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and theRichard Smith2012-05-141-0/+4
| | | | | | expression is treated as an lvalue. llvm-svn: 156781
* Reference initialization with initializer lists.Sebastian Redl2011-11-271-0/+69
This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists. llvm-svn: 145186
OpenPOWER on IntegriCloud