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 | 0f398c44722b9772121dd28815f7d6152571693f (patch) | |
tree | ba44622b307113070a283206b114a56513b70a05 /clang/lib/CodeGen/CGExprComplex.cpp | |
parent | 3f6cd0bc76b29da9a98ce84149d254edfd50b56b (diff) | |
download | bcm5719-llvm-0f398c44722b9772121dd28815f7d6152571693f.tar.gz bcm5719-llvm-0f398c44722b9772121dd28815f7d6152571693f.zip |
remove uses of QualType::getCanonicalType() from codegen for PR2189
llvm-svn: 54107
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index 6bf0d48c1ec..2ea0a48a75d 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/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()); |