be slightly more volatile correct


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41444 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp
index 9fd0673..031216e 100644
--- a/CodeGen/CGDecl.cpp
+++ b/CodeGen/CGDecl.cpp
@@ -89,7 +89,7 @@
       llvm::Value *V = EmitScalarExpr(Init);
       Builder.CreateStore(V, DeclPtr, D.getType().isVolatileQualified());
     } else if (Init->getType()->isComplexType()) {
-      EmitComplexExprIntoAddr(Init, DeclPtr);
+      EmitComplexExprIntoAddr(Init, DeclPtr, D.getType().isVolatileQualified());
     } else {
       EmitAggExpr(Init, DeclPtr, D.getType().isVolatileQualified());
     }
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index 58b4059..71674e0 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -450,7 +450,7 @@
   if (!E->getType()->isComplexType()) {
     EmitAggExpr(E, DestMem, false);
   } else if (NeedResult)
-    EmitComplexExprIntoAddr(E, DestMem);
+    EmitComplexExprIntoAddr(E, DestMem, false);
   else
     EmitComplexExpr(E);
   
diff --git a/CodeGen/CGExprComplex.cpp b/CodeGen/CGExprComplex.cpp
index 49b5859..9f1bd2a 100644
--- a/CodeGen/CGExprComplex.cpp
+++ b/CodeGen/CGExprComplex.cpp
@@ -383,10 +383,11 @@
 /// EmitComplexExprIntoAddr - Emit the computation of the specified expression
 /// of complex type, storing into the specified Value*.
 void CodeGenFunction::EmitComplexExprIntoAddr(const Expr *E,
-                                              llvm::Value *DestAddr) {
+                                              llvm::Value *DestAddr,
+                                              bool DestIsVolatile) {
   assert(E && E->getType()->isComplexType() &&
          "Invalid complex expression to emit");
   ComplexExprEmitter Emitter(*this);
   ComplexPairTy Val = Emitter.Visit(const_cast<Expr*>(E));
-  Emitter.EmitStoreOfComplex(Val, DestAddr, false);
+  Emitter.EmitStoreOfComplex(Val, DestAddr, DestIsVolatile);
 }
diff --git a/CodeGen/CGStmt.cpp b/CodeGen/CGStmt.cpp
index 014f0aa..32d5f47 100644
--- a/CodeGen/CGStmt.cpp
+++ b/CodeGen/CGStmt.cpp
@@ -290,7 +290,7 @@
     Builder.CreateRet(EmitScalarExpr(RV));
   } else if (RV->getType()->isComplexType()) {
     llvm::Value *SRetPtr = CurFn->arg_begin();
-    EmitComplexExprIntoAddr(RV, SRetPtr);
+    EmitComplexExprIntoAddr(RV, SRetPtr, false);
   } else {
     llvm::Value *SRetPtr = CurFn->arg_begin();
     EmitAggExpr(RV, SRetPtr, false);
diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h
index 29b1938..ae81f0c 100644
--- a/CodeGen/CodeGenFunction.h
+++ b/CodeGen/CodeGenFunction.h
@@ -374,7 +374,8 @@
   
   /// EmitComplexExprIntoAddr - Emit the computation of the specified expression
   /// of complex type, storing into the specified Value*.
-  void EmitComplexExprIntoAddr(const Expr *E, llvm::Value *DestAddr);
+  void EmitComplexExprIntoAddr(const Expr *E, llvm::Value *DestAddr,
+                               bool DestIsVolatile);
 };
 }  // end namespace CodeGen
 }  // end namespace clang