diff options
author | Mike Stump <mrs@apple.com> | 2009-05-23 22:29:41 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-05-23 22:29:41 +0000 |
commit | 27fe2e6c97a3782a0639d87b460741e8ba5d076d (patch) | |
tree | d42d7040ec197ba6a43d9e3ab7a6de3f8489bb1b /lib/CodeGen/CGExprAgg.cpp | |
parent | 9ccb103c6f777fc42343b23b19a8c2c9a740e6e8 (diff) |
Track volatile aggregate copies better. I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 3b7871390c..b37b7d284e 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -144,7 +144,8 @@ void AggExprEmitter::EmitFinalDestCopy(const Expr *E, RValue Src) { // FIXME: Pass VolatileDest as well. I think we also need to merge volatile // from the source as well, as we can't eliminate it if either operand // is volatile, unless copy has volatile for both source and destination.. - CGF.EmitAggregateCopy(DestPtr, Src.getAggregateAddr(), E->getType()); + CGF.EmitAggregateCopy(DestPtr, Src.getAggregateAddr(), E->getType(), + VolatileDest|Src.isVolatileQualified()); } /// EmitFinalDestCopy - Perform the final copy to DestPtr, if desired. @@ -484,7 +485,8 @@ void CodeGenFunction::EmitAggregateClear(llvm::Value *DestPtr, QualType Ty) { } void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr, - llvm::Value *SrcPtr, QualType Ty) { + llvm::Value *SrcPtr, QualType Ty, + bool isVolatile) { assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex"); // Aggregate assignment turns into llvm.memcpy. This is almost valid per @@ -520,7 +522,8 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr, // } // // either, we need to use a differnt call here, or the backend needs to be - // taught to not do this. + // taught to not do this. We use isVolatile to indicate when either the + // source or the destination is volatile. Builder.CreateCall4(CGM.getMemCpyFn(), DestPtr, SrcPtr, // TypeInfo.first describes size in bits. |