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
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 448f7ec..3b5eba8 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -404,7 +404,7 @@
if (E->getOpcode() == UnaryOperator::Extension)
return EmitLValue(E->getSubExpr());
- QualType ExprTy=CGM.getContext().getCanonicalType(E->getSubExpr()->getType());
+ QualType ExprTy = getContext().getCanonicalType(E->getSubExpr()->getType());
switch (E->getOpcode()) {
default: assert(0 && "Unknown unary operator lvalue!");
case UnaryOperator::Deref:
@@ -503,7 +503,7 @@
// size is a VLA.
if (!E->getType()->isConstantSizeType())
assert(0 && "VLA idx not implemented");
- QualType ExprTy = CGM.getContext().getCanonicalType(E->getBase()->getType());
+ QualType ExprTy = getContext().getCanonicalType(E->getBase()->getType());
return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"),
ExprTy->getAsPointerType()->getPointeeType()
@@ -560,7 +560,7 @@
if (E->isArrow()) {
BaseValue = EmitScalarExpr(BaseExpr);
const PointerType *PTy =
- cast<PointerType>(BaseExpr->getType().getCanonicalType());
+ cast<PointerType>(getContext().getCanonicalType(BaseExpr->getType()));
if (PTy->getPointeeType()->isUnionType())
isUnion = true;
CVRQualifiers = PTy->getPointeeType().getCVRQualifiers();
@@ -720,7 +720,7 @@
// The callee type will always be a pointer to function type, get the function
// type.
- FnType = cast<PointerType>(FnType.getCanonicalType())->getPointeeType();
+ FnType = FnType->getAsPointerType()->getPointeeType();
QualType ResultType = cast<FunctionType>(FnType)->getResultType();
llvm::SmallVector<llvm::Value*, 16> Args;