diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-04 16:54:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-04 16:54:41 +0000 |
commit | 9b2dc287177394a8f73833e2ad4f7ca8cd6f22bb (patch) | |
tree | b1fde547077d020b5141ca5c5d54c2388587586c /lib/CodeGen/CGExprScalar.cpp | |
parent | f23d364084d1aabea688222780d6fc1dd8c7f78c (diff) |
Since isComplexType() no longer returns true for _Complex integers, the code
generator needs to call isAnyComplexType(). This fixes PR1960.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index a50e66660f..de138a1d6b 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -466,7 +466,7 @@ Value *ScalarExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) { if (!CGF.hasAggregateLLVMType(ArgTy)) { // Scalar argument is passed by-value. Args.push_back(CGF.EmitScalarExpr(ArgExpr)); - } else if (ArgTy->isComplexType()) { + } else if (ArgTy->isAnyComplexType()) { // Make a temporary alloca to pass the argument. llvm::Value *DestMem = CGF.CreateTempAlloca(ConvertType(ArgTy)); CGF.EmitComplexExprIntoAddr(ArgExpr, DestMem, false); @@ -559,7 +559,7 @@ Value *ScalarExprEmitter::EmitCastExpr(const Expr *E, QualType DestTy) { return EmitScalarConversion(Src, E->getType(), DestTy); } - if (E->getType()->isComplexType()) { + if (E->getType()->isAnyComplexType()) { // Handle cases where the source is a complex type. return EmitComplexToScalarConversion(CGF.EmitComplexExpr(E), E->getType(), DestTy); @@ -669,13 +669,13 @@ Value *ScalarExprEmitter::EmitSizeAlignOf(QualType TypeToSize, Value *ScalarExprEmitter::VisitUnaryReal(const UnaryOperator *E) { Expr *Op = E->getSubExpr(); - if (Op->getType()->isComplexType()) + if (Op->getType()->isAnyComplexType()) return CGF.EmitComplexExpr(Op).first; return Visit(Op); } Value *ScalarExprEmitter::VisitUnaryImag(const UnaryOperator *E) { Expr *Op = E->getSubExpr(); - if (Op->getType()->isComplexType()) + if (Op->getType()->isAnyComplexType()) return CGF.EmitComplexExpr(Op).second; // __imag on a scalar returns zero. Emit it the subexpr to ensure side @@ -894,7 +894,7 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc, unsigned SICmpOpc, unsigned FCmpOpc) { Value *Result; QualType LHSTy = E->getLHS()->getType(); - if (!LHSTy->isComplexType()) { + if (!LHSTy->isAnyComplexType()) { Value *LHS = Visit(E->getLHS()); Value *RHS = Visit(E->getRHS()); @@ -1130,7 +1130,7 @@ Value *CodeGenFunction::EmitScalarConversion(Value *Src, QualType SrcTy, Value *CodeGenFunction::EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy, QualType DstTy) { - assert(SrcTy->isComplexType() && !hasAggregateLLVMType(DstTy) && + assert(SrcTy->isAnyComplexType() && !hasAggregateLLVMType(DstTy) && "Invalid complex -> scalar conversion"); return ScalarExprEmitter(*this).EmitComplexToScalarConversion(Src, SrcTy, DstTy); |