Commit Graph

16 Commits

Author SHA1 Message Date
Hal Finkel a2347baaec Mark C++ reference parameters as dereferenceable
Because references must be initialized using some evaluated expression, they
must point to something, and a callee can assume the reference parameter is
dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
them as such.

Because dereferenceability in addrspace(0) implies nonnull in the backend, we
don't need both attributes. However, we need to know the size of the object to
use the dereferenceable attribute, so for incomplete types we still emit only
nonnull.

llvm-svn: 213386
2014-07-18 15:52:10 +00:00
Nick Lewycky 9b46eb8112 Add 'nonnull' parameter or return attribute when producing an llvm pointer type in a function type where the C++ type is a reference. Update the tests.
llvm-svn: 209723
2014-05-28 09:56:42 +00:00
Stephen Lin 4362261b00 CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
llvm-svn: 188447
2013-08-15 06:47:53 +00:00
Stephen Lin 9dc6eef755 Restore r184205 and associated commits (after commit of r185290)
This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.

llvm-svn: 185291
2013-06-30 20:40:16 +00:00
Stephen Lin 19cee1871e Revert r184205 and associated patches while investigating issue with broken buildbot (possible interaction with LTO)
<rdar://problem/14209661>

llvm-svn: 184384
2013-06-19 23:23:19 +00:00
Stephen Lin a637fb8ccd CodeGen: Have 'this'-returning constructors and destructors to take advantage of the new backend 'returned' attribute.
The backend will now use the generic 'returned' attribute to form tail calls where possible, as well as avoid save-restores of 'this' in some cases (specifically the cases that matter for the ARM C++ ABI).

This patch also reverts a prior front-end only partial implementation of these optimizations, since it's no longer required.

llvm-svn: 184205
2013-06-18 17:00:49 +00:00
David Blaikie 60761490f2 Provide fixed target triples to make test results consistent across ARM hosts.
Patch by David Tweed, review by myself and John McCall.

llvm-svn: 163564
2012-09-10 23:06:08 +00:00
Douglas Gregor d2f7007e09 Only make a call to a copy constructor elidable if in fact we are
doing a copy. Fixes PR12139.

llvm-svn: 152485
2012-03-10 06:53:13 +00:00
Chris Lattner a5f58b05e8 clang side to match the LLVM IR type system rewrite patch.
llvm-svn: 134831
2011-07-09 17:41:47 +00:00
Eli Friedman 50ed150632 Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 2 of 3.
llvm-svn: 133011
2011-06-14 21:20:53 +00:00
Eli Friedman a526f275e3 Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 1 of 3 or so.
llvm-svn: 132945
2011-06-13 22:51:21 +00:00
Rafael Espindola 05842dabb8 Move unnamed_addr after the function arguments on Sabre's request.
llvm-svn: 124210
2011-01-25 19:10:24 +00:00
Rafael Espindola 0ee986c1f1 Add unnamed_addr to constructors and destructors.
llvm-svn: 123197
2011-01-11 00:26:26 +00:00
Anders Carlsson 66bbf50877 Look through parentheses when deciding whether an expr is a temporary object. Fixes PR8683.
llvm-svn: 120247
2010-11-28 16:40:49 +00:00
Douglas Gregor ec3a3f5257 Do not elide copy construction when we're performing base-class initialization
llvm-svn: 111783
2010-08-22 18:27:02 +00:00
Eli Friedman fddc26cc64 Make copy constructor elimination work in more cases; the case in question
here affects clang-on-clang.

llvm-svn: 92151
2009-12-24 23:33:34 +00:00