Update chunk of #if 0'ed code to remove fixed FIXME and make it compile. We

probably want to do some sort of performance assessment before enabling it,
though.

llvm-svn: 90510
This commit is contained in:
Eli Friedman 2009-12-04 01:30:56 +00:00
parent 43d4a899c4
commit 6d11ec8cb8
1 changed files with 6 additions and 11 deletions

View File

@ -502,21 +502,16 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) {
void AggExprEmitter::VisitInitListExpr(InitListExpr *E) { void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
#if 0 #if 0
// FIXME: Disabled while we figure out what to do about // FIXME: Assess perf here? Figure out what cases are worth optimizing here
// test/CodeGen/bitfield.c // (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 // 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. // 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 if (llvm::Constant* C = CGF.CGM.EmitConstantExpr(E, E->getType(), &CGF)) {
// 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);
llvm::GlobalVariable* GV = llvm::GlobalVariable* GV =
new llvm::GlobalVariable(C->getType(), true, new llvm::GlobalVariable(CGF.CGM.getModule(), C->getType(), true,
llvm::GlobalValue::InternalLinkage, llvm::GlobalValue::InternalLinkage, C, "");
C, "", &CGF.CGM.getModule(), 0); EmitFinalDestCopy(E, LValue::MakeAddr(GV, Qualifiers()));
EmitFinalDestCopy(E, LValue::MakeAddr(GV, 0));
return; return;
} }
#endif #endif