[cfe-commits] r91519 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGenCXX/new.cpp
Anders Carlsson
andersca at mac.com
Tue Dec 15 22:57:54 PST 2009
Author: andersca
Date: Wed Dec 16 00:57:54 2009
New Revision: 91519
URL: http://llvm.org/viewvc/llvm-project?rev=91519&view=rev
Log:
Handle ImplicitValueInitExpr in AggExprEmitter.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGenCXX/new.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=91519&r1=91518&r2=91519&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Wed Dec 16 00:57:54 2009
@@ -106,6 +106,7 @@
void VisitConditionalOperator(const ConditionalOperator *CO);
void VisitChooseExpr(const ChooseExpr *CE);
void VisitInitListExpr(InitListExpr *E);
+ void VisitImplicitValueInitExpr(ImplicitValueInitExpr *E);
void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) {
Visit(DAE->getExpr());
}
@@ -465,8 +466,13 @@
}
void AggExprEmitter::VisitCXXZeroInitValueExpr(CXXZeroInitValueExpr *E) {
- LValue lvalue = LValue::MakeAddr(DestPtr, Qualifiers());
- EmitNullInitializationToLValue(lvalue, E->getType());
+ LValue LV = LValue::MakeAddr(DestPtr, Qualifiers());
+ EmitNullInitializationToLValue(LV, E->getType());
+}
+
+void AggExprEmitter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
+ LValue LV = LValue::MakeAddr(DestPtr, Qualifiers());
+ EmitNullInitializationToLValue(LV, E->getType());
}
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
Modified: cfe/trunk/test/CodeGenCXX/new.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/new.cpp?rev=91519&r1=91518&r2=91519&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/new.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/new.cpp Wed Dec 16 00:57:54 2009
@@ -90,3 +90,9 @@
return new(1, 2, 3.45, 100) A;
}
+struct B { };
+void t11() {
+ // CHECK: call i8* @_Znwm
+ // CHECK: call void @llvm.memset.i64(
+ B* b = new B();
+}
More information about the cfe-commits
mailing list