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());
}
if (!E->getType()->isComplexType()) {
EmitAggExpr(E, DestMem, false);
} else if (NeedResult)
- EmitComplexExprIntoAddr(E, DestMem);
+ EmitComplexExprIntoAddr(E, DestMem, false);
else
EmitComplexExpr(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);
}
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);
/// 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