History log of /external/clang/test/CodeGenCXX/references.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/test/CodeGenCXX/references.cpp
93ab6bf534fb6c26563c00f28a8fc5581bb71dfd 15-Aug-2013 Stephen Lin <stephenwlin@gmail.com> CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
96e7813f08c6adf1d8657b0da86741b54e850fd7 04-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 'not' to commands that are expected to fail.

This is at least good documentation, but also opens the possibility of
using pipefail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
72d2dab6058467036df73a5f668036a519043e5b 06-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Rework the bitfield access IR generation to address PR13619 and
generally support the C++11 memory model requirements for bitfield
accesses by relying more heavily on LLVM's memory model.

The primary change this introduces is to move from a manually aligned
and strided access pattern across the bits of the bitfield to a much
simpler lump access of all bits in the bitfield followed by math to
extract the bits relevant for the particular field.

This simplifies the code significantly, but relies on LLVM to
intelligently lowering these integers.

I have tested LLVM's lowering both synthetically and in benchmarks. The
lowering appears to be functional, and there are no really significant
performance regressions. Different code patterns accessing bitfields
will vary in how this impacts them. The only real regressions I'm seeing
are a few patterns where the LLVM code generation for loads that feed
directly into a mask operation don't take advantage of the x86 ability
to do a smaller load and a cheap zero-extension. This doesn't regress
any benchmark in the nightly test suite on my box past the noise
threshold, but my box is quite noisy. I'll be watching the LNT numbers,
and will look into further improvements to the LLVM lowering as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
32380594b6774af451cf34af79b086d6f920d052 16-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix test on Release builds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
2f77b3d57031ded0de2b7b977fb63b4660f82624 16-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues. PR11376.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
9cbe4f0ba01ec304e1e3d071c071f7bca33631c0 09-Jul-2011 Chris Lattner <sabre@nondot.org> clang side to match the LLVM IR type system rewrite patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
03e80030515c800d1ab44125b9052dfffd1bd04c 21-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a new AST node describing reference binding to temporaries.

MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
545aa7a0f57d2bb2fc0eef83daa499300273d983 16-Mar-2011 Eli Friedman <eli.friedman@gmail.com> PR9494: Get rid of bitcast which was both unnecessary and written incorrectly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
045a6d84a0fa672eb5d914be1bb8f3baa226beb3 27-Jun-2010 Anders Carlsson <andersca@mac.com> Correctly destroy reference temporaries with global storage. Remove ErrorUnsupported call when binding a global reference to a non-lvalue. Fixes PR7326.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
35b21b884e5c3447a52a74d7ffaba966b07ac81f 27-Jun-2010 Chris Lattner <sabre@nondot.org> Change IR generation for return (in the simple case) to avoid doing silly
load/store nonsense in the epilog. For example, for:

int foo(int X) {
int A[100];
return A[X];
}

we used to generate:

%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
store i32 %tmp1, i32* %retval
%0 = load i32* %retval ; <i32> [#uses=1]
ret i32 %0
}

which codegen'd to this code:

_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 400(%rsp)
movl 400(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %edi
movl %edi, 404(%rsp)
movl 404(%rsp), %eax
addq $408, %rsp ## imm = 0x198
ret

Now we generate:

%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
ret i32 %tmp1
}

and:

