diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-12-04 01:30:56 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-12-04 01:30:56 +0000 |
commit | 6d11ec8cb8463f0df990fab0543c3398832be733 (patch) | |
tree | 1c58f491ca50db0130cf8d8797a7abc831d595ea /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 43d4a899c480c4ddcf73136a9455e44afd42dfc7 (diff) | |
download | bcm5719-llvm-6d11ec8cb8463f0df990fab0543c3398832be733.tar.gz bcm5719-llvm-6d11ec8cb8463f0df990fab0543c3398832be733.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index d225d907c8a..d53dbb73462 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -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 |