diff options
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index d225d90..2c122eb 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -120,7 +120,7 @@ public: void EmitInitializationToLValue(Expr *E, LValue Address); void EmitNullInitializationToLValue(LValue Address, QualType T); // case Expr::ChooseExprClass: - + void VisitCXXThrowExpr(const CXXThrowExpr *E) { CGF.EmitCXXThrowExpr(E); } }; } // end anonymous namespace. @@ -502,21 +502,16 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) { void AggExprEmitter::VisitInitListExpr(InitListExpr *E) { #if 0 - // FIXME: Disabled while we figure out what to do about - // test/CodeGen/bitfield.c + // FIXME: Assess perf here? Figure out what cases are worth optimizing here + // (Length of globals? Chunks of zeroed-out space?). // // If we can, prefer a copy from a global; this is a lot less code for long // globals, and it's easier for the current optimizers to analyze. - // FIXME: Should we really be doing this? Should we try to avoid cases where - // we emit a global with a lot of zeros? Should we try to avoid short - // globals? - if (E->isConstantInitializer(CGF.getContext(), 0)) { - llvm::Constant* C = CGF.CGM.EmitConstantExpr(E, &CGF); + if (llvm::Constant* C = CGF.CGM.EmitConstantExpr(E, E->getType(), &CGF)) { llvm::GlobalVariable* GV = - new llvm::GlobalVariable(C->getType(), true, - llvm::GlobalValue::InternalLinkage, - C, "", &CGF.CGM.getModule(), 0); - EmitFinalDestCopy(E, LValue::MakeAddr(GV, 0)); + new llvm::GlobalVariable(CGF.CGM.getModule(), C->getType(), true, + llvm::GlobalValue::InternalLinkage, C, ""); + EmitFinalDestCopy(E, LValue::MakeAddr(GV, Qualifiers())); return; } #endif |