]> granicus.if.org Git - clang/commitdiff
be slightly more volatile correct
authorChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 16:22:13 +0000 (16:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 16:22:13 +0000 (16:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41444 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGDecl.cpp
CodeGen/CGExpr.cpp
CodeGen/CGExprComplex.cpp
CodeGen/CGStmt.cpp
CodeGen/CodeGenFunction.h

index 9fd0673db18ed88c40e10585115c3dbe40b398a0..031216ebebd53b0416db3c9894eee8475463e8fa 100644 (file)
@@ -89,7 +89,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) {
       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());
     }
index 58b4059aebe6795447b597c361fd28c28df8cb65..71674e02632fe51327a8baf0871524930e54c435 100644 (file)
@@ -450,7 +450,7 @@ RValue CodeGenFunction::EmitAnyExpr(const Expr *E, bool NeedResult) {
   if (!E->getType()->isComplexType()) {
     EmitAggExpr(E, DestMem, false);
   } else if (NeedResult)
-    EmitComplexExprIntoAddr(E, DestMem);
+    EmitComplexExprIntoAddr(E, DestMem, false);
   else
     EmitComplexExpr(E);
   
index 49b5859f8be2b838899f5b83e83582c8622b1049..9f1bd2a0ac6bd8480623e0ab3d40fe2dfbcbaee5 100644 (file)
@@ -383,10 +383,11 @@ ComplexPairTy CodeGenFunction::EmitComplexExpr(const Expr *E) {
 /// 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);
 }
index 014f0aa85b3c453d946ec3ae3bd7d8794c4214c4..32d5f47feca154e148fb9e723c307f72002ca940 100644 (file)
@@ -290,7 +290,7 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) {
     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);
index 29b193890b51f47ad365f301474736b41759b01c..ae81f0c014d6798b231d749a196617454984d8d7 100644 (file)
@@ -374,7 +374,8 @@ public:
   
   /// 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