aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CodeGen/CGDecl.cpp2
-rw-r--r--CodeGen/CGExpr.cpp2
-rw-r--r--CodeGen/CGExprComplex.cpp5
-rw-r--r--CodeGen/CGStmt.cpp2
-rw-r--r--CodeGen/CodeGenFunction.h3
5 files changed, 8 insertions, 6 deletions
diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp
index 9fd0673db1..031216ebeb 100644
--- a/CodeGen/CGDecl.cpp
+++ b/CodeGen/CGDecl.cpp
@@ -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());
}
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index 58b4059aeb..71674e0263 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -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);
diff --git a/CodeGen/CGExprComplex.cpp b/CodeGen/CGExprComplex.cpp
index 49b5859f8b..9f1bd2a0ac 100644
--- a/CodeGen/CGExprComplex.cpp
+++ b/CodeGen/CGExprComplex.cpp
@@ -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);
}
diff --git a/CodeGen/CGStmt.cpp b/CodeGen/CGStmt.cpp
index 014f0aa85b..32d5f47fec 100644
--- a/CodeGen/CGStmt.cpp
+++ b/CodeGen/CGStmt.cpp
@@ -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);
diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h
index 29b193890b..ae81f0c014 100644
--- a/CodeGen/CodeGenFunction.h
+++ b/CodeGen/CodeGenFunction.h
@@ -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