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/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 813bcfb..2aaf297 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -627,8 +627,8 @@
llvm::Constant *EmitConversion(llvm::Constant *Src, QualType SrcType,
QualType DstType) {
- SrcType = SrcType.getCanonicalType();
- DstType = DstType.getCanonicalType();
+ SrcType = CGF->getContext().getCanonicalType(SrcType);
+ DstType = CGF->getContext().getCanonicalType(DstType);
if (SrcType == DstType) return Src;
// Handle conversions to bool first, they are special: comparisons against 0.
@@ -813,9 +813,8 @@
llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
- CodeGenFunction *CGF)
-{
- QualType type = E->getType().getCanonicalType();
+ CodeGenFunction *CGF) {
+ QualType type = Context.getCanonicalType(E->getType());
if (type->isIntegerType()) {
llvm::APSInt Value(static_cast<uint32_t>(Context.getTypeSize(type)));