[cfe-commits] r131057 - in /cfe/trunk: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.h test/CodeGen/byval-memcpy-elim.c
Douglas Gregor
dgregor at apple.com
Sat May 7 13:12:26 PDT 2011
Author: dgregor
Date: Sat May 7 15:12:26 2011
New Revision: 131057
URL: http://llvm.org/viewvc/llvm-project?rev=131057&view=rev
Log:
Revert r130717, which caused a regression (<rdar://problem/9402621>).
Removed:
cfe/trunk/test/CodeGen/byval-memcpy-elim.c
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGCall.h
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=131057&r1=131056&r2=131057&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Sat May 7 15:12:26 2011
@@ -1166,15 +1166,6 @@
return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0),
type);
- if (hasAggregateLLVMType(type) && isa<ImplicitCastExpr>(E) &&
- cast<CastExpr>(E)->getCastKind() == CK_LValueToRValue) {
- LValue L = EmitLValue(cast<CastExpr>(E)->getSubExpr());
- assert(L.isSimple());
- args.add(RValue::getAggregate(L.getAddress(), L.isVolatileQualified()),
- type, /*NeedsCopy*/true);
- return;
- }
-
args.add(EmitAnyExprToTemp(E), type);
}
@@ -1240,10 +1231,6 @@
Alignment, I->Ty);
else
StoreComplexToAddr(RV.getComplexVal(), Args.back(), false);
- } else if (I->NeedsCopy && !ArgInfo.getIndirectByVal()) {
- Args.push_back(CreateMemTemp(I->Ty));
- EmitAggregateCopy(Args.back(), RV.getAggregateAddr(), I->Ty,
- RV.isVolatileQualified());
} else {
Args.push_back(RV.getAggregateAddr());
}
Modified: cfe/trunk/lib/CodeGen/CGCall.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.h?rev=131057&r1=131056&r2=131057&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.h (original)
+++ cfe/trunk/lib/CodeGen/CGCall.h Sat May 7 15:12:26 2011
@@ -47,9 +47,8 @@
struct CallArg {
RValue RV;
QualType Ty;
- bool NeedsCopy;
- CallArg(RValue rv, QualType ty, bool needscopy)
- : RV(rv), Ty(ty), NeedsCopy(needscopy)
+ CallArg(RValue rv, QualType ty)
+ : RV(rv), Ty(ty)
{ }
};
@@ -58,8 +57,8 @@
class CallArgList :
public llvm::SmallVector<CallArg, 16> {
public:
- void add(RValue rvalue, QualType type, bool needscopy = false) {
- push_back(CallArg(rvalue, type, needscopy));
+ void add(RValue rvalue, QualType type) {
+ push_back(CallArg(rvalue, type));
}
};
Removed: cfe/trunk/test/CodeGen/byval-memcpy-elim.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/byval-memcpy-elim.c?rev=131056&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/byval-memcpy-elim.c (original)
+++ cfe/trunk/test/CodeGen/byval-memcpy-elim.c (removed)
@@ -1,20 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 < %s | FileCheck %s
-
-struct Test1S {
- long NumDecls;
- long X;
- long Y;
-};
-struct Test2S {
- long NumDecls;
- long X;
-};
-
-// Make sure we don't generate extra memcpy for lvalues
-void test1a(struct Test1S, struct Test2S);
-// CHECK: define void @test1(
-// CHECK-NOT: memcpy
-// CHECK: call void @test1a
-void test1(struct Test1S *A, struct Test2S *B) {
- test1a(*A, *B);
-}
More information about the cfe-commits
mailing list