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 | f3bc75afcfb2bf799776b0f765e145e8cc72d351 (patch) | |
| tree | db6a8dad9a8efb4e4d68a161962442a1a08305e9 /clang/lib/CodeGen/CGExprScalar.cpp | |
| parent | 50ad37b6d95cf680aa482cd14419dbb393b69c92 (diff) | |
Since isComplexType() no longer returns true for _Complex integers, the code
generator needs to call isAnyComplexType(). This fixes PR1960.
llvm-svn: 49220
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index a50e66660f93..de138a1d6be0 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/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); |
