From 9619662a1d42e2008b865d3459c0677e149dad1b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Jul 2008 22:37:01 +0000 Subject: 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 --- lib/CodeGen/CGExprComplex.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/CGExprComplex.cpp') 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(SrcType.getCanonicalType())->getElementType(); - DestType = cast(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(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()); -- cgit v1.2.3