[cfe-commits] r84418 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGenCXX/default-arg-temps.cpp
Nuno Lopes
nunoplopes at sapo.pt
Sun Oct 18 08:18:12 PDT 2009
Author: nlopes
Date: Sun Oct 18 10:18:11 2009
New Revision: 84418
URL: http://llvm.org/viewvc/llvm-project?rev=84418&view=rev
Log:
add support for codegening CXXZeroInitValueExprs
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGenCXX/default-arg-temps.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=84418&r1=84417&r2=84418&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sun Oct 18 10:18:11 2009
@@ -112,6 +112,7 @@
void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E);
void VisitCXXConstructExpr(const CXXConstructExpr *E);
void VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E);
+ void VisitCXXZeroInitValueExpr(CXXZeroInitValueExpr *E);
void VisitVAArgExpr(VAArgExpr *E);
@@ -439,6 +440,11 @@
CGF.EmitCXXExprWithTemporaries(E, DestPtr, VolatileDest, IsInitializer);
}
+void AggExprEmitter::VisitCXXZeroInitValueExpr(CXXZeroInitValueExpr *E) {
+ LValue lvalue = LValue::MakeAddr(DestPtr, Qualifiers());
+ EmitNullInitializationToLValue(lvalue, E->getType());
+}
+
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
// FIXME: Ignore result?
// FIXME: Are initializers affected by volatile?
Modified: cfe/trunk/test/CodeGenCXX/default-arg-temps.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-arg-temps.cpp?rev=84418&r1=84417&r2=84418&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-arg-temps.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/default-arg-temps.cpp Sun Oct 18 10:18:11 2009
@@ -15,7 +15,7 @@
void g() {
// RUN: grep "call void @_ZN1TC1Ev" %t | count 4 &&
- // RUN: grep "call void @_ZN1TD1Ev" %t | count 4
+ // RUN: grep "call void @_ZN1TD1Ev" %t | count 4 &&
f();
f();
@@ -23,3 +23,10 @@
X b(a);
X c = a;
}
+
+
+// RUN: grep memset %t
+class obj{ int a; float b; double d; };
+void h() {
+ obj o = obj();
+}
More information about the cfe-commits
mailing list