_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 404(%rsp)
movl 404(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %eax
addq $408, %rsp ## imm = 0x198
ret

This actually does matter, cutting out 2000 lines of IR from CGStmt.ll
for example.

Another interesting effect is that altivec.h functions which are dead
now get dce'd by the inliner. Hence all the changes to
builtins-ppc-altivec.c to ensure the calls aren't dead.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
2d6b0e94db30c0e2754d270753c6f75478e451bf 22-May-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of reference binding for subobjects of
temporaries. There are actually several interrelated fixes here:

- When converting an object to a base class, it's only an lvalue
cast when the original object was an lvalue and we aren't casting
pointer-to-derived to pointer-to-base. Previously, we were
misclassifying derived-to-base casts of class rvalues as lvalues,
causing various oddities (including problems with reference binding
not extending the lifetimes of some temporaries).

- Teach the code for emitting a reference binding how to look
through no-op casts and parentheses directly, since
Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make
sure that we properly look through multiple levels of indirection
from the temporary object, but destroy the actual temporary object;
this fixes the reference-binding issue mentioned above.

- Teach Objective-C message sends to bind the result as a temporary
when needed. This is actually John's change, but it triggered the
reference-binding problem above, so it's included here. Now John
can actually test his return-slot improvements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
60dcb8432cff2455488b9226b9cc65b80356146e 20-May-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of binding a reference to a temporary
subobject. Previously, we could only properly bind to a base class
subobject while extending the lifetime of the complete object (of a
derived type); for non-static data member subobjects, we could memcpy
(!) the result and bind to that, which is rather broken.

Now, we pull apart the expression that we're binding to, to figure out
which subobject we're accessing, then construct the temporary object
(adding a destruction if needed) and, finally, dig out the subobject
we actually meant to access.

This fixes yet another instance where we were memcpy'ing rather than
doing the right thing. However, note the FIXME in references.cpp:
there's more work to be done for binding to subobjects, since the AST
is incorrectly modeling some member accesses in base classes as
lvalues when they are really rvalues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
761c94e3bffef0fcb8b4bbf202fd5ee73db134f3 16-May-2010 Chandler Carruth <chandlerc@gmail.com> When constant folding reference variables with an initializer to the
initializer, don't fold paramters. Their initializers are just default
arguments which can be overridden. This fixes some spectacular regressions due
to more things making it into the constant folding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
f748845b19813d81189283f76778cfc870f6cfd7 25-Mar-2010 Douglas Gregor <dgregor@apple.com> Check for ret, so that we know we hit the end of the function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
33fd1fc1814a5573c972840d49317989e20deace 25-Mar-2010 Douglas Gregor <dgregor@apple.com> When returning from a function that has a reference return type, use
EmitReferenceBindingToExpr() rather than assuming we have an
lvalue. This is just the lowest hanging fruit for PR6024, which still
requires a bit of work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
e78ccb4d609a113c3e06a9c4583e845e90b1a037 03-Feb-2010 Anders Carlsson <andersca@mac.com> Handle reference binding in aggregate initializers. Fixes another 47 tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
20093b4bf698f292c664676987541d5103b65b15 10-Dec-2009 Douglas Gregor <dgregor@apple.com> Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
5d484e8cf710207010720589d89602233de61d01 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
40092972b591646b47037d2b46b695a4014df413 21-Oct-2009 Anders Carlsson <andersca@mac.com> Fix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
9a2c8bb599a2460807e341182655a68515574124 20-Oct-2009 Anders Carlsson <andersca@mac.com> Force triple for test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
86aa0cdfd5aa7b099efbcd612a014d1b5f0ff799 19-Oct-2009 Anders Carlsson <andersca@mac.com> Handle emitting the assignment operator when the lhs is a reference. Fixes PR5227.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
e1b7ea1b025c54b082f838ede2f483e657481fdc 19-Oct-2009 Anders Carlsson <andersca@mac.com> When binding a reference to a temporary, it's important that other temporaries created as on the RHS are destroyed before emitting the dtor for the temporary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
b3f744252a460c45e2e77053491285978286c384 15-Oct-2009 Anders Carlsson <andersca@mac.com> Handle

struct A { };
struct B : A { };

void f() {
const A& a = B();
}

correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
26bc220377705292a0519a71d3ea3aef68fcfec6 03-Oct-2009 Anders Carlsson <andersca@mac.com> Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
faf86648bfab7e0fa975e2b32c10fe1d8b461e8c 01-Sep-2009 Anders Carlsson <andersca@mac.com> Handle member expressions that return references correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
e70e8f7fef3efb3d526ee25b3a0e2a4bf67a04b6 27-May-2009 Anders Carlsson <andersca@mac.com> IRgen support for calls to functions that return references to aggregate exressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
50c39ea4858265f3f5f42a0c624557ce2281936b 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix up constant expression handling to deal with the address
of a reference correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
4a18784dea763be146df68546e6dbf4233c33077 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Add IRGen support for local variables of reference type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
d54b6ac2f4f6f0bd0076cbfa885b57277066f06c 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Add IRGen support for return statements in functions with reference
type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
e9f2f45fe9bf79bd4aea47fa1ad9204b68510fd9 27-May-2009 Anders Carlsson <andersca@mac.com> Functions that return references can be rvalues as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
68ea78a093271301dc6396fc683644d8e13a90dd 27-May-2009 Anders Carlsson <andersca@mac.com> Add another test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
482656833a71b63f67f3e93ee8c2d45b3d351ca8 27-May-2009 Anders Carlsson <andersca@mac.com> Add support for emitting calls to functions that return references (as lvalues only for now)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
5df0d426026b3820b5f0b13a8d4e60e9373d8d9d 20-May-2009 Eli Friedman <eli.friedman@gmail.com> Handle the remaining unhandled cases in EmitReferenceBindingToExpr.

It would be nice if someone could write an ObjC++ testcase for the case
of passing a property returning a struct to a function taking a const
reference.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
7cd3a648b3d3057805c022b9470bbdfe21d732a5 20-May-2009 Anders Carlsson <andersca@mac.com> irgen for references to complex rvales (Very important...)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
9f75e6be16b9df33d58ec73955b3e3e3c71b2682 20-May-2009 Anders Carlsson <andersca@mac.com> Bad anders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
38d068e8f13a119b89a3b8b0f79f35cab1ffd09a 20-May-2009 Anders Carlsson <andersca@mac.com> Create a temporary if the lvalue is a bitfield. Reported by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
e04d1c77ae15a6e973e2fac7723f6c364884f58d 20-May-2009 Anders Carlsson <andersca@mac.com> Add support for binding references to scalar rvalues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
4bbab92167713bf4f79c0b14dcc4e83d08ac4019 20-May-2009 Anders Carlsson <andersca@mac.com> Bind references to lvalues correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp
c8667a866bfc1d9f807282f2de5644d6aa4e9423 19-May-2009 Anders Carlsson <andersca@mac.com> Improve support for irgen of references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/references.cpp