diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:37:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:37:01 +0000 |
commit | 9619662a1d42e2008b865d3459c0677e149dad1b (patch) | |
tree | 0714b13525e4c45644753ff246259e78f6775fd5 /lib/CodeGen/CGExprComplex.cpp | |
parent | 8b51fd76319d8b71f401cc6ad56e6f4f7be77958 (diff) |
remove uses of QualType::getCanonicalType() from codegen for PR2189
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 6bf0d48c1e..2ea0a48a75 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -259,8 +259,8 @@ ComplexPairTy ComplexExprEmitter::EmitComplexToComplexCast(ComplexPairTy Val, QualType SrcType, QualType DestType) { // Get the src/dest element type. - SrcType = cast<ComplexType>(SrcType.getCanonicalType())->getElementType(); - DestType = cast<ComplexType>(DestType.getCanonicalType())->getElementType(); + SrcType = SrcType->getAsComplexType()->getElementType(); + DestType = DestType->getAsComplexType()->getElementType(); // C99 6.3.1.6: When a value of complextype is converted to another // complex type, both the real and imaginary parts followthe conversion @@ -282,7 +282,7 @@ ComplexPairTy ComplexExprEmitter::EmitCast(Expr *Op, QualType DestTy) { llvm::Value *Elt = CGF.EmitScalarExpr(Op); // Convert the input element to the element type of the complex. - DestTy = cast<ComplexType>(DestTy.getCanonicalType())->getElementType(); + DestTy = DestTy->getAsComplexType()->getElementType(); Elt = CGF.EmitScalarConversion(Elt, Op->getType(), DestTy); // Return (realval, 0). @@ -437,8 +437,9 @@ EmitCompoundAssign(const CompoundAssignOperator *E, } ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) { - assert(E->getLHS()->getType().getCanonicalType() == - E->getRHS()->getType().getCanonicalType() && "Invalid assignment"); + assert(CGF.getContext().getCanonicalType(E->getLHS()->getType()) == + CGF.getContext().getCanonicalType(E->getRHS()->getType()) && + "Invalid assignment"); // Emit the RHS. ComplexPairTy Val = Visit(E->getRHS()); |