diff options
author | John McCall <rjmccall@apple.com> | 2013-03-07 21:36:54 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-03-07 21:36:54 +0000 |
commit | bea4c3d8c4fb333bd7f5c3c174c56a733e77edb1 (patch) | |
tree | 4b59fbb6c01027ff370a0d3e2ae4548d77e95fdd /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 95e1936477f6cf92938f81f120fac6e456b96273 (diff) | |
download | bcm5719-llvm-bea4c3d8c4fb333bd7f5c3c174c56a733e77edb1.tar.gz bcm5719-llvm-bea4c3d8c4fb333bd7f5c3c174c56a733e77edb1.zip |
Evaluate compound literals directly into the result aggregate
when that aggregate isn't potentially aliased.
llvm-svn: 176654
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 8c64e8a6e72..f9f27334015 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -531,12 +531,10 @@ void AggExprEmitter::VisitOpaqueValueExpr(OpaqueValueExpr *e) { void AggExprEmitter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { - if (E->getType().isPODType(CGF.getContext())) { + if (Dest.isPotentiallyAliased() && + E->getType().isPODType(CGF.getContext())) { // For a POD type, just emit a load of the lvalue + a copy, because our // compound literal might alias the destination. - // FIXME: This is a band-aid; the real problem appears to be in our handling - // of assignments, where we store directly into the LHS without checking - // whether anything in the RHS aliases. EmitAggLoadOfLValue(E); return; } |