[cfe-commits] r90412 - in /cfe/trunk: lib/CodeGen/CGCXX.cpp test/CodeGenCXX/virt-thunk-reference.cpp
Eli Friedman
eli.friedman at gmail.com
Wed Dec 2 20:49:53 PST 2009
Author: efriedma
Date: Wed Dec 2 22:49:52 2009
New Revision: 90412
URL: http://llvm.org/viewvc/llvm-project?rev=90412&view=rev
Log:
Fix thunk generation for thunks with a parameter with reference type.
Added:
cfe/trunk/test/CodeGenCXX/virt-thunk-reference.cpp
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=90412&r1=90411&r2=90412&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Dec 2 22:49:52 2009
@@ -940,7 +940,8 @@
QualType ArgType = D->getType();
// llvm::Value *Arg = CGF.GetAddrOfLocalVar(Dst);
- Expr *Arg = new (getContext()) DeclRefExpr(D, ArgType, SourceLocation());
+ Expr *Arg = new (getContext()) DeclRefExpr(D, ArgType.getNonReferenceType(),
+ SourceLocation());
CallArgs.push_back(std::make_pair(EmitCallArg(Arg, ArgType), ArgType));
}
Added: cfe/trunk/test/CodeGenCXX/virt-thunk-reference.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt-thunk-reference.cpp?rev=90412&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt-thunk-reference.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/virt-thunk-reference.cpp Wed Dec 2 22:49:52 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc -emit-llvm-only %s
+
+struct A { int a; virtual void aa(int&); };
+struct B { int b; virtual void bb(int&); };
+struct C : A,B { virtual void aa(int&), bb(int&); };
+void C::aa(int&) {}
+void C::bb(int&) {}
More information about the cfe-commits
mailing list