[cfe-commits] r67477 - /cfe/trunk/lib/CodeGen/CGExprAgg.cpp
Eli Friedman
eli.friedman at gmail.com
Sun Mar 22 13:54:47 PDT 2009
Author: efriedma
Date: Sun Mar 22 15:54:47 2009
New Revision: 67477
URL: http://llvm.org/viewvc/llvm-project?rev=67477&view=rev
Log:
Remove dead code.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=67477&r1=67476&r2=67477&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sun Mar 22 15:54:47 2009
@@ -47,8 +47,6 @@
/// represents a value lvalue, this method emits the address of the lvalue,
/// then loads the result into DestPtr.
void EmitAggLoadOfLValue(const Expr *E);
-
- void EmitNonConstInit(InitListExpr *E);
//===--------------------------------------------------------------------===//
// Visitor Methods
@@ -290,45 +288,6 @@
CGF.EmitAggregateCopy(DestPtr, ArgPtr, VE->getType());
}
-void AggExprEmitter::EmitNonConstInit(InitListExpr *E) {
- const llvm::PointerType *APType =
- cast<llvm::PointerType>(DestPtr->getType());
- const llvm::Type *DestType = APType->getElementType();
-
- if (E->hadArrayRangeDesignator()) {
- CGF.ErrorUnsupported(E, "GNU array range designator extension");
- }
-
- if (const llvm::ArrayType *AType = dyn_cast<llvm::ArrayType>(DestType)) {
- unsigned NumInitElements = E->getNumInits();
-
- unsigned i;
- for (i = 0; i != NumInitElements; ++i) {
- llvm::Value *NextVal = Builder.CreateStructGEP(DestPtr, i, ".array");
- Expr *Init = E->getInit(i);
- if (isa<InitListExpr>(Init))
- CGF.EmitAggExpr(Init, NextVal, VolatileDest);
- else
- // FIXME: volatility
- Builder.CreateStore(CGF.EmitScalarExpr(Init), NextVal);
- }
-
- // Emit remaining default initializers
- unsigned NumArrayElements = AType->getNumElements();
- QualType QType = E->getInit(0)->getType();
- const llvm::Type *EType = AType->getElementType();
- for (/*Do not initialize i*/; i < NumArrayElements; ++i) {
- llvm::Value *NextVal = Builder.CreateStructGEP(DestPtr, i, ".array");
- if (EType->isSingleValueType())
- // FIXME: volatility
- Builder.CreateStore(llvm::Constant::getNullValue(EType), NextVal);
- else
- CGF.EmitAggregateClear(NextVal, QType);
- }
- } else
- assert(false && "Invalid initializer");
-}
-
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
// FIXME: Are initializers affected by volatile?
if (isa<ImplicitValueInitExpr>(E)) {
More information about the cfe-commits
mailing list